The toolkit is responsible for creating SWT controls adapted to work in Eclipse forms. In addition to changing their presentation properties (fonts, colors etc.), various listeners are attached to make them behave correctly in the form context.
In addition to being the control factory, the toolkit is also responsible for painting flat borders for select controls, managing hyperlink groups and control colors.
The toolkit creates some of the most common controls used to populate Eclipse forms. Controls that must be created using their constructors, adapt()
method is available to change its properties in the same way as with the supported toolkit controls.
Typically, one toolkit object is created per workbench part (for example, an editor or a form wizard). The toolkit is disposed when the part is disposed. To conserve resources, it is possible to create one color object for the entire plug-in and share it between several toolkits. The plug-in is responsible for disposing the colors (disposing the toolkit that uses shared color object will not dispose the colors).
FormToolkit is normally instantiated, but can also be subclassed if some of the methods needs to be modified. In those cases, super
must be called to preserve normal behaviour.
@since 3.0