Class UISWTInstanceImpl.instanceWrapper

    • Method Detail

      • getUIType

        public java.lang.String getUIType()
        Specified by:
        getUIType in interface UIInstance
        Returns:
      • 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
      • addView

        @Deprecated
        public void addView​(java.lang.String sParentViewID,
                            java.lang.String sViewID,
                            UISWTViewEventListener l)
        Deprecated.
        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:
        sParentViewID - 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
      • openMainView

        public void openMainView​(java.lang.String sViewID,
                                 UISWTViewEventListener l,
                                 java.lang.Object dataSource)
        Description copied from interface: UISWTInstance
        Create and open a view in the main window immediately. If you are calling this from UIManagerListener.UIAttached(UIInstance), the view will not gain focus.

        Tip: You can add a menu item to a table view, and when triggered, have it open a new window, passing the datasources that were selected

        Specified by:
        openMainView in interface UISWTInstance
        Parameters:
        sViewID - ID to give your view
        l - Listener to be triggered when View Events occur
        dataSource - objects to set UISWTView.getDataSource() with
      • openMainView

        public void openMainView​(java.lang.String sViewID,
                                 UISWTViewEventListener l,
                                 java.lang.Object dataSource,
                                 boolean setfocus)
        Description copied from interface: UISWTInstance
        Create and open a view in the main window immediately. If you are calling this from UIManagerListener.UIAttached(UIInstance), the view will not gain focus.

        Tip: You can add a menu item to a table view, and when triggered, have it open a new window, passing the datasources that were selected

        Specified by:
        openMainView in interface UISWTInstance
        Parameters:
        sViewID - ID to give your view
        l - Listener to be triggered when View Events occur
        dataSource - objects to set UISWTView.getDataSource() with
        setfocus - true if you want to display the view immediately, false if you want to display it in the background.
      • removeViews

        public void removeViews​(java.lang.String sParentID,
                                java.lang.String sViewID)
        Description copied from interface: UISWTInstance
        Remove all views that belong to a specific parent and of a specific View ID. If the parent is the main window, the menu item will be removed.
        If you wish to remove (close) just one view, use UIPluginView.closeView()
        Specified by:
        removeViews in interface UISWTInstance
        Parameters:
        sParentID - One of VIEW_* constants
        sViewID - View ID to remove
      • getOpenViews

        public UISWTView[] getOpenViews​(java.lang.String sParentID)
        Description copied from interface: UISWTInstance
        Get a list of views currently open on the specified VIEW_* view
        Specified by:
        getOpenViews in interface UISWTInstance
        Parameters:
        sParentID - VIEW_* constant
        Returns:
        list of views currently open
      • promptUser

        public int promptUser​(java.lang.String title,
                              java.lang.String text,
                              java.lang.String[] options,
                              int defaultOption)
        Description copied from interface: UIInstance
        Prompts the user with a title, text, and a series of options. The options are typically displayed as buttons.

        This method returns blocks the UI until the user makes a choice. It's recommended to use UIInstance.promptUser(String, String, String[], int, UIMessageListener) instead

        Specified by:
        promptUser in interface UIInstance
        Returns:
        Index of option chosen, -1 if cancelled or error
      • promptUser

        public void promptUser​(java.lang.String title,
                               java.lang.String text,
                               java.lang.String[] options,
                               int defaultOption,
                               UIMessageListener listener)
        Description copied from interface: UIInstance
        Prompts the user with a title, text, and a series of options. The options are typically displayed as buttons.

        This method returns immediately.

        Specified by:
        promptUser in interface UIInstance
        options - List of options to present to the user. Typically shown as buttons
        listener - triggered after user chooses an option
      • openView

        public boolean openView​(java.lang.String sParentID,
                                java.lang.String sViewID,
                                java.lang.Object dataSource)
        Description copied from interface: UISWTInstance
        Open a previously added view
        Specified by:
        openView in interface UISWTInstance
        Parameters:
        sParentID - ParentID of the view to be shown
        sViewID - id of the view to be shown
        dataSource - any data you need to pass the view
        Returns:
        success level
      • openView

        public boolean openView​(java.lang.String forViewID,
                                java.lang.String sViewID,
                                java.lang.Object dataSource,
                                boolean setfocus)
        Description copied from interface: UISWTInstance
        Open a previously added view
        Specified by:
        openView in interface UISWTInstance
        Parameters:
        forViewID - View that the opened view belongs to
        sViewID - id of the view to be shown
        dataSource - any data you need to pass the view
        setfocus - true if you want to display the view immediately, false if you want to display it in the background.
        Returns:
        success level
      • getInputReceiver

        public UIInputReceiver getInputReceiver()
        Description copied from interface: UIInstance
        Creates a UIInputReceiver instance to allow a plugin to request text input from the user. Some interfaces may not allow or support the ability for a plugin to request text input from a user, in which case they will return null for this method.
        Specified by:
        getInputReceiver in interface UIInstance
      • createMessage

        public UIMessage createMessage()
        Description copied from interface: UIInstance
        Creates a UIMessage instance to allow a plugin to inform or ask the user something. Some interfaces may not allow or support the ability for a plugin to ask a user in this manner, in which case they will return null for this method.
        Specified by:
        createMessage in interface UIInstance
      • showDownloadBar

        public void showDownloadBar​(Download download,
                                    boolean display)
        Description copied from interface: UISWTInstance
        Shows or hides a download bar for a given download.
        Specified by:
        showDownloadBar in interface UISWTInstance
        Parameters:
        download - Download to use.
        display - true to show a download bar, false to hide it.
      • showTransfersBar

        public void showTransfersBar​(boolean display)
        Description copied from interface: UISWTInstance
        Shows or hides the transfers bar.
        Specified by:
        showTransfersBar in interface UISWTInstance
        Parameters:
        display - true to show the bar, false to hide it.
      • 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:
      • 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