Showing posts with label RCP. Show all posts
Showing posts with label RCP. Show all posts

2010-11-21

uDig version 1.2


A project that I've been watching closely and I expect it to become a major player in the GIS FOSS field.

uDig is a programming framework built on the Eclipse Rich Client Platform (RCP) and GeoTools, the Open Source Java GIS Toolkit.

Some time in August they released version 1.2 of uDig, a great release.

2008-11-13

Managing the Layout of the Workbench in Eclipse RCP

Setting the layout of the Workbench in any Eclipse RCP application can be a daunting task if your application needs any control over the placement of views and editor area that is not directly exposed through the RCP interface.

But some techniques can be used to provide (relatively) more control over the layout by managing the perspective settings and hinting the view size.

In the perspective

In the class implementing IPerspectiveFactory (the class that implements the Perspective to the org.eclipse.ui.perspective extension point), you can:

Enable or disable the Editor area, if you are to design an Editor, this setting should be kept to true

layout.setEditorAreaVisible(true);

You can also use the Fixed Layout option, this removes he ability o maximize and minimize views and the editor area (through the min/max buttons and through the double clicking on the view title.

This keeps the ability to resize single views (as if they are included in Resize composites, but without the ability to reorder the views, or stack them or minimize them as fast views)

layout.setFixed(true);

The order of the views to be added decides who gets the full layout to take part of it and what views get the remaining of the layout to take further parts of it

Views

Views can be standard views, stand-alone views or fast views:

A stand-alone view is a special kind of view that cannot stack other views with it, and can optionally enable/disable the title bar
layout.addStandaloneView(MyOwnView.ID, true, IPageLayout.TOP, 1f, editorArea);

Standard view is a simple view in the Workbench that can be docked, stacked, minimized, maximized or detached inside the Workbench window

layout.addView(SampleView.ID, IPageLayout.LEFT, 0.5f, editorArea);

Fast views are shortcuts to the actual views put in the toolbar at the bottom of the Workbench window and shares the status bar if visible

layout.addFastView(SampleView.ID, IPageLayout.DEFAULT_VIEW_RATIO);

Views and hinting its size (in Eclipse 3.4 and upwards)

By implementing the ISizeProvider Interface in the ViewPart class that is creating the view, you can get the view to set its minimum and maximum size, given that the view doesn't get docked into other views (which can be easily made by using stand-alone views), the simplest implementation would be:

@Override public int computePreferredSize(boolean width,
int availableParallel, int availablePerpendicular, int preferredResult) {
return width ? 100 : 110;
}
@Override public int getSizeFlags(boolean width) {
return (SWT.MIN | SWT.MAX);
}

2008-10-17

uDig 1.1.0 released

uDig 1.1.0 is released according to uDig and How 2 Map blogs, I find this application very interesting, as it holds a great potential in becoming the #1 GIS desktop application in the Open Source arena, because I think it is the most user friendly interface and bacause of its programability.

2008-09-04

The Eclipse RCP - 3 - Launching configuration

A Launch configuration in Eclipse defines the environment under which your application will be started, e.g. compiler flag, plug-in (classpath) dependencies etc.
Select your plugin.xml -> Run As -> Run Configurations
On the tab Arguments you should add the parameter -consoleLog. This will send error message of your Eclipse RCP application to your Eclipse development IDE.
On the Arguments tab, you will find also the -os -ws -arch -nl arguments associated with ${target} variables, they can be edited form Window -> Preferences -> Plug-in Development -> Target Platform
On the Plug-ins Tab select "Validate plug-ins prior to launching". This will check if you have all required plug-ins in your launch configuration.

The Eclipse RCP - 2 - Create your first RCP application

  1. Download the package "Eclipse for RCP/Plug-in Developers" from the webpage of eclipse (www.eclipse.org).
  2. Extract, and Run.
  3. In Eclipse select File -> New Project.
  4. From the list select Plug-In Project.
  5. Give your RCP plug-in a name, "MyFirstRCP", click Next
  6. Select "Yes" at the question "Would you like to create a rich client application", click Next
  7. Select "RCP application with a view", as a template, click Next
  8. Type the name of the Title Bar in the "Application window title" field, and Select "Add branding", click Finish
To Launch the application, double-click on the file "MANIFEST.MF". You should see an editor and the tab "Overview" should be selected. Click the link "Launch an Eclipse Application".

The Eclipse RCP - 1 - Rich Client Platform

For the full tutorial, see http://www.vogella.de/articles/RichClientPlatform/article.html

The Platform
The Eclipse RCP is a platform, where no functionality is implemented in it; its sole purpose is to manage the plug-ins, where everything in the program is done using the plug-ins.
The plug-ins implement everything, from the menu bar, to the status bar, to the main toolbar, to the views (or panels), to the Editors (which may not be editing anything, but they are the main focus of the program), to auxiliary functionality like software automatic update and help and the management of long-running background operations; these plug-ins are the heart-and-soul of any Eclipse RCP-based program.
The basis for this architecture is the runtime environment of Eclipse which is based on the OSGi Alliance. Eclipse used the OSGi reference implementation Equinox to run upon. The Plug-in concept of Eclipse is the same as the bundle concept of OSGi.

Minimum Requirements
As a minimum, a RCP application requires:
  • Main program or Application (org.eclipse.core.runtime.applications extension point)
  • Workbench Advisor (invoked from the Application handler, it sets the default Perspective, invokes WorkbenchWindowAdvisor which configures the default Main window state and subsequently invokes ActionBarAdvisor, which in turn provides one of the ways to configure the Action Bar or the main menu and Cool Bar or the main toolbar)
  • A Perspective (org.eclipse.ui.perspectives extension point)
  • A View (org.eclipse.ui.views extension point, views are technically not required for a RCP application, but they are the base interface element)
The RCP application depends on 2 main plug-ins:
  • org.eclipse.core.runtime
  • org.eclipse.ui

Plug-ins Architecture
The RCP architecture is based on the concept of extension-points, which a plug-in provides so that any other plug-ins can contribute functionality to it in the form of extensions, e.g. you can easily provide your menu items in the Action Bar (an extension point provided by the org.eclipse.ui plug-in) by implementing extensions that connect to the org.eclipse.ui.menus extension point and provide their own implementation. In general an extension point can be used several times (either by the same plug-in or by other plug-ins).
The plug-in architecture is based on 2 configuration files (or manifests) that describe the behavior of the plug-in, "MANIFEST.MF" and "plugin.xml", by double clicking on any of them, Eclipse provides a graphical editor of the files contents.
The plug-in manifest ties all the code and the resources together, the OSGi bundle manifest is stored in "MANIFEST.MF", while the Eclipse specific parts are stored in "plugin.xml".

2008-09-02

The Eclipse RCP Platform

I've started in my quest to learn the Eclipse RCP Platform, the Java Rich Client Platform built on the Eclipse foundation softwareand using the Standard Widget Toolkit (SWT).

While I think that Swing and the Swing Application Framework (JSR 296) would be a more pure Java approach, I personally prefer the Eclipse RCP approach for large scaled projects, where it can provide high degree of modularity to the system (this can be also achieved in the NetBeans Platform, but I prefer the look and feel of the Eclipse-based applications).

Also I think that the NetBeans IDE is better in the more broad Java picture, where I assume it is better in handling the Java EE and Java ME applications and provide a higher of community participation in its code base (this may not be correct, but I got this impression, maybe because I was a close watcher for the NetBeans news earlier than Eclipse).

But the Eclipse RCP won because of its large base of implemented applications, one for example was the main reason that I tried the Eclipse RCP in the first place, uDig, the internet-friendly desktop GIS application, and i don't know until now if I'm gonna to run inside it with my plug-ins, or that I will embed its plugins inside my application(s).

Also the Eclipse SWT library is more responsive and native-looking than Swing (personally I love the Java Metal look and feel, but thats just me, everybody else hates it).

So, in the next few days, I will start posting about my findings in the Eclipse RCP world and the Java world in general.