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.
public class MyPluginActivator extends AbstractUIPlugin { /** * This method is called upon plugin activation */ public void start(BundleContext context) throws Exception { super.start(context); IlvClassLoaderUtil.registerClassLoader(getClass().getClassLoader()); } /** * This method is called when the plugin is stopped */ public void stop(BundleContext context) throws Exception { super.stop(context); IlvClassLoaderUtil.unregisterClassLoader(getClass().getClassLoader()); } }
stop()
is necessary so that, when the plug-in gets unloaded, JViews gets
notified about the plug-in that is going to stop and can drop
references to its resources or instances of its classes. The
activator plug-in is usually also the place where IlvProductUtil.registerApplication is
called.
Composite parent = ...; IlpNetwork network = new IlpNetwork(); ControlSWTnetwork = new IlvSwingControl(parent, SWT.NONE, network);
Composite parent = ...; IlvManagerView mgrView = ...; IlvJManagerViewPanel jmgrView = new IlvJManagerViewPanel(mgrView); ControlSWTview = new IlvSwingControl(parent, SWT.NONE, jmgrView);
Component
hierarchy (see http://java.sun.com/javase/6/docs/api/java/awt/Component.html).
Component
inside the AWT component hierarchy. For details of components,
see http://java.sun.com/javase/6/docs/api/java/awt/Component.html.
Dialogs
, Swing
JDialogs
, or modal
JInternalFrames
in your application. There are also some other limitations. See
the class IlvEventThreadUtil for a precise
description of the limitations.
Display.asyncExec()
and the AWT method
EventQueue.invokeLater()
.
SWTExceptions
of type
ERROR_THREAD_INVALID_ACCESS
.
// Switch single-event-thread mode during a static initialization. static { IlvEventThreadUtil.enableAWTThreadRedirect(); }
IlvSwingUtil.isDispatchThread()
rather than EventQueue.isDispatchThread()
or SwingUtilities.isEventDispatchThread()
.
// Switch single-event-thread mode during a static initialization. static { IlvEventThreadUtil.enableAWTThreadRedirect(); }
Dialogs
, Swing
JDialogs
, or modal
JInternalFrames
in your application. There are also some other limitations.
See the class
IlvEventThreadUtil
for a precise description of the limitations.
EventQueue.isDispatchThread()
(see http://java.sun.com/javase/6/docs/api/java/awt/EventQueue.html#isDispatchThread())
or
SwingUtilities.isEventDispatchThread()
(see http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#isEventDispatchThread().)