Eclipse 3.5 - New and Noteworthy

But surpassing all stupendous inventions, what sublimity of mind was his who dreamed of finding
means to communicate his deepest thoughts to any other person, though distant by mighty
intervals of place and time! ... and with what facility, by the different arrangements of twenty
little characters upon a page! Let this be the seal of all admirable inventions of mankind."
- Galileo Galilei, Dialogue Concerning the Two Chief World Systems, p. 105

Welcome to Galileo, this year's simultaneous Eclipse release, including content from thirty three Eclipse projects. Here are some of the more noteworthy things available in the ninth annual release of the Eclipse project SDK available for download from the Eclipse Project downloads page.

Platform and Equinox
Eclipse on Cocoa 32 and 64-bit OSX Cocoa have joined the line-up of supported configurations for which SWT and Eclipse are routinely built. Cocoa is now a first class Eclipse configuration, including advanced libraries such as OpenGL for SWT. Cocoa replaces Carbon as the primary toolkit for Eclipse and SWT on Mac.

Eclipse on Cocoa

Solaris x86 Solaris x86 has joined the line-up of supported configurations for which SWT and Eclipse are routinely built.

Solaris x86

Eclipse on s390 and s390x It's time to dust off that old mainframe in your basement, because Eclipse has arrived on the s390 and s390x architectures. This new port is still early access, so give it a spin and report any problems you encounter in bugzilla.
Alternate button order On GTK, it is now possible to change the default button order for Eclipse. To have the OK button on the left, edit the ~/.gtkrc-2.0 file and include the line "gtk-alternative-button-order=1".

Alternate button order

Customize menus and toolbars The customize perspective dialog has been improved and extended with new functionality. It can now be used to hide or show individual menu or toolbar items.

Customize Perspective dialog

Multi-instance Properties view You can now pin the Properties view to a given selection. This allows you to see the properties of a particular selection while having the freedom to select alternate items.

You can now create new instances of the Properties view from an existing one. The existing one will be pinned to the contents it is currently displaying and the new view will be set to follow the workbench's selection.

The Multi-instance Properties View

Compare Editor enhancements New features have been added to the Compare Editor:
  • The Go to Line action added to the context menu allows for rapid navigation
  • The current text selection will be used to populate the filter field of the Open Type and Open Resource dialogs
  • The current line is now highlighted in each viewer
  • Background and foreground color preferences are now honored
  • The Set Encoding... action has been added to the context menu. This allows you to change the encoding of each side of the comparison

Go to Line

TextSelection

Compare Word documents Comparing Word document changes in Eclipse now uses the Word compare support to show you the changes as revisions.

Compare Word documents

Switching compare viewers The Compare Editor allows you to switch to optional merge viewers available for the compared content. For instance, while comparing two Java files, you can use the simple Text Compare viewer instead of the default Java Source Compare.

You can also switch between content-specific merge viewers; for example when an alternative Java compare viewer is available, you can use it instead of the default one.

Viewer switching

Open Resource dialog allows choice of editor The Open Resource dialog now allows you to open files with the editor of your choice. You can either choose the editor from the Open With context menu or use the drop-down menu besides the Open button.

Open Resource dialog

Switch editors and multi-page editors Switching between open editors and multiple editor pages has been streamlined. Ctrl+PageDown and Ctrl+PageUp now always activate the next or previous editor tab, even in multi-page editors. To switch between pages of a multi-page editor, use Alt+PageDown and Alt+PageUp.

Multi-page editor (PDE manifest editor)

Improved Network Connections page The Network Connection page has been changed to better show the current proxy configuration. Now if you go to Preferences > General > Network Connections, you are able to see and change Eclipse proxy settings as well as see settings provided by the operating system. If you want to use your browser or Gnome settings, or you have your proxy configured using environmental variables on Linux, you can see them all in this new UI.

New Proxy Settings UI

Workspaces preference page A new preference page supports managing the startup prompt to select a workspace: General > Startup and Shutdown > Workspaces. You can enable or disable the prompt altogether (this setting used to be on General > Startup and Shutdown) and specify the maximum number of recent workspaces to be remembered. The page also lists the recently used workspaces and allows you to remove unwanted workspaces from that list.

The Workspaces preference page

Project Explorer improvements As a step in the campaign to bring the Project Explorer up to parity with the Package Explorer, the Go Into and Go To functionality has been added. You can now go into any folder/project/etc. and have that be the only contents of the Project Explorer.

Showing the Project Explorer after Go Into selected

Custom icons in help system Custom icons can be specified for books and topics in the help system using the <tocIcon> element in the org.eclipse.help.toc extension point.

table of contents

Buttons to change font size in Welcome To improve accessibility two new buttons (a large and a small 'A') have been added above the welcome area which can be used to increase or decrease the font size on the welcome pages.

welcome page

About page in help system It is now possible to open a web page, about.html from the help system that shows plug-in version information. This makes it possible to determine the versions of plug-ins running in a Help infocenter.
Help quick search A search of the help system can be initiated with a scope limited to the selected book or topic.

help quick search

Install/Update Changes
Software updates menu items New menu items have been added to the Help menu, allowing you to invoke the most common software management tasks immediately. Instead of launching a single updates dialog and navigating pages with action buttons, you can now perform common tasks immediately from the Help menu.

Software updates menu items in the Help menu

For example, you can now check for software updates in one step using Help > Check for Updates. This menu command will check for updates (in the foreground or background depending on your General > Always run in background preference), and launch the software updates wizard if updates are available.

