![]() | The Java Developer's Guide to Eclipse |
Chapter 33, Swing Interoperability, is for those not quite ready to jump in and rewrite their Swing-based development tools or applications based on SWT (see Chapter 14). There are a various reasons for choosing an SWTSwing hybrid approach: time-to-market considerations, for example, or the desire to create a prototype that demonstrates the value of Eclipse integration. In either case, the goal is to add your existing function to the Eclipse Platform with minimal changes to your existing code base while at the same time providing some level of integration with Eclipse that affords a good end-user experience.
Two examples complement Chapter 33:
com.ibm.jdg2e.swt_swing.embed.converter.
This plug-in defines a "Volume Converter" that demonstrates
how to embed an AWT/Swing application.
com.ibm.jdg2e.swing.external.launch.
It is a hybrid application
that incorporates a Swing editor in a launch-and-edit scenario, which keeps
the Eclipse workspace synchronized with the file system changes made by the
editor. The launch-and-edit example is provided as an alternative implementation
for those platforms where embedding is not yet supported.
To launch the first example, select Run > Run As > Eclipse Application and then open the converter from the runtime Workbench's Window > Show View > Other... > JDG2E > Volume Converter menu choice.
EmbeddedSwingConverterView.EmbeddedSwingConverterView creates a user interface using
an SWT Composite that can accept Swing widgets.Composite is used as the base for the creation of a Swing
component, this is done using VolConverter, which calls other classes
to build the Swing-based UI.
| Class (All) | Description |
EmbeddedSwingConverterView |
The EmbeddedSwingConverterView is an Eclipse view part that can host
a mix of SWT and Swing components.
simple example of a Swing application that provides
a text editor for files of type .abc. |
VolConverter |
Component that creates a Swing user interface on top of the SWT composite that can support Swing widgets. |
© Copyright International Business Machines Corporation, 2003, 2004, 2006. All Rights Reserved.
Code or samples provided herein are provided without warranty of any kind.