Interface SWTContext
- All Superinterfaces:
AutoCloseable,Closeable,GUIContext
- All Known Subinterfaces:
SWTBrowserContext
GUIManager and provided to
the application component via SessionContext.getGUIContext(). The
application component has to cast the returned GUIContext to
this graphical context.
Some SWT inherent methods must be executed by the corresponding display thread. The implementation of this interface has to ensure that the display thread is available for an application component. I. e. the compontent using a gui context of that type may pass any commands to execute within the display thread by the following code fragment:
getParentComposite().getDisplay().syncExec(new Runnable(){
public void run()
{
//commands to execute
}
});
Note: This context does not ensure that the SWT-environment is integrated in
an eclipse environment. So, in general, the application components must not
make use of any features provided by eclipse. To ensure that there is a
running eclipse instance in background components should claim the
de.aristaflow.adept2.ui.swtgui.EclipseAwareSWTContext.
- Author:
- Markus Lauer
-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.widgets.CompositeGets the parent composite of this context to use for the GUI of the application.Methods inherited from interface de.aristaflow.adept2.model.runtimeenvironment.GUIContext
close
-
Method Details
-
getParentComposite
org.eclipse.swt.widgets.Composite getParentComposite()Gets the parent composite of this context to use for the GUI of the application.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Returns:
- Returns the parent composite which should be used by the Component to draw its GUI.
-