Eclipse is a development environment for modular cross-platform applications. Introducing the Eclipse shell. JAVA Syntax Basics

In this article I wanted to talk about how to create applications using Eclipse RCP (Rich Client Platform). The reason for writing was the fact that there are absolutely no articles on Habré describing this platform. As an example, we'll create a custom input form; The correctness of the data will be checked using the JFace Data Binding framework. For starters, I’ll give below a screenshot of what we should get.

What is Eclipse RCP

To begin with, it is still necessary to say what Eclipse RCP is. Eclipse is a development environment written in Java, developed and supported by the Eclipse Foundation (whose members include IBM, SAP, Oracle, companies offering products based on Eclipse RCP and participating in the development of the ecosystem Google, RedHat, Adobe, Cisco, Intel). Eclipse RCP is a set of plugins for creating so-called rich client applications. Everything that the user sees when opening the Eclipse IDE is a plugin created on the basis of this platform. The user can create his own plugins based on a huge number of existing ones, and if necessary, you can find most popular frameworks, such as Hibernate, Google Guice, Google Guava, JUnit, TestNG in the form of plugins. It's also worth noting that the runtime architecture is based on the service platform specification OSGI, this specification describes how modular applications can be created and run. Eclipse, as mentioned above, is written in Java and is positioned as a cross-platform product (in 90% of cases, the RCP application will be built on Windows, Linux and Mac). All plugins that make up the core of the platform, and most third party plugins distributed under the EPL (Eclipse Public License). The user interface of RCP applications is based on the visual components of the SWT and JFace frameworks, as well as native Eclipse widgets. The figures below show what components an application based on the RCP platform consists of, and the structure of the Eclipse platform itself.


Figure 1 - Components used in the RCP application (figure taken from this site)


Figure 2 – Eclipse Architecture (picture taken from this site)

Pros and cons of the platform
The main question is why this platform is so good and why use it to develop desktop applications (by the way, it is possible to develop web applications and applications for mobile platforms). Modularity, cross-platform, multilingual support, free, a huge number of existing plugins, libraries and frameworks. All this allows you to create commercial-grade applications (a link to a list of existing applications developed on this platform is given at the end of the article). The disadvantages include a fairly high level of entry, since to develop a serious application you need to know at least in general terms how the OSGI framework works, and be able to work with SWT and JFace components and widgets. Also, for Russian-speaking developers, the problem will be to find any materials or books about the frameworks and libraries mentioned above (links to the resources found, including Russian-language ones, are given at the end of the article), although conferences are periodically held in Europe and the USA, organized by participants Eclipse Foundation, in Germany, publishes a special magazine that talks about new plugins and contains a lot of examples of their use, and there is also a whole series of books in German that describes all the nuances and subtleties of development. In English you can find a special series of books, the eclipse series, from Addison-Wesley, and you can also find a couple of books from Apress. But there are negligibly few materials and books in our native language.

Let's get started

Installing the necessary plugins
Let's move on to creating our first RCP application. To work, we need to download the assembly: Eclipse for RCP and RAP Developers from the official website. If Eclipse IDE is already installed, you can use the update manager. Select Help->Install New Software from the main menu. In the Install window that appears at the top, select the site with updates we need from the drop-down list - download.eclipse.org/releases/indigo, if there is no such site in the list, then click the Add button on the right, in the Name field write - Indigo Update Site, in the Location field - the address given above, click OK (if when adding an address a message appears - Duplicate location, then the address already exists in list of Available Software Sites, the list of update sites can be viewed in the previous Install window by clicking on the Available Software Sites link, which is located under the drop-down list). After selecting the update site, a tree-like list will appear below (if the Group items by category checkbox is checked), open the General Purpose Tools item and select Eclipse Plug-in Development Environment, then open the EclipseRT Target Platform Components item and mark the plugin - Eclipse RCP Plug-in Developer Resources, these are the two plugins we need to create our project. Next, click Next twice, accept license agreement and click on the Finish button; That's it, the installation of the necessary plugins will begin. After installation, we will be asked to restart Eclipse, which we will do.


Figure 3 – Plugin installation window

Creating a Project
After the reboot, select File->New->Other in the main menu, select Plug-in Development, then select Plug-in Project in the drop-down menu.


Figure 4 – Menu for selecting the type of project to be created

Click Next, we need to give a name to our project, let it be called first.rcp.application, click Next again. In the next window we need to specify the name of the application; in the Name field we will write First RCP Application. Uncheck the Generate an activator, a Java class that controls the plug-in’s life cycle; for our simple application the activator class is not needed. Let's leave the checkbox on the item - This plug-in will make contributions to the UI, since our application will contain user interface. Let's leave the third item Enable API Analysis unchecked. To the question - Would you like to create a rich client application? Let's answer Yes.


Figure 5 – Plugin creation window

Click Next, we will be asked to select a template for the future application, select - Hello RCP and click Next.


Figure 6 - RCP project template selection window

In the last window, in the Application window title field write - User Form, in the Application class field - MyApplication. Leave the Add branding checkbox inactive. Click the Finish button. We will be asked to switch to the Plug-in Development perspective, we will agree with this proposal.


Figure 7 - RCP project template configuration window

Project structure
So we have the structure of the newly created project.


Figure 8 – Project structure

Contents of the five classes in the first.rcp.application package in this moment we are not interested, I’ll just say that it’s great MyApplication This is in some way the main() method of a regular Java program, this class is responsible for how our plugin will be launched and how it will be stopped. In class ApplicationWorkbenchWindowAdvisor, we can set the application window size using the following line of code:
configurer.setInitialSize(new Point(400, 300));
We can also see that the toolbar and status bar will not be shown by default:
configurer.setShowCoolBar(false);
configurer.setShowStatusLine(false);
The last line sets the title of the main window:
configurer.setTitle("User Form");
Class ApplicationActionBarAdvisor is responsible for customizing the menu bar of our application. Class Perspective is responsible for the location and size of editors and views that are located in a given perspective; an RCP application must have at least one perspective.

