Skip to main content
Jump to: navigation, search

E4/UI/Toolkit Model/org.eclipse.e4.tm.ui

< E4‎ | UI‎ | Toolkit Model

The org.eclipse.e4.tm.ui plugin

This plugin provides views and editors that the developer will use to build models, script them, and view and try out the UIs resulting from the building process. The views and editors are fairly simple extensions of existing EMF tools, and combined with the existing tools for creating sample model data, complete functional applications may be build and run. The views and the editor will be presented, below.

Toolkit Model view

The Toolkit Model view listens to the currently active editor and shows a preview of the corresponding UI (if there is one). Since this UI is bound to the actual model instance in the editor, through the editing domain (provider), it will continuously update to reflect the editor's content.

The Toolkit Model Preview view

Toolkit Model Palette view

The Toolkit Model Palette view lets the user load one or more Toolkit Models and drag and drop model fragments into the Toolkit Model editor. By preparing examples models and loading them into this view, new models may be quickly assembled from existing fragments.

The view is split into two parts (see below), one showing the Ecore (resource) tree and the other the concrete (rendered) UI. EObjects can be dragged from both parts into the Toolkit Model editor.

The Toolkit Model Palette view

Toolkit Model Script Source view

The Toolkit Model Script Source view tracks the current selection in the currently active editor and shows the script source attached to the selection, of it contains such. The script source is found by looking for an attribute with a special annotation. If the currently active editor is an editing domain provider, the script source may be edited and a command for setting the appropriate attribute will be executed on the editor's command stack. Note that although this view only depends on the EMF Javascript support plugin and not on the Toolkit Model, it is part of this plugin for practical reasons.

The Toolkit Model Script view

Toolkit Model Editor

The Toolkit Model Editor is built on the reflective Ecore editor and supports editing of both Toolkit Model resources and resources containing sample data. The editor shows the standard model tree in the left part of a split pane, and the corresponding UI in the right part.

The Toolkit Model Editor with example

When used for editing a Toolkit Model only, the right part will have the same behavior as the Toolkit Model view (preview pane). I.e. it will continuously update to show the concrete UI corresponding to the Toolkit Model. However, if one or more resources with sample data are loaded, the EMF Javascript support kicks in. The scripts may add behavior to both data and UI, e.g. populate the UI with the data provided in the resources, react to user interaction, execute commands on the editor's command stack etc. Used this way, the Toolkit Model Editor and supporting views, provide an application development environment.

Back to the top