Installing new software The Available Software page has been merged into the install wizard and can be accessed using Help > Install New Software.... The same navigation features previously appearing in the Available Software page, such as filtering and viewing by site, category, or name, are now on the first page of the wizard.

Available Software Page in the Install Wizard

Some of the most common workflow and usability complaints have also been addressed:

  • The wizard will now open immediately without waiting to connect to any update sites. This makes the view itself much more responsive once the wizard is opened.
  • A description field has been added to the page to show more information about the selected item.
  • You can now change many selections at once without computing the install results on each change. Once you've selected the items to install, the Next button will take you to the review page. If there is an error or you otherwise want to change your selections, you can now go back and change the selections in the first page, and the resulting changes won't be computed until you move forward again.
Installing software from a new site The install wizard has been reorganized to make it simpler to add a new site and install software from it. You can add a new site by typing, pasting, or dragging a URL link into the Work with combo box. You can also use the Add... button to add a site. Auto-completion on names and locations is supported when typing in the Work with field, including completion of repositories that are currently disabled.

Only the content for a newly added site will be shown, making it simpler to find what you want to install. You can also use the combo to change the filtering of the available software by any site. The wizard has also been streamlined by placing the links to other views closer to the relevant information in the wizard.

Available Software view in Install Wizard

A new checkbox at the bottom of the page lets you control whether all sites will be used when searching for the new software's requirements, or whether only the site selected will be consulted. Previously, all sites were always used when gathering the requirements.

More detail in install wizards The wizards for installing, updating, and uninstalling software now provide more detailed information about the software required to complete an operation. For example, when you install a feature, you will see a list of the other features required that will also be installed.

Install wizard with detail

The update wizard has also been reorganized so that you can change your update selections in a separate selection page. When available updates are shown, the wizard will open directly on the details page.

Update wizard detail

From this page, use the wizard < Back button to see all of the possible update proposals and change the selections.

Update wizard with multiple proposals

Installation information now appears in About The Installed Software and Installation History pages have been moved into the new Installation Details dialog. To access these pages, choose Help>About and press the Installation Details button. In addition, you can now expand the top level items in the Installed Software page to see what software each item requires. From the Installation History page you can browse previous install configurations, and Revert to previous configurations.

Installation History page in Installation Information dialog

Software sites preference page The available sites for installing and updating software are now managed from a preference page (Preferences > Install/Update > Available Software Sites). To find a particular site quickly, you can sort by name, location, or enablement. You can also use the filter field to filter the list of sites.

This preference page also allows you to define your own name for available software sites. Names can be defined when adding a new site, or edited from the available sites preference page. If you don't provide a name, the name defined by the site itself will be used.

Available Software Sites preference page

Editor Changes

These changes apply to all textual editors in the SDK.

Block selection mode in textual editors Textual editors now support block (aka column or rectangular) selection mode:

Block selection in text editor

To enable it either use Alt+Shift+A or activate the 'Editor Presentation' action set to get a tool bar button for toggling the block selection mode.

Double-click on folding line collapses the folding region Double-click on the vertical folding line now collapses the folding region:

Double-click collapses the folding region

Team/CVS Changes
History in Tag Resources dialog When tagging a project you can now choose a previously used tag.

The Tag Resources dialog with the history list

Apply patch in the Synchronize view You can now apply a patch directly in the Synchronize view.

Apply patch in the Synchronize view

More options for synchronization scheduling New options are available in the Configure Synchronize Schedule dialog. Synchronization can be started at a specified time, run once or repeated at selected intervals.

Synchronize schedule dialog

Debug Changes
Debug view breadcrumb Debug view now offers a breadcrumb which shows the current active debug context. The breadcrumb is activated automatically when the Debug view is resized to show only one line of text.

Debug view Breadcrumb

Each element in the breadcrumb can be selected and actions can be invoked through a context menu or keyboard short cuts.

Debug Breadcrumb Popup Menu

Finally, a drop-down menu allows navigating to a new element and changing the active debug context.

Debug view Breadcrumb Drop-Down

Java development tools
Java Editor
Constructor completion Content Assist can now propose the available constructors of a class when the completion happens in an allocation expression:

Constructor completion

If the class is not already imported (as shown in the example above), then the corresponding import will also be added.

Open Implementation hyperlink An Open Implementation hyperlink has been added for overridable methods, which directly opens the implementation in case there's only one, or shows all the concrete implementations for that method in the hierarchy of its declaring type, using the quick type hierarchy. By default, the hyperlink appears when you hold down the Ctrl key while hovering over an overridable method.

Open Implementation hyperlink for methods

You can configure the modifier for this hyperlink on the General > Editors > Text Editors > Hyperlinking preference page.

Select comment with double click Double clicking on the beginning or end marker of a comment now selects the whole comment.
Quick Fix to start Rename refactoring The Rename refactoring can now also be started via Quick Fix (Ctrl+1):

Quick Fix 'Rename in workspace' in Java editor

Open in Properties File action in NLS Hover The NLS string hover now has an Open in Properties File action in the toolbar which locates the selected NLS string in the corresponding properties file where it is defined. The action is activated in the toolbar with focus on the hover.

Open in Properties File action in NLS hover

Formatter option to preserve user line breaks The Java code formatter can now optionally preserve user line breaks by not joining lines in code or comments.

For example, the wrapped lines of the return statement in following test case:

Example of Code to Format

will be preserved by the formatter when the Never join lines preference is used and now produces the following result:

Coded Formatted with Never Join Lines

This preference can be configured on the Java > Code Style > Formatter preference page. See the Never join lines option on the Line Wrapping and Comments tab.

Java Compare Editor
General editing enhancements The Java Compare editor now supports new text editing features like move/copy/delete line and formatting.
Hyperlinking (Ctrl+Click) Hyperlinking
Content Assist (Ctrl+Space) Content Assist
Javadoc on hover Javadoc hovers
Quick Outline (Ctrl+O) Quick outline
Reconcile Java compare structure while typing The Java compare editor now updates its structure while you are typing inside the editor.

Dynamic structure comparison

Java Refactoring and Source Actions
Generate toString() The new toString() generator allows you to quickly generate a toString() method for your class. Source > Generate toString()... offers several options to configure the format of the resulting String and the style of the generated code in the toString() method body.

Generate toString() dialog

Optionally use blocks when generating hashCode() and equals() The Generate hashCode() and equals() wizard now allows you to choose whether blocks are used for if statements:

Generate hashCode() and equals() wizard

Java Compiler
Comparing identical values Comparing identical values is now detected by the compiler and reported as a warning by default:

Comparing Identical Values Warning Example

You can configure this setting in the Potential programming problems section on the Java > Compiler > Errors/Warnings preference page, or by clicking the Configure Problem Severity button in the problem hover toolbar.

Missing synchronized modifier The compiler now issues a warning when a method overrides a synchronized method but the method itself is not synchronized.

Problem hover with quick fix for missing synchronized modifier

You can use the quick fix to add the synchronized modifier, and you can configure the problem severity on Preferences > Java > Compiler > Errors/Warnings in the Potential programming problems section.
Suppress compiler problem for 'switch' case fall-through The compiler problem for expected fall-throughs in switch case statements can now be suppressed by preceding the following case statement with a comment that starts with $FALL-THROUGH$. This is especially interesting for code that can't use the J2SE-5.0-style @SuppressWarnings("fallthrough") annotation.

Problem hover with quick fixes for switch case fall-through

This problem is not reported by default. You can enable the 'switch' case fall-through warning on Preferences > Java > Compiler > Errors/Warnings in the Potential programming problems section.
Missing hashCode() method The compiler can now detect whether a class overrides the equals() method without overriding the hashCode() method:

Problem hover with quick fix for missing hashCode method

You can either use the quick fix to override the hashCode() method or the quick fix to regenerate both methods.

This problem is not reported by default. You can enable it on Preferences > Java > Compiler > Errors/Warnings in the Potential programming problems section.

Dead code The compiler can now issue a warning if dead code is detected.

For instance, if (false) foo(); is not reported as truly unreachable code by the Java Language Specification. When this diagnostic is enabled, the invocation of foo() is signaled as dead code:

Problem hover with quick fix for dead code

This problem is reported as a warning by default. You can configure the problem severity on Preferences > Java > Compiler > Errors/Warnings in the Potential programming problems section

Note that dead code following an if (constant variable) statement, e.g. if (DEBUG), is not reported.

Classpath resolution honors the 'Class-Path' header of JAR manifest file The 'Class-Path' header of a JAR manifest is now honored in the Java model. JARs defined by 'Class-Path' are now automatically added to the build path.

For example, 'nested.jar' is a referenced library although it was not explicitly specified in the project build path but through the manifest of 'lib.jar':

Class-Path Clause Example

Build path supports ".." The path of a library, variable or container entry can now be anywhere relative to the project, e.g. if the library is on a sibling directory, its path can be specified using the ".." as follows:

Parent Relative Path Example

Build path resolution tolerates duplicate entries Duplicate entries in the build path are now tolerated if the redundant entry is found while resolving the build path and not at the raw level.

For example, two user libraries used in the project build path referring to the same JAR file are tolerated:

Classpath Duplicate Entries Example

However, an error is reported if the same JAR file is directly specified twice:

Classpath Invalid Duplicate Entries Example

Compiler compliance follows execution environment When you change the JRE on the build path of a Java project to an execution environment, Eclipse now automatically updates the compiler compliance settings on the Java Compiler properties page to use the settings defined by the execution environment.

Java Compiler properties page

Note that as of 3.5, an execution environment is the first choice when creating a new Java project or a launch configuration.

Java Views and Dialogs
Emphasized matching characters in Open Type dialog The Open Type dialog now emphasizes the characters that match the pattern:

Emphasized matching characters in Open Type dialog

Sort working sets in Package Explorer The Configure Working Sets... dialog now has a Sort working sets option to sort working sets alphabetically. The setting is preserved, so the working sets stay sorted, even as new working sets are added.

Sort working sets in Package Explorer

You can enable working sets in the Package Explorer via the Top Level Elements > Working Sets view menu.
Delete working sets from the Package Explorer The Delete functionality is now enabled for working sets when the top level elements are Working Sets in the Package Explorer. When deleting working sets, you can now either remove or just hide them from the Package Explorer:

Delete working sets from a Package Explorer

Paste patch into Package Explorer What's the quickest way to apply a patch from Bugzilla? Just open the attachment, copy the patch to the clipboard and paste it into the Package Explorer.
Call Hierarchy can expand with constructors In Callers mode, the Call Hierarchy now has an Expand With Constructors action in the context menu for instance methods.