Launch of the project
In order to run the application we just created, we need to go to the META-INF folder and open the file MANIFEST.MF, if you suddenly closed it (this file is opened by default when creating a project).


Figure 9 – RCP application properties editor

This file allows us to change many project settings, connect additional plugins, connect and manage extensions, configure the build of our plugin, and much more. We are on the Overview tab, in the Testing section we click on the link - Launch an Eclipse application, after a moment our application window will appear on the screen, close it and move on to the next stage.


Figure 10 – Our application window

Adding a view

Adding an extension
Our task is to create a view on which we can place graphical interface elements. Let's go back to the file MANIFEST.MF, select the tab at the bottom – Extensions. We can see that by default we have two extensions: org.eclipse.core.runtime.applications and org.eclipse.ui.perspectives. The first extension is associated with our application class MyApplication, if we select this extension and expand the tree list to the first.rcp.application.MyApplication (run) node, we will see that the class field contains the name of this particular class. Returning to the root node this list, on the right in the Extension Details section we will see two fields, the values ​​of which we can also change (we won’t do this now): ID – application identifier and Name – application name.

The second extension is responsible for setting the perspective of our application. File MANIFEST.MF allows us, without looking into the code of the Perspective class, to specify which views and/or editors this perspective will contain, their position, size and ratio. By clicking on this extension and going to the child item we can see that in the Extension Element Details section we can specify the perspective class, ID and name. It should be noted that such changes, as mentioned above, can be made by directly editing the class code that is associated with this extension and editing the file plugin.xml, but I wouldn’t want to complicate the creation of our first project.


Figure 11 – Tab with extensions of our project

We need to add a new extension to create the view. To do this, click on the Add button and in the window that appears, enter views in the Extension Point filter field, there should be only one extension left - org.eclipse.ui.views, select it and click Finish.


Figure 12 – New extension selection window

We should have one more, third extension in the list of extensions.

Setting the view
Let's right-click on the extension we added, a context menu will appear, select New->view in it, thereby we will add an element to our extension (this element is the view we need). The settings for this element will appear on the right side. First, let's create a class for our view. We can do this by clicking on the class* link.


Figure 13 – View settings

A standard dialog for creating a Java class will open, give it a name – MainView; as we can see, this class inherits from the class org.eclipse.ui.part.ViewPart, the parent class for all types. Let's complete the creation of the class by clicking on the Finish button. There is very little left, after creating a class for our view, its code will open in front of us, we will create a static variable that will contain the identifier of this view, we will set the canonical name of this class as the identifier. Let's write the following:

public class MainView extends ViewPart (
public static final String ID = MainView.class.getCanonicalName();

}
Let's go back to the file MANIFEST.MF, open the Extension tab, copy the contents of the class* field and paste it into the ID field. Now the class name and the identifier of this type are the same; this technique is a good practice, as it always allows you to quickly find the desired type and find out its identifier. In the name* field we will write – User Form. The entire view has been created; it remains to connect it with our perspective, since the view itself cannot be used, in other words, it must belong to some perspective.

Setting the view position
We can perform further manipulations while remaining in the extension editor or open the code of the perspective class - Perspective.java, which is what we will do. In class Perspective, let's go to the method – createInitialLayout(), this method specifies the initial position of views and editors. In the method we will write the following two lines of code:
layout.setEditorAreaVisible(false);
layout.addStandaloneView(MainView.ID, true, IPageLayout.LEFT, 1.0f, layout.getEditorArea());
The first line tells the layout object that we don't need an editable area since we only have one view and no editors. The second line adds our view, and as a standalone one. The first parameter is our view ID. The second parameter is boolean value, which is responsible for whether the title of our view (User Form) will be shown or not. The third parameter is intended to indicate the orientation of the perspective view, since we have one view and will occupy the entire perspective space, then given value could be anything. The fourth parameter determines the position of this view in relation to other views or editors, since, in our case, one view should occupy the entire perspective space. The last fifth parameter is the editor area identifier. Let's save our changes.
Launching an application with an added view
Let's go back to the file MANIFEST.MF and launch our application again, to do this, go to the Overview tab, in the Testing section, click on the Launch an Eclipse application link. We won’t see much difference from how the form looked during the previous launch; only a tab with our view has been added – User Form.


Figure 14 – Our application window with an added view

That's all for today, to be continued in the next article.

Eclipse is a Java-based, open source, extensible development platform. In essence, it is simply a development environment and a set of services for building applications based on embedded components (plugins). Fortunately, Eclipse comes with a standard set of plugins, including the well-known Java Development Tools (JDT).

While most users who use Eclipse as a Java integrated development environment (IDE) are happy with it, there's much more to it than that. Eclipse also includes a plugin development environment (PDE), which will primarily be of interest to those who want to extend Eclipse itself, as it allows you to create your own tools that are built into the Eclipse environment. Because Eclipse is made entirely of plugins, all toolkit developers have the opportunity to offer their own extensions to Eclipse and provide users with a consistent and seamless integrated development environment (IDE).

This integrity and consistency is not unique to Java development tools. Although Eclipse is written in Java, it can be used with other languages. For example, plugins are already available (or are being developed) that support programming languages ​​such as C/C++ and COBOL. The Eclipse framework can also be used as a basis for other types of applications unrelated to software development, such as content management systems.

An excellent example of an Eclipse-based application is IBM's Rational Software Architect, which forms the basis of IBM's family of Java development tools.

Eclipse is open source

Open source software is released under a license designed to guarantee certain rights to users. The most obvious of them, of course, is that the source code must be provided to users, and they have every right to modify and distribute the software themselves. This protection of user rights is achieved using a mechanism called "copyleft": License software stands for copyright protection and prohibits the distribution of software if the user is not granted such rights. A copyleft license also requires that all software distributed by users be covered by the original license without modification. Thus, the meaning of copyright is essentially turned upside down, and a copyleft license, which uses copyright to give rights to the user rather than to retain them for the software developer, is often jokingly said “all rights are perverted” (all rights reversed).

