Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

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

< E4‎ | UI‎ | Toolkit Model

The org.eclipse.e4.tm.builder plugin

This plugin includes both generic and toolkit-specific code for building the concrete UI from the toolkit model and keeping them synchronized. We refer to this as building and binding. Currently, there is only support for SWT, but much of the code can be reused for Swing.

The design is based on two kinds of objects, builders and binders. The builders control the overall process of creating the concrete widgets, structuring them into a hierarchy and binding them to the model. There is one builder for each UI that is created, specific for the chosen toolkit. The binders controls the life-cycle of each widget and are managed by the builders. There is one binder for each kind of widget (not one for each widget). Whenever a new widget must be created, a suitable binder is located (reused or created) and used as a factory. The binder also manages the synchronization of attributes and properties and handles user events.

The current builders and binders are fairly generic and are guided by annotations on the model (classes and features). E.g. an annotation on a named model element provides the real name for the corresponding toolkit-specific class. Another annotation on an attribute tells whether it is accessed as a bean property or as a field. In many cases, a new class may be handled by the existing builders and binders, just by adding the appropriate annotation. In other cases, a new binder must be implemented to handled new kinds of behavior. E.g. the TabFolder and Tab classes require a special binder to handle their tight coupling and the specificities of SWT.

Back to the top