e(fx)clipse 2.0 – Is released


I’m a bit late to announce the release of e(fx)clipse 2.0 but I’ve been heads down in e4/JavaFX projects so I did not yet have time to blog about the release in detail.

Where to get it from

Naturally we provide p2 update sites:

We also updated our All-In-One builds where we also bundled:

New Features / APIs

The main focus of the release clearly was on the runtime layer where we fixed 119 Bugzilla-Tickets (most of the enhancements). Below is a list of the more interesting ones.

Updateing your application got a lot easier

To put it in kind words the p2-API is a very low-level and noisy one allowing you to do crazy stuff but frankly all you really want is to request an update for your application. So this should be damn easy. With 2.0 we made it dead simple for you:

  • Tooling: The new application wizard allows you to directly bootstrap an application who has all necessary bits to update through p2
    p2-wizard
  • Runtime: We have had a unfunctional implementation which we revised (big thank to Dirk Fauth)
    import org.eclipse.e4.core.di.annotations.Execute
    import org.eclipse.fx.core.update.UpdateService;
    import org.eclipse.fx.core.update.UpdateService.UpdatePlan;
    import org.eclipse.fx.core.update.UpdateService.UpdateResult;
    
    import java.util.Optional;
    
    import org.eclipse.fx.core.ProgressReporter;
    import org.eclipse.fx.core.StatusException;
    
    public class RequestUpdate {
    	@Execute
    	public void update(UpdateService service) {
    		service
    			.checkUpdate(ProgressReporter.NULLPROGRESS_REPORTER)
    			.onComplete(this::onCheckComplete)
    			.onException(this::onException);
    	}
    	
    	private void onCheckComplete(Optional<UpdatePlan> updatePlan) {
    		if (updatePlan.isPresent()) {
    			updatePlan.get().runUpdate(ProgressReporter.NULLPROGRESS_REPORTER)
    				.onComplete(this::onUpdateSuccess)
    				.onException(this::onException);
    		} else {
    			// Show nothing to update
    		}
    	}
    	
    	private void onUpdateSuccess(UpdateResult result) {
    		// Inform that the update has finished
    	}
    	
    	private void onException(StatusException updatePlan) {
    		// Show info that status update failed
    	}
    }
    

New styled text APIs

In case you’ve seen me at demo camps, EclipseCon and XtextCon you noticed that we have put a lot of time into the StyledTextArea which we reworked internally a lot and so things like selection, … are working properly now! The nice side effect of the reworking of StyledTextArea internals is that we managed to factor out internal into reuseable small APIs.

  • StyledString: A java.lang.CharSequence who is made up of StyledStringSegments who have style classes associated with them
  • StyledLabel: Similar API to javafx.scene.control.Label allowing you to represent a StyledString in the scenegraph
  • StyledTextNode: A scenegraph node who is able to show arbitary decorations on a text string
  • StyledTextLayoutContainer: A scenegraph node who is able to display selections
  • SimpleTreeCell & SimpleListCell: Got enhanced to supported StyledString if the CharSequence provided by the labelExtractorFunction is a StyledString

The following screenshots shows some of them working together to present an Dart-Editor
screen-text

In the center is the StyledTextArea, the autocompletion dialog uses SimpleListCell and the outline view the SimpleTreeCell.

FilterableTreeItem & SortableTreeItem

Our UI-Library got 2 now TreeItem implementations who support filtering and sorting! The most remarkable thing is that they have not been developed by BestSolution.at but Christoph Keimel has contributed them!

Get in control of the e4 window WITHOUT providing a custom renderer

Previous version had very limited support for controling your window. Starting with 2.0 we provide a (provisional) API who allows you to control almost anything from your window! For that we developed an abstract window API (org.eclipse.fx.ui.controls.stage.Frame) and also ship some default implementations (eg org.eclipse.fx.ui.controls.stage.DefaultTrimmedWindowPane).

In the screenshot below we’ve relocated the MenuBar into a HBox with a search field at the end to save vertical space

screen-custom

Lightweight dialogs

Based on the Frame/Window API who is used in the renderer code in a heavy weight fashion we also have a new lightweight dialog system who is built around this API beside a base org.eclipse.fx.ui.controls.dialog.Dialog class we ship 2 implementations people we most likely use very frequently:

  • TitleAreaDialog
    screen-title-dialog
  • MessageDialog
    screen-message-dialog

e4 supports lightweight dialogs

While the lightweight dialog API can be used by any application, e4 applications can make use of lightweight dialogs through a new service named org.eclipse.fx.ui.services.dialog.LightWeightDialogService so opening a dialog who takes the complete window can be done with:

@Execute
public void openDialog(LightWeightDialogService service) {
    MyDialog d = new MyDialog();
    service.openDialog(d, ModalityScope.WINDOW);
}

While the dialog service allows to open a dialog and control it’s modality there’s a 2nd service who is able to control how a dialog is shown/hidden. By default the dialog is simply show and hidden but you can for example add some nice animations like shown in the video below.

This entry was posted in Announcements, e(fx)clipse. Bookmark the permalink.

2 Responses to e(fx)clipse 2.0 – Is released

  1. Pingback: Neue APIs für e(fx)clipse 2.0 - jaxenter.de

  2. Pingback: JavaFX links of the week, August 3 // JavaFX News, Demos and Insight // FX Experience

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.