Much of the common fear, uncertainty, and doubt about open source software is based on the so-called viral nature of some copyleft licenses. The idea is that if you use open source software as part of a program you develop yourself, you will lose your intellectual property because the license will contaminate your private parts of the program. In other words, the license may require that all open source software, including any newly created software, be distributed under the same license. While this is true for the most famous copyleft license, the GNU General Public License (under which, for example, Linux is distributed), there are other licenses that provide a different balance of commercial and public interests.

Open Software Initiative - OSI (Open Software Initiative) is a non-profit organization that clearly defines what constitutes open source and certifies licenses that meet its criteria. Eclipse is distributed under the EPL - Eclipse Public License V1.0, an OSI-approved license designed to facilitate commercial acceptance of Eclipse while maintaining credit to the original code authors.

Those who create plugins for Eclipse or use Eclipse as a base for software development are required to publish any Eclipse code they use or modify under the EPL, but are free to license their own add-ons as they like. Native code bundled with software from Eclipse does not need to be licensed as open source, and the source code itself does not need to be made publicly available.

While most programmers wouldn't use Eclipse to develop plugins or create new products based on it, the open source nature of Eclipse is significant not only because it makes Eclipse available completely free of charge (and despite its commercially oriented nature). the license implies that plugins may cost money). Open source promotes innovation and creates an incentive for developers (even commercial ones) to contribute their source code to the community. There are several reasons for this, but perhaps the most significant is that the more developers contribute to the project, the more meaningful it becomes for everyone. And when a project becomes useful, more developers will use it and create a community around it, similar to those that have formed around Apache and Linux.

What is Eclipse?

Eclipse is an open source community of developers whose projects aim to build an open development platform consisting of an extensible development environment, tooling, and runtime libraries for building, deploying, and managing software during its runtime. life cycle. The Eclipse Foundation is a non-profit, member-supported organization that hosts Eclipse projects and helps improve the open source community and ecosystem of complementary products and services.

The Eclipse project was created in November 2001 by IBM and supported by a consortium of software vendors. The Eclipse Foundation was created in January 2004 as an independent, non-profit organization serving as a steward of the Eclipse community. It was created to help a vendor-neutral, open, and transparent community grow around Eclipse. Today's Eclipse community consists of individuals and organizations representing the software industry.

The Eclipse Foundation oversees and directs ongoing development of Eclipse. The foundation serves the community, but the open source developers, called committers, who essentially work on Eclipse projects, are not on its staff. Typically, Eclipse committers are members of some organization or are independent developers who volunteer their time to work on an open source project.

Now that we've looked at the theoretical, historical, and political aspects of Eclipse, let's look at the product itself.

Eclipse workspace

When you first launch Eclipse, you will see a Welcome page inside the workspace (see Figure 1). An Eclipse user has several options to navigate to the overview page, which is what I recommend doing (see Figure 2). Next, you can get acquainted with information on new functions, study some examples, or take a training course.

Figure 2. Eclipse overview page

The Eclipse workspace consists of several panels called views, such as navigation or outline views. A set of such representations is called perspective. One of the most common perspectives is the Resource perspective, which is a basic set of views for managing projects and viewing and editing project files.

I recommend that most first-time users start with the overview page shown in Figure 2 and learn more about Eclipse. The workbench basics section contains a lot of useful initial information about the various components of Eclipse and how they interact with each other. Take a few minutes to read this, and then let's dive into Eclipse's Java Development Tools (JDT). The best way to learn something - try it in practice.

Continuing this short tour of Eclipse, we'll create a new project in Java. Select File > New > Java Project and enter Hello when prompted for the project name, then click Finish.

Now let's look at the "Java" perspective (if you're not already in it). Depending on how you prefer to control your screen, you can either change the perspective in the current window by selecting Window > Open Perspective > Java (Window > Open Perspective > Java), or open a new window by selecting Window > New Window, and choose a new perspective.

As you might expect, the Java perspective has a set of views designed to guide Java development. One of them, located in the upper left corner, is a hierarchy containing various Java packages, classes, JAR archives and various files. This view is called Package Explorer. Please note that two new items have been added to the main menu: Source and Refactor.

Java Development Tools (JDT)

To try out the Java development environment, we will create and run an application called "Hello World". While in the Java perspective, right-click on the folder with the project's source test "Hello" (src) and select New > Class, as shown in Figure 3. In the dialog box that appears, enter Hello as the class name. Below is the inscription Which method stubs would you like to create? (What method stubs do you want to create?) note public static void main(String args) and click Finish.

Figure 3. Creating a new class in the Java perspective

This will create a .java file with the Hello class and an empty main() method in the editor area, as shown in Figure 4. Let's add the following code to the method (note that the description for i has been deliberately omitted).

Figure 4. Hello class in the Java editor

As you type, you'll notice some of the Eclipse editor's features, including syntax checking and automatic code completion. Also, when you enter an opening parenthesis or double quotes, Eclipse automatically inserts a closing pair for them and places the cursor in the middle.

In other cases, you can cause automatic code completion using the combination Ctrl+1. The code completion function provides a context-sensitive list of options from which you can select using the keyboard or mouse. Options can be a list of methods specific to a particular object, or a piece of code based on various keywords, such as for or while .

Syntax checking depends on incremental compilation. As you save the code, it compiles to background and checked for syntax errors. By default, syntax errors are underlined in red and a red dot with a white X appears in the left margin. Other errors are marked in the editor's margin with a light bulb symbol; these are problems that the editor could fix for you (a feature called Quick Fix).

In the code above, the light bulb sign appears next to the for statement because the description for i was omitted. Double tap mouse on the light bulb will cause a list of suggested fixes to appear. In our case, we will be asked to create a class field i, a local variable i, or a parameter i for a method; selecting any of these options with the mouse will show the code that will be generated. Figure 5 shows the list of suggested options and the code suggested in the case of a local variable.

Figure 5: Quick Fix options

Double-clicking on a sentence inserts the code into the desired place in the program.