This action replaces the normal children of the method with

  • the constructors of the method's declaring class
  • a node that contains the direct callers of the method.
This is useful for methods in anonymous classes, for example to follow the callers that create a Runnable, instead of those which actually call its run() method.

Expand With Constructors

Some methods (e.g. java.lang.Runnable#run()) are expanded with constructors by default. The defaults can be configured in the view menu.

Improved Javadoc view and hover The Javadoc view and hovers now support the {@inheritDoc} tag and add links to overridden methods (like the Javadoc tool):

Improved Javadoc hover

Moreover, the message for deprecated elements now shows up on top, and relative links are supported (for example, to embed images from the "doc-files" directory or to link to {@docRoot}).

Open *.jardesc files with JAR Export Wizard Opening *.jardesc files now launches the JAR Export Wizard by default.

Open With > JAR Export Wizard

The Open JAR Packager... action in the context menu is gone.

Open test result files in JUnit view JUnit test result files from Eclipse or the Ant JUnit tasks can now be opened in the JUnit view via double click or via Open With > JUnit View.

Open With > JUnit View

If the files are not inside your workspace, you can still open them from the JUnit view via the Test Run History... drop-down menu. And the Import... and Export... actions now always start at the most recently used location.

Test Run History... > Import

JUnit 4.5 The JUnit4 version shipped with Eclipse has been updated to 4.5. See their Release Notes for the changes in version 4.5.
Runnable Jar-in-Jar exporter can package libraries The Runnable JAR File Export wizard can now also package the required libraries into the exported runnable JAR file or into a folder next to the JAR:

Runnable JAR File Export wizard

The advantage of the second and third options is that the required libraries will just be copied and don't need be repackaged.

Platform and Equinox API
Declarative services added to the platform The Eclipse rich client platform now includes an implementation of OSGi declarative services (DS). This allows a lazy-starting plug-in to make OSGi services available to other plug-ins before it has been started. Finally the powerful OSGi dynamic service architecture can be fully exploited in the Eclipse world of lazy activation. DS also includes support for dependency injection, so services can be injected into plain old Java objects (POJOs), without adding a dependency on the OSGi framework into your application code. This new platform bundle is complemented by new tooling support in PDE for declarative services.
Compare Core Plug-in Some of the patching functionality provided by the compare plug-in has been refactored into a separate org.eclipse.compare.core plug-in that can be used by headless Eclipse applications
Improved look for filtered tree The button for clearing the filter field of filtered trees has been moved into the text box, even for platforms that don't have a native search field with this functionality.

For backwards compatibility reasons, existing subclasses of FilteredTree will not get the new look automatically. Clients of the FilteredTree are encouraged to switch to the new look as recommended in the porting guide.

New look of filter field

Multiple fonts in one cell The existing owner draw support for JFace TableViewer and TreeViewer has been extended to allow multiple fonts within cells. For example, this can be used to highlight matching text in search results using a bold font.

Table with normal and bold font within the same cells

Using sheets on Mac Cocoa For general prompts and dialogs regarding editors, or the current Workbench window, sheets are now used on Mac Cocoa. In addition to the new style bit SWT.SHEET, new API has been added to MessageDialog and MessageDialogWithToggle so that clients can set the appropriate style for their dialogs.

Prompting to save using a sheet

JFace dialog button order on GTK+ JFace dialogs now respect the default button order on the GTK+ platform. Example: "Cancel" "OK". It is possible to revert the order used by SWT and JFace, see Alternate button order.

Preference Dialog showing Cancel, OK

New "check state" provider JFace now has a new type of provider, called ICheckStateProvider, that can be used to manage the checked and gray states of elements in CheckboxTableViewer or CheckboxTreeViewer objects. This is useful in situations where the viewer should come up with pre-checked elements, or when the check state changes are not always triggered by the user.
Show welcome checkbox A checkbox can be added to a welcome page that will cause the welcome to show when Eclipse is restarted, even if it was closed previously. The unextended Eclipse platform does not show this checkbox, but it can be added using an intro extension that uses the class AlwaysWelcomeCheckbox as a content provider.

The example below shows this checkbox added to the What's New page.

Show Welcome checkbox

Help content filter A new extension point org.eclipse.help.webapp.contentFilter allows for pre-processing of help content before it is delivered from the help server.
Jetty version 6.1 Version 6.1 of the Jetty Web server is now included in the platform, replacing the 5.1 version in the previous release. This brings along an implementation of version 2.5 of the javax.servlet API, replacing the 2.4 version in the Ganymede release.
New release of ICU4J The platform has adopted a major new release of the ICU4J localization library: version 4.0. This release includes support for Unicode 5.1, and the Unicode standard Common Locale Data Repository (CLDR) 1.6 See the ICU4J 4.0 release notes for more details.
Extensible installation details The About Dialog now provides a mechanism for plug-ins to contribute installation pages to the platform about dialog. The buttons for showing feature, plug-in, and configuration details have been replaced by a single Installation Details button.

About Dialog with Installation Details button

Pushing this button will launch a dialog that shows all of the installation pages contributed by plug-ins in a single Installation Details dialog. Plug-ins may contribute installation pages and define buttons that operate on the information in the installation page.

Installation Details dialog showing contributions from multiple plug-ins

The new extension point is org.eclipse.platform.ui.installationPages. Example implementations can be found by browsing the hierarchy of org.eclipse.ui.about.InstallationPage.

New intro theme A new intro theme called "Slate" has been added. Slate is not the default theme for Eclipse but can be specified using the preference org.eclipse.ui.intro/INTRO_THEME=org.eclipse.ui.intro.universal.slate. The main differences in the root page between the new theme and the two existing themes are:
  • Each link has a label.
  • The images are transparent and will display well if a background is added using an extension.
  • The page displays well at high screen resolutions.

Slate intro theme

Non root pages also have a label for each link.

Slate overview page.

Equinox Changes
New publisher bundle p2 has introduced a new bundle called the publisher, which provides infrastructure for generating, packaging, and publishing metadata and artifacts into p2 repositories. The publisher provides an extensible API that clients can extend to perform customized publishing to repositories, and includes an advice mechanism for injecting additional metadata into the generation and packaging process.
New Equinox concurrency API This release includes a new provisional API for futures. Futures facilitate handling of concurrency and synchronization in multi-threaded and/or distributed systems. They serve as a proxy for a result that is not known, because the computation of the result is not yet complete. See the wiki documentation for more details on this new experimental concurrency API.
Enhanced DebugOptions The Equinox DebugOptions API has been enhanced to support dynamic changes to option settings. Now debug option settings can be modified while an application is running to facilitate problem determination and support. A new interface, DebugOptionsListener, can be registered as a service to enable your plug-in to respond to dynamic debug option changes.
New tracing API A new debug tracing API, org.eclipse.osgi.service.debug.DebugTrace, has been added to enhance and simply writing of debug trace messages in your code. The DebugTrace object will take care of writing additional trace information along with your message, such as your bundle symbolic name, and the class, method, and line in which the tracing message was written. This reduces clutter in the code being traced, while ensuring that consistent and complete contextual information is recorded. The tracing data can either be directed to a file, or written on stdout, depending on the setting of DebugOptions#setFile. By default the Eclipse platform will write trace data to the file trace.log in the workspace metadata location (next to the platform log file).
Security Manager enhancements This release includes an implementation of the updated Conditional Permission Admin Specification included in the OSGi Service Platform Core Specification Release 4, Version 4.2. This version of the specification includes enhancements to the Conditional Permission Admin service which is used to manage the permissions assigned to bundles. The enhancements include adding the ability to grant or deny permissions based on conditions, and to manage conditions as an ordered list of rules. For more information see the OSGi Release 4 Version 4.2 specification.
OSGi service registry enhancements This release includes an implementation of the new Service Hooks Specification included in the OSGi Service Platform Core Specification Release 4, Version 4.2. Certain specialized bundles need to be able to alter output results of service layer's find and event delivery operations to affect their purpose. The Service Hooks Specification enhances the service registry to allow service registry hooks to affect the service registry's find and event delivery operations.

The Service Hooks Specification is targeted at bundles which need to observe and react to selected service layer operations. In general these will be highly specialized bundles written by systems programmers. The is not intended to be used by so-called "normal" application bundles. For more information see the OSGi Release 4 Version 4.2 specification.

OSGi framework launching The OSGi Service Platform Core Specification Release 4, Version 4.2 defines a standard way to launch an OSGi framework implementation. This release of Equinox includes an implementation the OSGi standard launching APIs. A framework implementation must provide a factory class. A factory class is an indirection to create a framework implementation object. The implementation factory class must implement the FrameworkFactory interface. A launcher can use the following ways to get this class name:
  • The Java-SE Service Provider Configuration model.
  • Get it from some configuration and use Class.forName.
  • Hardcode the factory name.
To create a framework instance a launcher uses the FrameworkFactory to constructs the implementation's Framework object. The Framework can then be used to control the lifecycle of the framework (e.g. start, stop, update etc.) The org.eclipse.osgi.launch.EquinoxFactory class is the public class in Equinox which implements the new org.osgi.framework.launch.FrameworkFactory interface.

This Release 4, Version 4.2 specification also defines standard configuration properties which all framework implementations must recognize. This allows for a generic framework launcher to be implemented that can launch any framework implementation. For more information see the OSGi Release 4 Version 4.2 specification.

OSGi Declarative Services Changes This release includes an implementation of the updated Declarative Services Specification included in the OSGi Service Platform Core Specification Release 4, Version 4.2. The following list highlights the changes to Declarative Services for Version 4.2 of the OSGi Specification:
  • The definition of the Service-Component header now uses the definition of a header from the module layer. It also allows wild-cards to be used in the last component of the path of a header entry.
  • The DS runtime now follows the recommendations of Property Propagation and does not propagate properties whose names start with '.' to service properties.
  • The component description now allows for a configuration policy to control whether component configurations are activated when configuration objects are present or not.
  • The component description now allows the names of the activate and deactivate methods to be specified. The signatures of the activate and deactivate methods are also modified.
  • Additional signatures of the bind and unbind methods have been added.
  • The definition of accessible methods for activate, deactivate, bind and unbind methods is expanded to include any method accessible from the component implementation class. This allows private and package private method declared in the component implementation class to be used.
  • The XML schema and name space have been updated to v1.1.0. It now allows for wild-carded attributes and elements for extensibility. The name attribute of the component element is now optional and the default value of this attribute is the value of the class attribute of the nested implementation element. The name attribute of the reference element is now optional and the default value of this attribute is the value of the interface attribute of the reference element. The Char type for the property element has been renamed Character to match the Java type name. The attributes configuration-policy, activate and deactivate have been added to the component element.
  • When logging error messages, SCR now uses a LogService obtained using the component's bundle context so that the resulting log entry is associated with the component's bundle.
  • Target properties are now component properties that can be set wherever component properties can be set, including configurations.

For more information see the OSGi Release 4 Version 4.2 specification.

New core framework API The OSGi Service Platform Core Specification Release 4, Version 4.2 is adding a number of small API additions to the core Framework. The following is a list of API additions included in this release.
org.osgi.framework.Bundle#getVersion()
Returns the Version of a bundle.
org.osgi.framework.Bundle#getSignerCertificates()
Returns the signers of a bundle.
org.osgi.framework.BundleException#getType()
Returns the error type for a BundleException. For example, a resolver error.
org.osgi.framework.BundleReference
Interface which must be implemented by bundle classloaders. This gives clients the ability to determine what bundle a ClassLoader is for.
org.osgi.framework.Constants
A number of new constants have been added to define standard launching configuration properties.
org.osgi.framework.FrameworkEvent
A number of new FrameworkEvent types have been added give launchers standard notification when a framework is stopped or restarted.
org.osgi.framework.FrameworkUtil#getBundle(Class)
Utility to get a Bundle object for a given class. A static method equivalent to the PackageAdmin#getBundle(Class) method.
org.osgi.framework.FrameworkUtil#matchDistinguishedNameChain(String, List)
Utility to match a certificate chain against a pattern. This is used for permission and condition checks against signed bundles.
org.osgi.framework.ServiceEvent
A new ServiceEvent type has been added to indicate the properties of a registered service have been modified and the new properties no longer match a listener's filter.
org.osgi.framework.ServiceException
A new ServiceException type has been added to indicate that a service problem occurred.
org.osgi.util.tracker.BundleTracker
The BundleTracker class simplifies tracking bundles much like the ServiceTracker simplifies tracking services.
Composite bundles This release includes an implementation of the Composite Bundles specification. The Composite Bundles specification is a proposed specification for the OSGi Release 4, Version 4.2 specification. In a large system built upon a large number of modules, sometimes it is necessary to provide a mechanism for isolating the various modules from each other at runtime. Composite Bundles introduces a concept to provide isolation for a group of bundles.

Conceptually a composite bundle is composed of a set of bundles which are contained in another (nested) framework instance. New API is introduced in the org.osgi.service.framework package to manage composite bundles. The CompositeBundleFactory service interface is used to install composite bundles. The CompositeBundle interface is used to manage the bundles which compose a composite bundle.

For more information see the OSGi Release 4 Version 4.2 specification.

Note: The API introduced in the org.osgi.service.framework package is a proposed OSGi API. This API is considered provisional in Equinox and may change drastically or be dropped altogether in a future release of Equinox. We encourage use of the API and any feedback on the specification, but consumers must be aware that breaking changes may occur in a future release.

SWT Changes
Cairo on AIX Cairo support has been added to Eclipse on AIX. This enables advanced graphics support on AIX.

Cairo on AIX

JNI Generator A new plug-in based tool has been added to simplify the process of generating the SWT JNI code. For more info click here.

Cairo on AIX

Block selection in StyledText StyledText can be switched into block selection mode with new API StyledText.setBlockSelection(true).

Block Selection in StyledText

JavaScript-to-Java JavaScript can now call out to Java in the Browser widget. Supported types are numbers, booleans, strings, null, and arrays (example snippet).
Improved Java-to-JavaScript Java can now call into JavaScript. An expression is evaluated in the context of a Browser document and a value is returned. Supported types are numbers, booleans, strings, null's, and arrays (example snippet).
New caret listener New API has been added to StyledText to allow you to listen for changes in the caret offset. See StyledText.addCaretListener() and StyledText.removeCaretListener() for more information.
New text editor demo This new example makes extensive use of StyledText to demonstrate how it can be used to create a multi-font rich text editor with bullets, links and embedded objects.

Text Editor

Improved search field The SWT.SEARCH style is now supported on all platforms, allowing the application to display a text message when the control is awaiting input. The SWT.ICON_SEARCH and SWT.ICON_CANCEL hints control the appearance of the search field (example snippet).

Text with SWT.SEARCH

Improved copy and paste support Support has been added to the FileTransfer class to allow for copy/paste operations between the Explorer and the Nautilus file manager.

Nautilus copy

StyledText margin spacing and color New API has been added to StyledText to set margin spacing and color. See Snippet316.

StyledText with margins

Disabling Javascript Javascript can be disabled from running in a Browser with the new API Browser.setJavascriptEnabled(boolean).
Browser wants a cookie Cookies can be created and accessed in the Browser with new API Browser.setCookie() and Browser.getCookie().
Authentication listener Browser clients can now provide a listener that responds to basic authentication challenges. This is useful for enabling users to access sites without presenting them with a manual authentication prompter. See Snippet317.
Shell modified state hint New API has been added to Shell to provide a user hint that the window is in a modified state. See Snippet314.

Shell.setModified

DateTime DROP_DOWN DateTime widgets created with SWT.DATE style can now also have SWT.DROP_DOWN style.

DateTime with DROP_DOWN style

SWT.SHEET style for Shell and Dialog Sheet windows are now supported on Mac OS X Cocoa.

Shell with SWT.SHEET style

Mozilla browser support on Solaris x86 Mozilla browser support has been added to the Solaris x86 platform.

Solaris x86 Browser

Improved DND feedback on Cocoa Cocoa drag and drop in trees and tables is now fully supported. Aside from the visual feedback, other native features are supported, such as automatic collapse of tree items when the drag is finished.

Cocoa drag and drop feedback

Paper orientation Applications can now programmatically select portrait or landscape mode when printing, or when opening a PrintDialog. See Snippet318.

PrintDialog seeded with Landscape orientation

Plug-in Development Environment
Views and Editors
Declarative services editor PDE has added declarative services tooling to help author service component definitions.

Declarative Services Editor

DS Tooling enhancements

The OSGi Declarative Services (DS) tooling has been enhanced to support the latest version of the DS specification. Specifically, a new modified attribute has been added to the component element.

A new template based on a simple dictionary service has been added to showcase Declarative Services tooling.

DS Template

Jump to Console from stack trace The error log view has been enhanced to allow posting stack trace dumps to the Console view from log messages.

Jump to Console

Versioning options To help developers follow versioning best practices, PDE has expanded its compiler options to include version constraint checks on imported packages, exported packages and required bundle statements.

Preferences > Plug-in Development > Compilers

Properties editor for .options

The standard properties file editor is now used for .options files in the workspace.

Property file editor

Product editor enhancements The product editor has been enhanced to support bundle start levels and product license information.
Product definition enhancements

You can now initialize product definitions from OSGi launch configurations.

NL fragment generation

A new wizard (PDE Tools -& Internationalize...) supports the generation of NL fragments for plug-ins in the workspace. A project is generated for each selected plug-in containing skeleton properties files for each selected locale. The generated properties files contain the keys from each of the associated plug-in's properties files.

Wizard to generate NL fragments

Plug-in Spy and menus

View information about menus by invoking Plug-in Spy in menu introspection mode (Alt+Shift+F2) and selecting a menu item.

Menu Spy

Plug-in Registry view enhancements The Plug-in Registry view now supports browsing for OSGi services.

Browse for OSGi services using the registry view

Start levels Eclipse Application launch configurations now support start levels and auto-start settings. You can specify default start levels and auto-start settings for all plug-ins in the configuration, and provide specific settings for others by selecting the plug-in in the list.

Use the Plug-ins tab to specify start levels

JUnit plug-in tests in non-UI thread You can now launch JUnit Plug-in tests in a non-UI thread. A check box has been added to the Test tab to specify whether tests should run in the UI thread.

Check box for non-UI thread

Fragments in the Plug-in Registry view

The Plug-in Registry view now includes fragments. Simply expand a plug-in, and expand the Fragments element in the tree to see all available fragments of that plug-in.

Fragments

Export
Install into running platform

It's simple to run and test your latest code by exporting and install plug-ins and features directly into the running workbench. Choose Install into host when exporting and specify a path in the local file system where exported artifacts can be stored (repository). You will be prompted to restart your workspace after export and install is complete.

Export Wizard

Patched plug-ins will appear in the installed software list and can also be uninstalled.

Installation Details Dialog

Source bundles, binary cycles, and workspace class files

Export options have been enhanced:

  • Generate source bundles. Select the Export source option and choose Generate source bundles from the drop down menu. A source bundle will be exported for each plug-in being exported.
  • Export features, plug-ins, and products with binary cycles. Binary cycles are cycles that exist in your target platform, not your workspace. This option is on by default.
  • Export existing class files from the workspace. When this option is checked, PDE will re-use existing class files in the workspace rather than compiling class files from source during export.

Export Wizard Options Tab

Publish feature categories

The new Category Definition editor can be used to assign categories to features when exporting. The category names and descriptions will then appear in software selection dialogs. First, create a category definition file via File > New > Other... and select Plug-in Development > Category Definition. Define categories with symbolic identifiers, names, and descriptions, and then add features to each category.

Category Definition editor

When exporting your feature, specify the category file to apply when exporting via the Options tab.

Specify category file on export

The categories can then be seen when browsing the repository from the Install Software dialog.

Install new software dialog displays exported categories

Keypass support

The JAR signing support in PDE has been expanded to include support for keypasses.

Keypass support

API Tooling
Compatibility options

API compatibility options have been reorganized and descriptions have been improved. The number of options has been reduced by combining related problems. For example, problems related to type parameters are now in their own group rather than being listed separately in the settings for classes, interfaces, and methods.

As well, you can be alerted to breaking API changes even if you have incremented the major version of your plug-in. The first time you change a plug-in's API in an incompatible way, problems inform you to increment the major version of your plug-in. Once you increment the major version of your plug-in, API tooling allows additional breaking API changes without warning. Use the new preference Report API breakage even if authorized by major version increment to enable this feature (on the Plug-in Development > API Errors/Warnings preference page, on the API Compatibility tab). When this preference is enabled you must use API problem filters to selectively permit incompatible API changes.

Preferences > Plug-in Development > API Errors/Warnings

@noextend restriction supported on interfaces

API tooling now supports two restrictions on interfaces: @noimplement and @noextend. This allows an interface to be extended when it is not intended to be implemented directly. For example, a client may be permitted to subclass an existing implementation of a @noimplement interface and extend the base interface with extra function.

Component owners should decide where to add @noextend tags on existing interfaces, as this was previously implicit. To maintain the API contracts specified in 3.4, @noextend tags can be added to all interfaces specified as @noimplement. In some cases the @noextend restriction can be omitted, as clients that extend and implement a @noimplement interface will still be flagged with errors. However, if you would like to reserve the right to add constants to an API interface in the future, you must add the @noextend tag. This is because adding a field to an interface is binary incompatible if clients can extend or implement an interface (see Evolving API Interfaces).

System library validation API tools can now analyze use of system libraries and create problems when code accesses members that may not be present at runtime. For example, when a plug-in specifies a required execution environment of J2SE 1.3, but the only JRE installed in the workspace for building is J2SE 1.5, it is possible to access methods that exist in J2SE 1.5, but not in J2SE 1.3. In order for the validation to work, you must install relevant execution environment descriptions from an update site.

API Errors/Warnings preference page

The API Use tab of the API Errors/Warnings preference page displays installed execution environments. Use the "install them now" hyperlink to install additional environments via the software updates dialog.

Illegal access warning

Stale problem filters

API tooling creates warnings for problem filters that are no longer needed. API problem filters often become stale because they are used to filter known incompatibilities between two specific releases. A quick fix is available to remove stale filters.

Quick fix to remove stale filters

Ant tasks

Ant tasks to perform API analysis and generate simple HTML reports are now available. These are the same Ant tasks used in the Eclipse SDK build. Documentation for each task is available in the Reference section of the Plug-in Development Environment Guide.

Compare APIs

You can now view API changes relative to an API baseline. Select a project or package in the Package Explorer and choose Compare With > API Baseline. Specify the API baseline you wish to compare against and press OK. The API Tooling view will summarize the API changes.

API Tooling view

Build
Sort plug-ins across feature boundaries

PDE/Build determines compilation order by sorting plug-ins according to their dependencies. Previously, this sorting was only done within a single feature and features were compiled depth first in the order they were included.

Set the property:
flattenDependencies=true
in your build's configuration, and PDE/Build will instead sort plug-ins across feature boundaries. This allows you to structure your features according to the best logical groupings without restrictions imposed by compilation requirements.
Parallel compilation

If plug-ins are sorted across feature boundaries (see above), PDE/Build can also group plug-ins allowing for parallel compilation.

Set the property:
parallelCompilation=true
in your build's configuration, and PDE/Build will group plug-ins for parallel compilation using Ant's <parallel> task. Setting the properties parallelThreadCount and parallelThreadsPerProcessor will control the corresponding attributes on the parallel task.
Build integration with p2 PDE/Build has updated integration with p2. It is now able to publish metadata directly from your source instead of generating it based on binary jars. For an existing feature or product build, set the property:
           p2.gathering = true
     

Setting this property will use the p2 publisher to gather up your bundle and publish it into a build specific repository.

For product builds, this will automatically perform a director install to create the final product archives. If you also set the p2.metadata.repo and p2.artifact.repo properties then build will mirror the resulting product metadata into those repositories.

For Feature builds, this will create a p2 repository for the final archive. This also has the effect of setting groupConfigurations=true and outputUpdateJars=true.

Feature rootfile artifacts When publishing metadata directly from source using the p2.gathering=true property, root files contributed by features will be published into the artifact repository and associated metadata will be created. The result is that installing your feature will also cause the feature's root files to be installed.
Qualifier replacement on .product files

When building products using p2.gathering=true, PDE/Build will now replace the ".qualifier" on the version specified in a .product file used in a product build. Set the property p2.product.qualifier to be the qualifier you wish to use.

If no value is specified, the default will be either the value of forceContextQualifier or the default timestamp.

Fetch artifacts for your build using p2 A new extension has been added to PDE/Build that enables users to fetch artifacts from p2 repositories. You can now add an entry to your map file for build input and PDE/Build will retrieve the artifact and include it in the build.

The map file entry needs to include the id and version of the installable unit (IU), and the URI of the repository where the IU can be found. The metadata and artifact repositories are assumed to be co-located. An example (needs to be on one line) is:

plugin@my.bundle.id,1.0.0=p2IU,id=my.bundle.id,version=    1.0.0,repository=http://example.com/repo

p2 repositories as a target for PDE Build

You can now specify a location that contains local p2 repositories in nested folders or zip files. The build will automatically transform the repositories into a form that PDE/Build can compile against.

There is a new processRepos phase in the main build script with corresponding pre and post targets in the customTargets.xml file.

You must set these properties in the build.properties for your builder. The repoBaseLocation is the location of the folder containing the local p2 repositories. The transformedRepoLocation is the location where the transformed artifacts will be placed after being processed.

repoBaseLocation=${base}/repos
transformedRepoLocation=${base}/transformedRepos

Target Platform
Target platform and target definitions

The target platform preference page (Preferences > Plug-in Development > Target Platform) has been redesigned. The page allows the user to select the active target platform from all target definitions in the workspace. Target definitions can be created and edited from this page using a wizard or with the target definition editor. You can quickly switch between targets using the checkboxes. Targets can be composed of plug-ins originating from installations, directories, features, and software sites. See target definition concepts for more details on crafting targets.

Target platform preference page

Target editor enhancements The target editor has been enhanced to support new features in target definitions. Targets now support installation-based locations in addition to directories and features. As well, the editor support retrieval of plug-ins from update sites. The wizards used to add content to a target definition are the same as described in the new target platform preference page (above).

Target Definition Editor

To support new features, the underlying target file format has been enhanced. The new editor continues to read old target files, but only writes files in the new format.

Target platform state

The new Target Platform State view displays all the bundles used to build, run and debug plug-ins with. The state is built from the active target definition.

Target Platform State view