Metawidget ships with native widgets for different UI frameworks. Whilst all Metawidgets are broadly similar, they are tailored to take advantage of their native environment. This chapter covers each Metawidget in detail. For an explanation of the overall architecture of Metawidget, see Chapter 2, Architecture.
Metawidget supports multiple desktop frameworks, so that you can choose the one that matches your preferred UI environment.
SwingMetawidget is a Swing JComponent. For an introduction to SwingMetawidget, see Section 1.1, “Part 1 (Java version) - The First Metawidget Application” and Section 1.3.1, “Desktop Address Book”.
There are two steps to installing SwingMetawidget within a Swing application:
Add metawidget-all.jar to your CLASSPATH.
Optionally configure the Metawidget, as described below.
SwingMetawidget is preconfigured with sensible defaults for Swing. You can change this configuration either programmatically (as detailed in Section 1.1.5, “Inspectors”) or using a metawidget.xml file (as detailed in Section 1.1.9, “Configuring Metawidget Externally”).
Since inception, Swing has had built-in, and extensive, Look and Feel support. Metawidget does not overlap this. For layouts, Swing supports a multitude of LayoutManagers. Metawidget leverages these, and automates them to construct UIs automatically. The layout manager can be configured through either metawidget.xml or programmatically using setMetawidgetLayout.
SwingMetawidget supports localization through the setBundle method. This method takes a ResourceBundle object. Keys are looked up based on the name of each business property.
SwingMetawidget inspects objects and populates child widgets automatically in response to the standard JComponent.paintComponent event. There is no need to explicitly trigger population. SwingMetwidget also populates itself just-in-time if clients interrogate it through standard methods such as JComponent.getComponentCount or JComponent.getBounds.
SwtMetawidget is an SWT Composite. For an introduction to SwtMetawidget, see Section 1.3.1, “Desktop Address Book”.
There are two steps to installing SwtMetawidget within an SWT application:
Add metawidget-all.jar to your CLASSPATH.
Optionally configure the Metawidget, as described below.
SwtMetawidget is preconfigured with sensible defaults for SWT. You can change this configuration either programmatically (as detailed for Swing in Section 1.1.5, “Inspectors”, but the SWT API is the same) or using a metawidget.xml file (as detailed in Section 1.1.9, “Configuring Metawidget Externally”).
Since inception, SWT has had built-in, and extensive, Look and Feel support. Metawidget does not overlap this. For layouts, SWT supports a multitude of LayoutManagers. Metawidget leverages these, and automates them to construct UIs automatically. The layout manager can be configured through either metawidget.xml or programmatically using setMetawidgetLayout.