Class SwtUrlContext

  • All Implemented Interfaces:
    GUIContext, URLContext

    public class SwtUrlContext
    extends Object
    implements URLContext
    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.
    • Field Detail

      • baseUrl

        protected final URL baseUrl
        The base URL providing the HTML to be displayed in this context.
      • parentSwtContext

        protected final SWTContext parentSwtContext
        The parent SWT-context containing the Eclipse-Editor.
      • browser

        protected org.eclipse.swt.browser.Browser browser
        Browser widget for displaying content in the template
    • Constructor Detail

      • SwtUrlContext

        public SwtUrlContext​(URL baseURL,
                             SWTContext parentSWTContext)
        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 Detail

      • createBrowser

        protected void createBrowser()
        Creates and initialises the browser with the base URL of this context.
      • 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 interface GUIContext
      • getURL

        public URL getURL()
        Description copied from interface: URLContext
        Gets the URL of the (remote) HTMLContext which provides the GUI.
        Specified by:
        getURL in interface URLContext
        Returns:
        The URL of the (remote) HTMLContext which provides the GUI.