Class UISWTInstanceImpl

    • Constructor Detail

      • UISWTInstanceImpl

        public UISWTInstanceImpl()
    • Method Detail

      • getInstance

        public UISWTInstance getInstance​(PluginInterface plugin_interface)
        Description copied from interface: UIInstanceFactory
        Some UI instances need to understand which plugin they are associated with. This method gives the opportunity to customise the UIInstance returned to a plugin so that operations on it can take the appropriate actions
        Specified by:
        getInstance in interface UIInstanceFactory
      • getDisplay

        public org.eclipse.swt.widgets.Display getDisplay()
        Description copied from interface: UISWTInstance
        Retrieve the SWT Display object that Azureus uses (when in SWT mode). If you have a thread that does some periodic/asynchronous stuff, Azureus will crashes with and 'InvalidThreadAccess' exception unless you embed your calls in a Runnable, and use getDisplay().aSyncExec(Runnable r);
        Specified by:
        getDisplay in interface UISWTInstance
        Returns:
        SWT Display object that Azureus uses
      • loadImage

        public org.eclipse.swt.graphics.Image loadImage​(java.lang.String resource)
        Specified by:
        loadImage in interface UISWTInstance
      • createGraphic

        public UISWTGraphic createGraphic​(org.eclipse.swt.graphics.Image img)
        Description copied from interface: UISWTInstance
        Creates an UISWTGraphic object with the supplied SWT Image
        Specified by:
        createGraphic in interface UISWTInstance
        Parameters:
        img - Image to assign to the object
        Returns:
        a new UISWTGraphic object
      • createShell

        public org.eclipse.swt.widgets.Shell createShell​(int style)
        Description copied from interface: UISWTInstance
        Creates a SWT Shell, ensuring Vuze knows about it (ie. Icon, "Window" menu)
        Specified by:
        createShell in interface UISWTInstance
        Returns:
      • detach

        public void detach()
                    throws UIException
        Description copied from interface: UIInstanceFactory
        This method will be called by the UI manager when detaching the UI to permit the action to be vetoed/any detach logic to occur. It should not be directly called by the plugin code
        Specified by:
        detach in interface UIInstanceFactory
        Throws:
        UIException
      • dispose

        public void dispose()
        Description copied from interface: UIInstanceFactory
        This method will be called by the UI manager after the UIInstance is detached.
        Specified by:
        dispose in interface UIInstanceFactory
      • addView

        public void addView​(java.lang.String sParentID,
                            java.lang.String sViewID,
                            UISWTViewEventListener l)
        Description copied from interface: UISWTInstance
        Add a detail view to an Azureus parent view. For views added to the Main window, this adds a menu option. For the other parent views, this adds a new tab within Azureus' own detail view.
        Specified by:
        addView in interface UISWTInstance
        Parameters:
        sParentID - VIEW_* constant
        sViewID - of your view. Used as part of the resource id.
        "Views.plugins." + ID + ".title" = title of your view
        l - Listener to be triggered when parent view wants to tell you an event has happened
      • registerView

        public void registerView​(java.lang.String forViewID,
                                 UISWTViewBuilder viewBuilder)
        Description copied from interface: UISWTInstance
        Register a view that will be created when the specified view is displayed

        When plugin is unloaded, any registrations will be automatically unregistered, and any views created from the builder will be automatically disposed

        Specified by:
        registerView in interface UISWTInstance
        Parameters:
        forViewID - VIEW_ Constant
        viewBuilder - use UISWTInstance.createViewBuilder(String, Class)
      • createViewBuilder

        public UISWTViewBuilder createViewBuilder​(java.lang.String viewID,
                                                  java.lang.Class<? extends UISWTViewEventListener> cla)
        Description copied from interface: UISWTInstance
        Creates an object representing how your view is to be created
        Specified by:
        createViewBuilder in interface UISWTInstance
        Parameters:
        viewID - Unique ID of your view
        cla - A UISWTViewEventListener class that will be created when the UI shows the view.
        Since this class will be instantiated with cla.newInstance(), the class must be a top-level class, and not a local or non-static nested class.
        Returns:
        UISWTViewBuilder which has additional values you can set, such as initial datasource
Specified by:
createViewBuilder in interface UISWTInstance
Parameters:
viewID - Unique ID of your view
Returns:
UISWTViewBuilder which has additional values you can set, such as initial datasource