If the program compiles without errors, you can run it by selecting Run in the Eclipse menu. (Note that there is no separate step for compilation because compilation occurs as you save the code. If your code has no syntax errors, it is ready to run.) The Launch Configurations dialog appears with the desired defaults; click Run bottom right. Appears in the bottom panel new panel with tabs (Console), displaying the result of the program, as shown below.

Figure 6. Result of the program

You can also run the program in the Java debugger. First you need to set a breakpoint in main() System.out.println() by double-clicking the gray box on the left side of the edit window next to the System.out.println() call. A blue dot will appear. On the menu Run select team Debug. As described earlier, the "Launch Configurations" dialog will appear. Select a team Run. The perspective will automatically change to the Debug perspective, which contains a number of interesting new views, as shown below.

Figure 7. Debug Perspective

Notice the Debug view in the top left corner of the perspective. This view shows the call stack and contains a toolbar in the title bar that allows you to control program execution. The panel has buttons to continue, pause or end the program, move to the next statement, step over the next statement, or return from a method. The panel at the top right contains a number of tabbed views, including Variables, Breakpoints, Expressions, and Display. The Variables tab is now selected, so we can see the current value of the i variable.

More detailed information about any of the views can be obtained using the context tooltip; To do this, click on the view title and press F1.

Additional plugins

In addition to JDT-type plugins for editing, compiling, and debugging applications, there are plugins that support the entire development process: modeling, build automation, unit testing, performance testing, versioning and configuration management.

Eclipse includes a plugin for working with the Concurrent Versions System (CVS) for source code management. The Team plugin connects to the CVS server, allowing members of a development team to work with a set of files containing source code without interfering with changes made by others. We won't explore source management from Eclipse in more detail here since that would require installing a CVS server, although the ability to support a team of developers rather than just self-development is an important and integral part of Eclipse.

Plugins that are maintained and distributed by the Eclipse Foundation can be found on the Eclipse Web site. Most full list available plugins is available on the Eclipse Plug-in Central page, which serves as a plugin directory.

Eclipse Platform Architecture

The Eclipse platform contains a powerful set of plugins (see Figure 8) that support projects such as JDT and PDE.

Figure 8. Simplified architecture of the Eclipse platform

The dark blue blocks represent components that are central to the Rich Client Platform (RCP) in Eclipse. The concept of RCP itself is beyond the scope of this article, but let's consider RCP to be simply a set of plugins from Eclipse that people can use in developing applications such as Lotus Notes® 8. The light blue blocks represent optional (though recommended) components to include into RCP-based applications. And the gray blocks are completely optional. The platform consists of several components, we will look at some of them:

Runtime Runtime is the code that defines the Eclipse plugin model, based on the OSGi specification and the idea of ​​extensions and extension points. Runtime also provides additional services such as syslogging and concurrency. JFace/SWT The Standard Widget Toolkit (SWT) is a collection of widgets that provide the user interface and functionality of Eclipse. JFace is simply a superset of SWT that provides several Model-View-Controller (MVC) classes to make development easier graphic applications. Workbench The workspace gives Eclipse its personality. It is at this level that the concept of views, perspectives, and things like editing windows is implemented. Help (User Support) This Eclipse component allows you to provide support to your users. This can be done through a help system, which allows users to search for help documentation, or through "cheat sheets", which can be presented as interactive task lists to end users. Update The update component provides a means for Eclipse to update applications from one version to another. Team The team component is an infrastructure that allows development companies to connect their own version control systems. A sample provider implementation is the CVS plugin built into Eclipse.

Conclusion

From initial code written by IBM, Eclipse has grown into a full-featured open source ecosystem with more than 100 participating companies. Portable, extensible, open source infrastructure - no longer new idea, but thanks to its well-thought-out, robust and elegant design, the Eclipse takes on a whole new dynamic.

Welcome to the Eclipse ecosystem. Our goal was to help you get up to speed on the Eclipse platform. We've achieved this through an introductory text and a simple practice exercise. Use the knowledge you gain from reading this article and become an active member of the Eclipse ecosystem.

Using Eclipse plugins for editing, compiling, debugging, and as a basis for your applications

This update to David Gallardo's article offers new information regarding Eclipse V3.3.

What is Eclipse?

Eclipse is a Java-based, open source, extensible development platform. In essence, it is simply a development environment and a set of services for building applications based on embedded components (plugins). Fortunately, Eclipse comes with a standard set of plugins, including the well-known Java Development Tools (JDT).

While most users who use Eclipse as a Java integrated development environment (IDE) are happy with it, there's much more to it than that. Eclipse also includes a plugin development environment (PDE), which will primarily be of interest to those who want to extend Eclipse itself, as it allows you to create your own tools that are built into the Eclipse environment. Because Eclipse is made entirely of plugins, all toolkit developers have the opportunity to offer their own extensions to Eclipse and provide users with a consistent and seamless integrated development environment (IDE).

This integrity and consistency is not unique to Java development tools. Although Eclipse is written in Java, it can be used with other languages. For example, plugins are already available (or are being developed) that support programming languages ​​such as C/C++ and COBOL. The Eclipse framework can also be used as a basis for other types of applications unrelated to software development, such as content management systems.

An excellent example of an Eclipse-based application is IBM® Rational® Software Architect (see ), which forms the basis of IBM's family of Java development tools.

Eclipse is open source

Open source software is released under a license designed to guarantee certain rights to users. The most obvious of them, of course, is that the source code must be provided to users, and they have every right to modify and distribute the software themselves. This protection of user rights is achieved through a mechanism called "copyleft": The software license is copyright protected and prohibits distribution of the software unless the user is granted such rights. A copyleft license also requires that all software distributed by users be covered by the original license without modification. Thus, the meaning of copyright is essentially turned upside down, and a copyleft license, which uses copyright to give rights to the user rather than to retain them for the software developer, is often jokingly said “all rights are perverted” (all rights reversed).

Much of the common fear, uncertainty, and doubt about open source software is based on the so-called viral nature of some copyleft licenses. The idea is that if you use open source software as part of a program you develop yourself, you will lose your intellectual property because the license will contaminate your private parts of the program. In other words, the license may require that all open source software, including any newly created software, be distributed under the same license. While this is true for the most famous copyleft license, the GNU General Public License (under which, for example, Linux® is distributed), there are other licenses that provide a different balance of commercial and public interests.

