Package de.aristaflow.adept2.ui.swtgui
Class SwtUrlContext
java.lang.Object
de.aristaflow.adept2.ui.swtgui.SwtUrlContext
- All Implemented Interfaces:
GUIContext,URLContext,Closeable,AutoCloseable
This
GUIContext provides a browser widget in SWT for a specific
URL based on a parent context. Closing will be forwarded to the parent
context.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classThe clean-up task for closing the browser. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final URLThe base URL providing the HTML to be displayed in this context.protected final Cleanup<RuntimeException>The clean-up for closing the parent context and the browser as post-mortem task for this instance.protected final SWTContextThe parent SWT-context containing the Eclipse-Editor. -
Constructor Summary
ConstructorsConstructorDescriptionSwtUrlContext(URL baseURL, SWTContext parentSWTContext) Creates a new URL context based on the Eclipse-Browser-widget. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the GUI for this context.protected org.eclipse.swt.browser.BrowsercreateBrowser(SWTContext parent) Creates and initialises the browser with the base URL of this context.getURL()Gets the URL of the (remote)HTMLContextwhich provides the GUI.
-
Field Details
-
baseUrl
The base URL providing the HTML to be displayed in this context. -
parentSwtContext
The parent SWT-context containing the Eclipse-Editor. -
cleanup
The clean-up for closing the parent context and the browser as post-mortem task for this instance.
-
-
Constructor Details
-
SwtUrlContext
Creates a new URL context based on the Eclipse-Browser-widget.- Parameters:
baseURL- The base URL providing the HTML to be displayed in the created context.parentSWTContext- The parent SWT-context containing the Eclipse-Editor.
-
-
Method Details
-
createBrowser
Creates and initialises the browser with the base URL of this context. -
close
public void close()Description copied from interface:GUIContextCloses 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceGUIContext
-
getURL
Description copied from interface:URLContextGets the URL of the (remote)HTMLContextwhich provides the GUI.- Specified by:
getURLin interfaceURLContext- Returns:
- The URL of the (remote)
HTMLContextwhich provides the GUI.
-