The bridge between AWT/Swing and SWT
The bridge between the AWT/Swing windowing system and the SWT windowing system consists of an
IlvSwingControl class that encapsulates a Swing JComponent in an SWT widget. This class allows you to use
IlpNetwork,
IlpEquipment,
IlpTree, and
IlpTable objects in an SWT window, together with other SWT or JFace controls.
The following code shows how to create a bridge object:
Composite parent = ...;
IlpNetwork network = new IlpNetwork();
ControlSWTnetwork = new IlvSwingControl(parent, SWT.NONE, network);
At the JViews Framework level, the bridge between the AWT/Swing windowing system and the SWT windowing system consists of an
IlvSwingControl class that encapsulates a Swing JComponent in an SWT widget. This class allows you to use
IlvManager or
IlvJManagerViewPanel objects in an SWT window, together with other SWT or JFace controls.
The following code shows how to create a bridge object at the JViews Framework level:
Composite parent = ...;
IlvManagerView mgrView = ...;
IlvJManagerViewPanel jmgrView = new IlvJManagerViewPanel(mgrView);
ControlSWTview = new IlvSwingControl(parent, SWT.NONE, jmgrView);
Using IlvSwingControl instead of the native SWT_AWT class has the following benefits:
Portability:
IlvSwingControl also works on platforms that do not have SWT_AWT, like X11/Motif® and MacOS® X 10.4.
Less flickering: on Linux®/Gtk, flickering is reduced.
Better size management: the size management between SWT and AWT (
LayoutManager) is integrated.
Focus: it provides a workaround for a focus problem on Microsoft® Windows® platforms.
NOTE >> 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.
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.