Package de.aristaflow.adept2.ui.awtgui
Class SWTEmbeddedAWTContext
- java.lang.Object
-
- de.aristaflow.adept2.ui.awtgui.SWTEmbeddedAWTContext
-
- All Implemented Interfaces:
GUIContext
,AWTContext
public class SWTEmbeddedAWTContext extends Object implements AWTContext
- Author:
- Markus Lauer This class makes it possible to integrate an application component with an AWT-GUI into a SWT environment. It uses the AWT-SWT-bridge provided by the eclipse foundation.
-
-
Field Summary
Fields Modifier and Type Field Description protected Thread
controlThread
The thread which executes the application using this context.protected org.eclipse.swt.widgets.Composite
parentComposite
The SWT element that includes the AWT Frame the AWT component can insert its gui elements.protected Frame
parentFrame
The AWT Frame the AWT component can insert its GUI elements.protected SWTContext
swtContext
The SWT context the AWT GUI could be integrated into
-
Constructor Summary
Constructors Constructor Description SWTEmbeddedAWTContext(Thread controlThread, SWTContext swtContext)
Constructs an graphical context for an AWT based application component up on an existing swt graphical context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the GUI for this context.Frame
getParentFrame()
Gets the parent frame of this context to use for the GUI of the application.
-
-
-
Field Detail
-
swtContext
protected SWTContext swtContext
The SWT context the AWT GUI could be integrated into
-
parentComposite
protected org.eclipse.swt.widgets.Composite parentComposite
The SWT element that includes the AWT Frame the AWT component can insert its gui elements.
-
parentFrame
protected Frame parentFrame
The AWT Frame the AWT component can insert its GUI elements.
-
controlThread
protected Thread controlThread
The thread which executes the application using this context.
-
-
Constructor Detail
-
SWTEmbeddedAWTContext
public SWTEmbeddedAWTContext(Thread controlThread, SWTContext swtContext)
Constructs an graphical context for an AWT based application component up on an existing swt graphical context.- Parameters:
controlThread
- The thread which executes the application using this context.swtContext
- The existing SWT context.- See Also:
SWTContext
-
-
Method Detail
-
getParentFrame
public Frame getParentFrame()
Description copied from interface:AWTContext
Gets the parent frame of this context to use for the GUI of the application.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
getParentFrame
in interfaceAWTContext
- Returns:
- Returns the parent composite which should be used by the Component to draw its GUI.
-
close
public void close()
Description copied from interface:GUIContext
Closes the GUI for this context. This method has to be called by the runtime manager whenever an application has terminated (finished, failed, aborted, killed,...).
It must be possible to call this method more than once, even if the GUIContext has already shut down. This especially applies to the disposal of SWT-widgets, that is, it is allowed to call this method after the disposal of the corresponding widgets.- Specified by:
close
in interfaceGUIContext
-
-