Class OptionsManager

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deregisterOwner​(Plugin ownerPlugin)
      Deregister the owner from the options; if options are empty, then remove the options from the map.
      void dispose()  
      void editOptions()
      Show the dialog to edit options.
      org.jdom.Element getConfigState()
      Write this object out; first remove any unused options so they do not hang around.
      ToolOptions[] getOptions()
      Get the list of options for all categories.
      ToolOptions getOptions​(java.lang.String category)
      Get the options for the given category name.
      boolean hasOptions​(java.lang.String category)
      Return whether an Options object exists for the given category.
      void optionsChanged​(ToolOptions options, java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
      Notification that an option changed.
      void registerOptionNameChanged​(java.lang.String oldName, java.lang.String newName)
      Updates saved options from an old name to a new name.
      void removeUnusedOptions()  
      void setConfigState​(org.jdom.Element root)
      Restore Options objects using the given XML Element.
      void showOptionsDialog​(java.lang.String category, java.lang.String filterText)
      Shows Options Dialog with the section called 'category' being displayed
      void validateOptions()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OptionsManager

        public OptionsManager​(PluginTool tool)
        Constructor
        Parameters:
        tool - associated with this OptionsManager
    • Method Detail

      • dispose

        public void dispose()
      • getOptions

        public ToolOptions getOptions​(java.lang.String category)
        Get the options for the given category name.
        Specified by:
        getOptions in interface OptionsService
        Parameters:
        category - name of category
        Returns:
        the options for the given category name.
      • registerOptionNameChanged

        public void registerOptionNameChanged​(java.lang.String oldName,
                                              java.lang.String newName)
        Updates saved options from an old name to a new name. NOTE: this must be called before any calls to register or get options.
        Parameters:
        oldName - the old name of the options.
        newName - the new name of the options.
      • hasOptions

        public boolean hasOptions​(java.lang.String category)
        Return whether an Options object exists for the given category.
        Specified by:
        hasOptions in interface OptionsService
        Parameters:
        category - name of the category
        Returns:
        true if an Options object exists
      • showOptionsDialog

        public void showOptionsDialog​(java.lang.String category,
                                      java.lang.String filterText)
        Shows Options Dialog with the section called 'category' being displayed
        Specified by:
        showOptionsDialog in interface OptionsService
        Parameters:
        category - The category of options to have displayed
        filterText - An optional value used to filter the nodes visible in the options tree. You may pass null or the empty string "" here if you do not desire filtering.
      • getOptions

        public ToolOptions[] getOptions()
        Get the list of options for all categories.
        Specified by:
        getOptions in interface OptionsService
        Returns:
        the list of options for all categories.
      • deregisterOwner

        public void deregisterOwner​(Plugin ownerPlugin)
        Deregister the owner from the options; if options are empty, then remove the options from the map.
        Parameters:
        owner - owner name
      • getConfigState

        public org.jdom.Element getConfigState()
        Write this object out; first remove any unused options so they do not hang around.
        Returns:
        XML element containing the state of all the options
      • removeUnusedOptions

        public void removeUnusedOptions()
      • setConfigState

        public void setConfigState​(org.jdom.Element root)
        Restore Options objects using the given XML Element.
        Parameters:
        root - element to use to restore the Options objects
      • editOptions

        public void editOptions()
        Show the dialog to edit options.
      • validateOptions

        public void validateOptions()
      • optionsChanged

        public void optionsChanged​(ToolOptions options,
                                   java.lang.String name,
                                   java.lang.Object oldValue,
                                   java.lang.Object newValue)
        Description copied from interface: OptionsChangeListener
        Notification that an option changed.

        Note: to reject an options change, you can throw a OptionsVetoException.

        Specified by:
        optionsChanged in interface OptionsChangeListener
        Parameters:
        options - options object containing the property that changed
        name - name of option that changed
        oldValue - old value of the option
        newValue - new value of the option