Open Software Initiative - OSI (Open Software Initiative) is a non-profit organization that clearly defines what constitutes open source and certifies licenses that meet its criteria. Eclipse is distributed under the EPL - Eclipse Public License V1.0, an OSI-approved license designed to facilitate commercial acceptance of Eclipse while maintaining credit to the original code authors.

Those who create plugins for Eclipse or use Eclipse as a base for software development are required to publish any Eclipse code they use or modify under the EPL, but are free to license their own add-ons as they like. Native code bundled with software from Eclipse does not need to be licensed as open source, and the source code itself does not need to be made publicly available.

While most programmers wouldn't use Eclipse to develop plugins or create new products based on it, the open source nature of Eclipse is significant not only because it makes Eclipse available completely free of charge (and despite its commercially oriented nature). the license implies that plugins may cost money). Open source promotes innovation and creates an incentive for developers (even commercial ones) to contribute their source code to the community. There are several reasons for this, but perhaps the most significant is that the more developers contribute to the project, the more meaningful it becomes for everyone. And when a project becomes useful, more developers will use it and create a community around it, similar to those that have formed around Apache and Linux. (To obtain Additional information about licenses, see section.)

What is Eclipse?

Eclipse is an open source community of developers whose projects aim to build an open development platform consisting of an extensible development environment, tooling, and runtime libraries for building, deploying, and managing software throughout its lifecycle. The Eclipse Foundation is a non-profit, member-supported organization that hosts Eclipse projects and helps improve the open source community and ecosystem of complementary products and services.

The Eclipse project was created in November 2001 by IBM and supported by a consortium of software vendors. The Eclipse Foundation was created in January 2004 as an independent, non-profit organization serving as a steward of the Eclipse community. It was created to help a vendor-neutral, open, and transparent community grow around Eclipse. Today's Eclipse community consists of individuals and organizations representing the software industry.

The Eclipse Foundation oversees and directs ongoing development of Eclipse. The foundation serves the community, but open source developers called committers and, as such, those working on Eclipse projects are not on his staff. Typically, Eclipse committers are members of some organization or are independent developers who volunteer their time to work on an open source project.

Now that we've looked at the theoretical, historical, and political aspects of Eclipse, let's look at the product itself.

Eclipse workspace

When you first launch Eclipse, you will see a Welcome page inside the workspace (see Figure 1). An Eclipse user has several options to navigate to the overview page, which is what I recommend doing (see Figure 2). Next, you can get acquainted with information on new functions, study some examples, or take a training course.

Figure 1. Eclipse Welcome Page
Figure 2. Eclipse overview page

The Eclipse workspace consists of several panels called representations, such as navigation or outline views. The set of such representations is called perspective. One of the most common perspectives is the Resource perspective, which is a basic set of views for managing projects and viewing and editing project files.

I recommend that most first-time users start with the overview page shown in Figure 2 and learn more about Eclipse. The workbench basics section contains a lot of useful initial information about the various components of Eclipse and how they interact with each other. Take a few minutes to read this, and then let's dive into Eclipse's Java Development Tools (JDT). The best way to learn something is to try it in practice.

Continuing this short tour of Eclipse, we'll create a new project in Java. Select File > New > Java Project and enter Hello when prompted for the project name, then click Finish.

Now let's look at the "Java" perspective (if you're not already in it). Depending on how you prefer to control your screen, you can either change the perspective in the current window by selecting Window > Open Perspective > Java (Window > Open Perspective > Java), or open a new window by selecting Window > New Window, and choose a new perspective.

As you might expect, the Java perspective has a set of views designed to guide Java development. One of them, located in the upper left corner, is a hierarchy containing various Java packages, classes, JAR archives and various files. This view is called Package Explorer. Please note that two new items have been added to the main menu: Source and Refactor.

Java Development Tools (JDT)

To try out the Java development environment, we will create and run an application called "Hello World". While in the Java perspective, right-click on the folder with the project's source test "Hello" (src) and select New > Class, as shown in Figure 3. In the dialog box that appears, enter Hello as the class name. Below is the inscription Which method stubs would you like to create? (What method stubs do you want to create?) note public static void main(String args) and click Finish.

Figure 3. Creating a new class in the Java perspective

This will create a .java file with a Hello class and an empty main() method in the editor area, as shown in Figure 4. Let's add the following code to the method (note that the description is for i was deliberately omitted).

Figure 4. Hello class in the Java editor

As you type, you'll notice some of the Eclipse editor's features, including syntax checking and automatic code completion. Additionally, when you enter an opening parenthesis or double quotes, Eclipse automatically inserts a closing pair for them and places the cursor in the middle.

In other cases, you can cause automatic code completion using the combination Ctrl+1. The code completion function provides a context-sensitive list of options from which you can select using the keyboard or mouse. The options can be a list of methods specific to a particular object, or a piece of code based on various keywords, such as for or while .

Syntax checking depends on incremental compilation. As you save your code, it is compiled in the background and checked for syntax errors. By default, syntax errors are underlined in red and a red dot with a white X appears in the left margin. Other errors are marked in the editor's margin with a light bulb symbol; these are problems that the editor could fix for you (a feature called Quick Fix).

In the code above, the light bulb sign appears next to the for statement because the description for i was omitted. Double-clicking on the light bulb will cause a list of suggested fixes to appear. In our case, we will be asked to create a class field i, a local variable i, or a parameter i for a method; selecting any of these options with the mouse will show the code that will be generated. Figure 5 shows the list of suggested options and the code suggested in the case of a local variable.

Figure 5: Quick Fix options

Double-clicking on a sentence inserts the code into the desired place in the program.

If the program compiles without errors, you can run it by selecting Run in the Eclipse menu. (Note that there is no separate step for compilation because compilation occurs as you save the code. If your code has no syntax errors, it is ready to run.) The Launch Configurations dialog appears with the desired defaults; click Run bottom right. A new panel with tabs (Console) appears in the bottom panel, displaying the result of the program, as shown below.

