JViews provides an IlvSwingControl class that encapsulates a Swing JComponent in an SWT widget. It allows you to use IlpNetwork, IlpEquipment, IlpTree, and IlpTable objects in an SWT window, together with other SWT or JFace controls. In this way, it provides a bridge between the AWT/Swing windowing system and the SWT windowing system.
For example:
Composite parent = ...;
IlpNetwork network = new IlpNetwork();
ControlSWTnetwork = new IlvSwingControl(parent, SWT.NONE, network);
|
Using IlvSwingControl instead of the native SWT_AWT class has the following benefits:
-
Simplicity: it is easier to use, since you do not have to worry about the details of the
Component hierarchy.
-
Portability:
IlvSwingControl works also on platforms that do not have SWT_AWT platforms, like X11/Motif and MacOS X 10.4.
-
Flickering on Linux/Gtk is reduced.
-
Popup menus can be positioned on each
Component inside the AWT component hierarchy.
-
The size management between SWT and AWT (
LayoutManager) is integrated.
-
A focus problem on Windows is worked around.
| Notes |
The IlvSwingControl bridge is not supported on all platforms. It is only supported on Windows, UNIX with X11 (Linux, Solaris, AIX, HP-UX), and MacOS X 10.4 or later. The IlvSwingControl bridge does not support arbitrary JComponents. Essentially, components that provide text editing are not supported. See IlvSwingControl for a precise description of the limitations.
|