public interface SWTContext extends GUIContext
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.
| Modifier and Type | Method and Description |
|---|---|
Composite |
getParentComposite()
Gets the parent composite of this context to use for the GUI of the
application.
|
closeComposite getParentComposite()
InvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.