Figure 6. Result of the program

You can also run the program in the Java debugger. First you need to set a breakpoint in main() System.out.println() by double-clicking the gray box on the left side of the edit window next to the System.out.println() call. A blue dot will appear. On the menu Run select team Debug. As described earlier, the "Launch Configurations" dialog will appear. Select a team Run. The perspective will automatically change to the Debug perspective, which contains a number of interesting new views, as shown below.

Figure 7. Debug Perspective

Notice the Debug view in the top left corner of the perspective. This view shows the call stack and contains a toolbar in the title bar that allows you to control program execution. The panel has buttons to continue, pause or end the program, move to the next statement, step over the next statement, or return from a method. The panel at the top right contains a number of tabbed views, including Variables, Breakpoints, Expressions, and Display. The Variables tab is now selected, so we can see the current value of the i variable.

More detailed information about any of the views can be obtained using the context tooltip; To do this, click on the view title and press F1.

Additional plugins

In addition to JDT-type plugins for editing, compiling, and debugging applications, there are plugins that support the entire development process: modeling, build automation, unit testing, performance testing, versioning and configuration management.

Eclipse includes a plugin for working with the Concurrent Versions System (CVS) for source code management. The Team plugin connects to the CVS server, allowing members of a development team to work with a set of files containing source code without interfering with changes made by others. We won't explore source management from Eclipse in more detail here since that would require installing a CVS server, although the ability to support a team of developers rather than just self-development is an important and integral part of Eclipse.

Plugins that are maintained and distributed by the Eclipse Foundation can be found on the Eclipse Web site. The most comprehensive list of available plugins is available on the Eclipse Plug-in Central page, which serves as a plugin directory.

Eclipse Platform Architecture

The Eclipse platform contains a powerful set of plugins (see Figure 8) that support projects such as JDT and PDE.

Figure 8. Simplified architecture of the Eclipse platform

The dark blue blocks represent components that are central to the Rich Client Platform (RCP) in Eclipse. The concept of RCP itself is beyond the scope of this article, but let's consider RCP to be simply a set of plugins from Eclipse that people can use in developing applications such as Lotus Notes® 8. The light blue blocks represent optional (though recommended) components to include into RCP-based applications. And the gray blocks are completely optional. The platform consists of several components, we will look at some of them:

Runtime Runtime is the code that defines the Eclipse plugin model, based on the OSGi specification and the idea of ​​extensions and extension points. Runtime also provides additional services such as syslogging and concurrency. JFace/SWT The Standard Widget Toolkit (SWT) is a collection of widgets that provide the user interface and functionality of Eclipse. JFace is simply a superset of SWT that provides several Model-View-Controller (MVC) classes to make developing graphical applications easier. Workbench The workspace gives Eclipse its personality. It is at this level that the concept of views, perspectives, and things like editing windows is implemented. Help (User Support) This Eclipse component allows you to provide support to your users. This can be done through a help system, which allows users to search for help documentation, or through "cheat sheets", which can be presented as interactive task lists to end users. Update The update component provides a means for Eclipse to update applications from one version to another. Team The team component is an infrastructure that allows development companies to connect their own version control systems. A sample provider implementation is the CVS plugin built into Eclipse.

Conclusion

From initial code written by IBM, Eclipse has grown into a full-featured open source ecosystem with more than 100 participating companies. Portable, extensible, open source infrastructure is no longer a new idea, but with a well-thought-out, robust and elegant design, Eclipse takes on a whole new dynamic.

Welcome to the Eclipse ecosystem. Our goal was to help you get up to speed on the Eclipse platform. We've achieved this through an introductory text and a simple practice exercise. Use the knowledge you gain from reading this article and become an active member of the Eclipse ecosystem.

What does IBM's contribution to the open source community mean to you?

Marc Erickson and Angus McIntyre
Published 11/01/2001

The Eclipse platform is designed for building integrated development environments (IDEs). It can be used to create a variety of end-to-end computing solutions for a variety of runtime environments. When choosing an architecture, tool creators need:

  • Level playing field and full disclosure with no hidden APIs or interfaces from tool to tool. Eclipse offers an open source platform for this purpose. To ensure code quality, portability, and performance, published APIs are tested by a consortium of related industries.
  • Freedom to expand the platform to achieve new possibilities. Eclipse provides the ability to create derivative works, including platform redistribution. Using Eclipse allows tool developers to focus on their core tasks and new models for development technology.
  • Receive timely responses to requests for product changes and improvements, delivered in a controlled and organized manner. Developers can make various changes through www.eclipse.org. This is achieved through collaboration and all possible assistance from developers in the development of the platform.

