Skip to main content

Platform and Equinox API

Platform Changes

Easier usage of LabelProvider and ColumnLabelProvider The org.eclipse.jface.viewers.LabelProvider and org.eclipse.jface.viewers.ColumnLabelProvider classes now support lambda functions for their getText() and getImage() methods. This is provided through the new static methods createImageProvider() and createTextProvider() respectively.

For use cases where the LabelProvider should implement both the getText() and getImage() methods, the static method createTextImageProvider() can be used.

Former constructs like:

viewer.setLabelProvider(new LabelProvider() {
    @Override
    public String getText(Object element) {
        return element.toString();
    }
    @Override
    public Image getImage(Object element) {
        return defaultImage;
    }
});
can now be replaced by:
viewer.setLabelProvider(LabelProvider.createTextImageProvider(element -> element.toString(),
    element -> defaultImage));
Preference to change default layout to flat in Project Explorer In Eclipse 4.15, the default project layout in the Project Explorer has been switched to hierarchical layout, and a new preference is available for RCP providers who want to force flat layout by default instead.

The preference is org.eclipse.ui.navigator.resources/defaultToFlatLayout and can be set to true in plugin_customization.ini or programatically before Project Explorer opens for the first time, in order to force a flat project layout. Subsequent change to this preference after first initialization of Project Explorer will have no effect.

Allow configuration of enabled SWT add-ons in application model Loading the add-ons for SWT, automatically enables all the add-ons (Drag'n'Drop, MinMax, Split, Cleanup). You can now disable unwanted add-ons using tags (DisableDnDAddon, DisableMinMaxAddon, ...) on the application model.

SWT Changes

New APIs to style CTabItem New APIs have been added to CTabItem to set the foreground color and selection foreground color of the individual CTabItem.

public void CTabItem.setForeground(Color color)
public Color CTabItem.getForeground()

public void CTabItem.setSelectionForeground(Color color)
public Color CTabItem.getSelectionForeground()

WebKit1 support dropped Starting from Eclipse 4.15, SWT/GTK no longer supports WebKit1 as a browser backend. Only WebKit2 is supported, and all WebKit1 code has been removed.

Previous Up Next

Back to the top