Class UIManagerImpl

  • All Implemented Interfaces:
    UIManager

    public class UIManagerImpl
    extends java.lang.Object
    implements UIManager
    • Method Detail

      • createBasicPluginViewModel

        public BasicPluginViewModel createBasicPluginViewModel​(java.lang.String name)
        Description copied from interface: UIManager
        Creates a basic plugin view model and adds it to the plugin in one step.
        Specified by:
        createBasicPluginViewModel in interface UIManager
        Parameters:
        name - The name for the view (this should be localised text, rather than a message string).
        Returns:
        BasicPluginViewModel
      • getBasicPluginViewModelKey

        public static java.lang.String getBasicPluginViewModelKey​(BasicPluginViewModel model)
      • getBasicPluginViewModel

        public static BasicPluginViewModel getBasicPluginViewModel​(java.lang.String key)
      • createBasicPluginConfigModel

        public BasicPluginConfigModel createBasicPluginConfigModel​(java.lang.String section_name)
        Description copied from interface: UIManager
        Creates a basic plugin view model and places it inside the plugins section of the configuration page.
        Specified by:
        createBasicPluginConfigModel in interface UIManager
        Parameters:
        section_name - Message Bundle resource id for the config model. This will be used as the name of the config page, as well as an unique id
        Returns:
        BasicPluginConfigModel
      • createBasicPluginConfigModel

        public BasicPluginConfigModel createBasicPluginConfigModel​(java.lang.String parent_section,
                                                                   java.lang.String section_name)
        Description copied from interface: UIManager
        Creates a basic plugin view model and adds it to the plugin in one step. view is placed inside the plugins section of the configuration page.
        Specified by:
        createBasicPluginConfigModel in interface UIManager
        Parameters:
        parent_section - see ConfigSection.SECTION_*
        section_name - Message Bundle resource id for the config model. This will be used as the name of the config page, as well as an unique id
        Returns:
        BasicPluginConfigModel
      • getMenuManager

        public MenuManager getMenuManager()
        Description copied from interface: UIManager
        Retrieve the menu manager.
        Specified by:
        getMenuManager in interface UIManager
        Returns:
        Menu management functions
      • initialisationComplete

        public static void initialisationComplete()
      • addUIEventListener

        public void addUIEventListener​(UIManagerEventListener listener)
        Description copied from interface: UIManager
        Add a listener that's triggered on when core/plugins need to do an UI-only task, such as display a message to a user, or open an URL in a browser.

        See UIManagerEvent for types of events

        Specified by:
        addUIEventListener in interface UIManager
      • hasUIInstances

        public boolean hasUIInstances()
        Description copied from interface: UIManager
        Returns true if there any user interfaces currently attached to Azureus. Note that this value may change over time, and that at the point when a plugin is being initialised, there is no guarantee over whether if the user interfaces will have been created yet or not. If you want to monitor what user interfaces are being attached / detached from Azureus, you should add a UIListener to this object.
        Specified by:
        hasUIInstances in interface UIManager
      • getUIInstances

        public UIInstance[] getUIInstances()
        Description copied from interface: UIManager
        Returns an array of all currently attached user interfaces. Note that this value may change over time, and that at the point when a plugin is being initialised, there is no guarantee over whether if the user interfaces will have been created yet or not. If you want to monitor what user interfaces are being attached / detached from Azureus, you should add a UIListener to this object.
        Specified by:
        getUIInstances in interface UIManager
      • fireEvent

        public static boolean fireEvent​(PluginInterface pi,
                                        int type,
                                        java.lang.Object data)
      • showTextMessage

        public void showTextMessage​(java.lang.String title_resource,
                                    java.lang.String message_resource,
                                    java.lang.String contents)
        Specified by:
        showTextMessage in interface UIManager
      • showMessageBox

        public long showMessageBox​(java.lang.String title_resource,
                                   java.lang.String message_resource,
                                   long message_map)
        Specified by:
        showMessageBox in interface UIManager
        message_map - - see UIManagerEvent.MT_x
        Returns:
        selected value
      • showMessageBox

        public long showMessageBox​(java.lang.String title_resource,
                                   java.lang.String message_resource,
                                   long message_map,
                                   java.lang.Object[] params)
        Specified by:
        showMessageBox in interface UIManager
        message_map - - see UIManagerEvent.MT_x
        params - - [ remember-id (String), remember-by-default (Boolean), remember-resource (String) ]
        Returns:
        selected value
      • showMessageBox

        public long showMessageBox​(java.lang.String title_resource,
                                   java.lang.String message_resource,
                                   long message_map,
                                   java.util.Map<java.lang.String,​java.lang.Object> params)
        Specified by:
        showMessageBox in interface UIManager
        Returns:
      • openFile

        public void openFile​(java.io.File file)
        Description copied from interface: UIManager
        Opens up the file using the associated application.
        Specified by:
        openFile in interface UIManager
        Parameters:
        file - The file to open.
      • showFile

        public void showFile​(java.io.File file)
        Description copied from interface: UIManager
        Shows the file in a file explorer application in its parent folder.
        Specified by:
        showFile in interface UIManager
        Parameters:
        file - The file to show.
      • showConfigSection

        public boolean showConfigSection​(java.lang.String sectionID)
        Description copied from interface: UIManager
        Open Config View to the section specified
        Specified by:
        showConfigSection in interface UIManager
        Parameters:
        sectionID - ID of section to open to. ConfigSection.SECTION_* constants
        Returns:
        true-Section opened; false-Section invalid or UI does not support config views
      • createMessage

        public UIMessage createMessage()
        Description copied from interface: UIManager
        Retrieves a UIMessage from any interface available, or returns null if one is not available. This is a convenience method to allow you to grab an instance without having to iterate over any attached interfaces.
        Specified by:
        createMessage in interface UIManager
        See Also:
        UIInstance.createMessage()
      • createLoggingViewModel

        public BasicPluginViewModel createLoggingViewModel​(LoggerChannel channel,
                                                           boolean use_plugin_name)
        Description copied from interface: UIManager
        Creates a BasicPluginViewModel object primarily to be used for storing logging output. This is just a shortcut way of creating a log view for the logger channel.
        Specified by:
        createLoggingViewModel in interface UIManager
        Parameters:
        channel - The LoggerChannel to associate with.
        use_plugin_name - If set to true, the log view will be taken from the plugin name, if false, it will be taken from the channel name.
      • getDataSource

        public java.lang.Object getDataSource()
        Specified by:
        getDataSource in interface UIManager
      • triggerDataSourceListeners

        private static void triggerDataSourceListeners​(java.lang.Object ds)