Questions and answers

    What is Eclipse.org?

    Eclipse.org is an open community-based consortium of software development tool vendors. The community is interested in working together to improve development environments and product integration. The community shares a common interest in creating products that can easily interoperate across multiple environments through the use of plugin technology. By collaborating and sharing key integration technology, Eclipse-compatible tool vendors can focus on their own areas of expertise and the creation of new development technologies.

    What is the Eclipse platform?

    The core idea of ​​the Eclipse project is to create an "Apache for developer tools." This means creating an open source infrastructure that provides many of the basic services that software developers need. This should be a "toolkit for developing toolkits". More than just a collection of APIs, the Eclipse framework will consist of actual code written to do real work.

    The Eclipse platform provides the foundation for building and running integrated end-to-end software development tools. The platform consists of open source components used by tool providers to build solutions that are built into an integrated work area. The Eclipse platform integrates technology into a well-designed design and implementation environment.

    Why is IBM releasing Eclipse as open source?

    Open source is the only way provide an open platform for tool integration. In addition, there are other benefits to using open source.

    Chief among these benefits is the reuse of products. Why rebuild something if it already exists in a working format? Using the open Eclipse platform, tool creators can focus on their own development areas by providing a tooling infrastructure for building integrated development environments (IDEs). Regardless, using someone else's code starts to gain trust.

    Trust in any new architecture or platform takes a long time to gain. For example, it is difficult to gain the trust of developers in creating tools that contain proprietary interfaces that limit the use of the application in a particular operating system (for example, Windows). Additionally, it is difficult to gain the trust of tool creators when different levels of APIs are shipped with different levels of tools (for example, community APIs that are different from enterprise APIs).

    The Eclipse platform builds trust by providing the platform source code.

    Open source is provided for all APIs, with no internal, proprietary or hidden interfaces. Developers whose trust takes time to gain can see the code and draw appropriate conclusions. Trust the source and innovate!

    Bringing together open source developers can also help create better code. When collaborating on code, creators put extra effort into it. Such code becomes a reflection of their work, the product of individual and corporate reputation. Trust the sources and establish your position in the market!

    An open source project based on clean specifications can provide code that is easier to understand. An interface describes (in black box terms) the abstract behavior of a component. By examining the source code, developers can analyze the action of the code line by line. It's hard to trust someone else's interface. Trust the sources and explore the technology!

    It's easier to debug in open source. When a bug is found, viewing the source code will help speed up the identification of its cause. This could be your fault, or a platform and environment fault. Access to the source code eliminates the work of guessing the cause of the error. Discussing problems together on forums allows you to share notes with others who are familiar with similar problems. If the problem occurs in commonly used open source code, it is easier to fix or work around it. Rely on the sources to get the information you need.

    Working on complex technology alone is quite difficult. Multiple tool makers can take it upon themselves to explore together new technology. Trust the sources to reduce risk!

    Tool suppliers come and go. Enterprise developers want to be sure of long-term platform support. With the source code, corporations can get started in a short time and sustain the business for a long period: Trust the source code to grow your business!

    Flexibility is the main feature of Eclipse. WITH Eclipse platform a component that does not satisfy you can be modified according to your requirements. For example, if you are not satisfied with the editor, create your own or connect one of the popular editors created in the open source marketplace offered by the Eclipse platform. Looking to tie a new hosting platform into your existing end-to-end support? Trust the sources and create plugins!

    So, open source, open community and open platform set the level playing field that tool creators small and large need to support end-to-end development projects and explore new frontiers.

    Still not sure? Thanks to Frank Hecker for his excellent work in creating an open source store (see link in Resources).

    What platforms is Eclipse available on?

    Eclipse has been implemented and tested for Windows NT, Windows XP (Beta), Windows 2000, Windows 98, Windows ME, and Red Hat Linux Version 7.1. Eclipse technology was written in Java, making it easy to use on a wide range of different platforms.

    Will Eclipse be ported to other platforms?

    This is an issue to be resolved, but that is the beauty of the Eclipse platform. Tool creators can adopt Eclipse technology and explore the boundaries of new possibilities with the confidence of an industry-tested platform of open tools.

    What is the cost of the Eclipse platform?

    The Eclipse platform is available under the Common Public License. License details are listed at http://www.eclipse.org.

    What about the fact that tool developers don't really want to deal with the source code and can't get much benefit from it?

    Access to source code often allows problems to be quickly identified, eliminates double work, and speeds completion of new compatible technology.

    Will this end up splitting the product into incompatible versions?

    The Eclipse community has the right to define and approve "official" versions of the Eclipse platform. Community members can also make changes and additions for their own needs. However, the code bases vary, and creating a custom version outside of the Eclipse project becomes increasingly difficult. The costs of transferring improvements from the “official” version to it also increase. Thus, all members of the Eclipse community are interested in working together on the common core Eclipse technology and infrastructure.

    Will steps be taken to define the "official" version in shipped products (for example, as part of a brand like "Eclipse Inside")?

    This issue is being considered by the Eclipse Board of Directors.

    What is the consumer risk when using custom versions?

    Typically, the "official" version of the Eclipse platform, after testing and review, is posted on www.eclipse.org. This version is supported through Eclipse.org. Custom versions must be fully supported by the vendor, so the benefits gained from collaboration with community members are lost.

    Will tool creators be concerned about open source Eclipse technology "tainting" other code if they use it in their own projects?

    Eclipse is licensed under the Common Programming License, which prevents you from corrupting other code that calls Eclipse code using public APIs.

    What about annoying things that users might find in Eclipse source code, such as bugs?

    Open source development increases the chances of finding and fixing both minor and major bugs. They are discovered and fixed by the original developer or community members.

    Could disclosing source code reveal confidential plans and strategies to competitors?

    Yes, essentially we share strategies with our competitors. There is undoubtedly a more significant opinion. Developers are tired of integrating tools only into their applications. They're tired of spending time figuring out how to make tools work together in an end-to-end computing environment. With the Eclipse platform, everyone can benefit from a thorough understanding of how to integrate an IDE at a production level. We do this solely to make the end developer's job easier.

    Can users simply use the Eclipse source code and rely on community members for support without adequate return?

    Potentially yes, however, sooner or later the ability to interact will provide more value to the end user than using it on its own could provide. Independent isolated developers will gradually fade into oblivion.

    What if competitors try to “steal” an open source product for their own purposes?

    Such an attempt is possible, but the community is protected by the Common Public License. Official versions of the Eclipse platform will continue to be released in the future. The license is structured so that no supplier will be able to illegally benefit from the use of the product. By working together on the Eclipse project, we want to help achieve a meaningful level playing field for tool developers.

    Where can I find information about integrating tools into Eclipse technology?

    There are several technical descriptions on the website http://www.eclipse.org.

    How does the Eclipse platform work and what features does it offer?

    The Eclipse platform was built on the following principles:

    • Facilitate seamless integration of internal tools as well as between various types content and tool providers.
    • Support for creating a variety of tools.
    • Supports an unlimited number of tool vendors, including independent software vendors (ISVs).
    • Supports tools for working with any format (including HTML, Java, C, JSP, EJB, XML and GIF).
    • Supports application development environments with and without graphical user interface (GUI).
    • Runs on a wide range of operating systems, including Windows and Linux.
    • Leveraging the popularity of the Java language to write tools.
  • Will IBM release the Eclipse platform source code to the open community? When will this happen?

    Yes, the source code is available now under the Common Public License. Very soon, IBM will transition Eclipse to an interim board of directors that will oversee the Eclipse platform.

    Who is on the interim board of directors?

    The interim council will be announced later.

    I want to join the community. How to do it?

    Visit www.eclipse.org.

    How to become a council member?

    Collaborate, contribute, assist: offer code, ideas, products, bug fixes, exchange knowledge and experience.

    How is the Eclipse platform supported?

    Support is provided through the forum and e-mail on a voluntary basis, using resources recognized by the community. detailed information located at www.eclipse.org

    Is there 24/7 support?

    On what basis is the interim board of directors elected?

    With limited staff, the Eclipse team can only interact with the select few companies chosen to build the platform. Members of the interim board of directors are selected from companies that have contributed to the development of the platform, on a trial basis for now. There are three criteria for selection: board members must be using Eclipse in their company; they must also use Eclipse to create quotes; they should openly support Eclipse.org.

    Why did you delay releasing the Eclipse source code for so long?

    Once the company's plans for delivering the source code were carefully examined, the development team wanted to ensure that the first platform was thoroughly developed and thoroughly tested. We have tested several alternative construction concepts, some of which are already on the market. We subsequently shared these ideas with other tool providers and improved them. The Eclipse platform is now ready for its first release.

    When IBM releases a technology for free distribution, does that mean that IBM is no longer committed to that technology?

    IBM is committed to adopting the Eclipse platform and using it as the basis for IBM's entire family of end-to-end software development tools, which is the WebSphere Studio family. These products benefit from integrated quality assurance, legendary IBM product support, and our commitment to the IBM brand. They use similar interfaces and are built on technology common to the Eclipse platform.

    Where can I find documentation and information about Eclipse?

    At www.eclipse.org.

    How different is Eclipse from .NET?

    .NET technology was created exclusively for use on Microsoft platforms through its own interface imposed by Microsoft. Developers must respond to changes in .NET. In a world characterized as more than "wintel" technology, the .NET platform is a significant inconvenience. End-to-end computing projects that need to integrate servers, workstations, embedded devices, and handheld PCs run on a variety of other highly mature and advanced runtime environments. This leads to the use of many powerful processor architectures and operating platforms such as OS/390, Linux and QNX.

    The Eclipse platform is available under an open public license with all clearly documented APIs and extension points, so it allows tool developers to support any number of desktop environments, including Microsoft products.

    How does Eclipse compare to Sun Microsystems' Open Source initiative?

    The Eclipse project's vision is to create an "Apache for developer tools." This means creating an open source infrastructure that provides many of the basic services that software developers need. This should be a "toolkit for developing toolkits". More than just a collection of APIs, the Eclipse framework will consist of actual code written to do real work.

    As Erich Gamma states: "Everything in Eclipse is a plugin. The Java IDE has no special status, it is just another set of plugins that demonstrate the easily integrated extensibility of the platform. Making the Eclipse platform open source allows tool creators to do the same "and not only to create new plugins, but also to help improve existing ones. As a result, large enterprises and enterprise representatives have a level playing field for integrating tools."

    What are the differences between WebSphere Studio Workbench and the Eclipse platform?

    WebSphere Studio Workbench uses Eclipse as the foundation to provide product integrations that support software platform WebSphere. WebSphere Studio Workbench is an example of using Eclipse technology from the Eclipse platform.

    Eclipse is an open source tool integration platform available for use in any work environment.

    They differ in four main ways:

    1. Support

      Support for the Eclipse platform is provided through the Eclipse.org consortium, while support for WebSphere is provided through IBM's standard support structure (PartnerWorld).

      Licensing

      The Eclipse platform is available under the Common Public License, while WebSphere Studio Workbench is available under the IBM PartnerWorld License.

      By-products/Source code modifications

      The Eclipse platform allows tool developers to explore new frontiers, target new platforms, and OS by extending and modifying code derived from the Eclipse project. WebSphere Studio Workbench must be integrated and distributed as originally supplied by IBM.

      Branding

      Eclipse technology is not centrally branded. How component brand, it can be adopted by community members when releasing compatible products. WebSphere Studio Workbench includes its own individual branding, partner programs and support offerings.

  • When should you choose Eclipse and when should you choose WebSphere Studio Workbench?

    To help toolmakers choose which technology to use, they need to answer a few simple questions:

    Determine the supported working environment of the tool:

    • If it's WebSphere only, you should select WebSphere Studio Workbench.
    • Other environments or extensions for future technologies? You should choose the Eclipse platform.
    • Both environments. The choice should be made after assessing the extent of collaboration between IBM and IBM partner programs.
  • Will you maintain the entire offering, both Eclipse code and your own?

    • If not, then WebSphere Studio Workbench is more suitable for you.
  • Do you provide tools for platforms not supported by IBM?

    • If yes, then you should choose the Eclipse platform.
    • If not, then the choice should be made based on the two previous criteria.
  • Would you like to have official support and participation in available affiliate programs IBM.

    • If yes, then you should choose WebSphere Studio Workbench.
    • If not, then you should choose the Eclipse platform.

IT technologies do not stand still; they are developing every day. New programming languages ​​are being created that allow us to use all the capabilities that a computer gives us. One of the most flexible, powerful and interesting languages ​​is Java. To work with Java you need to have a software development environment. We'll look at Eclipse.

Eclipse is an extensible integrated development environment that is freely available. It is Eclipse that is the main contender and the question is: “Which is better?” still remains open. Eclipse is a powerful IDE that is used by many Java and Android developers to write various applications for any OS.

Attention!
Eclipse requires a lot of additional files, latest versions which you can download from the official Java website. Without them, Eclipse won't even start the installation.

Of course, Eclipse is designed for writing programs. After creating the project, you can enter the program code in the text editor. If errors occur, the compiler will issue a warning, highlight the line where the error was made, and explain its reason. But the compiler will not be able to detect logical errors, that is, condition errors (incorrect formulas, calculations).