Class OptionsDisplayer

java.lang.Object
org.netbeans.api.options.OptionsDisplayer

public final class OptionsDisplayer extends Object
Permits Options Dialog to open the options dialog with some category pre-selected.
Since:
1.5
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Registration name of Advanced category (aka Miscellaneous).
    static final String
    Registration name of Editor category.
    static final String
    Registration name of FontsAndColors category (aka Fonts & Colors).
    static final String
    Registration name of General category.
    static final String
    Registration name of Keymaps category (aka Keymap).
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the default OptionsDisplayer
    boolean
    Open the options dialog (in non-modal mode) with no guarantee which category is pre-selected.
    boolean
    open(boolean isModal)
    Open the options dialog with no guarantee which category is pre-selected.
    boolean
    open(String path)
    Open the options dialog (in non-modal mode) with some panel preselected.
    boolean
    open(String path, boolean isModal)
    Open the options dialog with some panel preselected.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ADVANCED

      public static final String ADVANCED
      Registration name of Advanced category (aka Miscellaneous).
      Since:
      1.8
      See Also:
    • KEYMAPS

      public static final String KEYMAPS
      Registration name of Keymaps category (aka Keymap).
      Since:
      1.29
      See Also:
    • FONTSANDCOLORS

      public static final String FONTSANDCOLORS
      Registration name of FontsAndColors category (aka Fonts & Colors).
      Since:
      1.29
      See Also:
    • EDITOR

      public static final String EDITOR
      Registration name of Editor category.
      Since:
      1.29
      See Also:
    • GENERAL

      public static final String GENERAL
      Registration name of General category.
      Since:
      1.29
      See Also:
  • Method Details

    • getDefault

      public static OptionsDisplayer getDefault()
      Get the default OptionsDisplayer
      Returns:
      the default instance
    • open

      public boolean open()
      Open the options dialog (in non-modal mode) with no guarantee which category is pre-selected.
      Returns:
      true if optins dialog was sucesfully opened with some pre-selected category. If no category is registered at all then false will be returned and options dialog won't be opened.
    • open

      public boolean open(String path)
      Open the options dialog (in non-modal mode) with some panel preselected. To open a top-level panel, pass its OptionsPanelController.TopLevelRegistration.id(). To open a subpanel, pass its OptionsPanelController.SubRegistration.location() followed by / followed by its OptionsPanelController.SubRegistration.id(). To open a container panel without specifying a particular subpanel, pass its OptionsPanelController.ContainerRegistration.id(). To avoid typos and keep track of dependencies it is recommended to define compile-time constants for all these IDs, to be used both by the annotations and by calls to this method.
      Parameters:
      path - slash-separated path of category and perhaps subcategories to be selected
      Returns:
      true if optins dialog was sucesfully opened with required category. If this method is called when options dialog is already opened then this method will return immediately false without affecting currently selected category in opened options dialog. If category (i.e. the first item in the path) does not correspond to any of registered categories then false is returned and options dialog is not opened at all (e.g. in case that module providing such category is not installed or enabled). If subcategory doesn't exist, it opens with category selected and it returns true. It is up to particular OptionsPanelController to handle such situation.
      Since:
      1.8
    • open

      public boolean open(boolean isModal)
      Open the options dialog with no guarantee which category is pre-selected.
      Parameters:
      isModal - true if the options window should be in modal mode, false otherwise
      Returns:
      true if options dialog was successfully opened with some pre-selected category. If no category is registered at all then false will be returned and options dialog won't be opened.
      Since:
      1.33
    • open

      public boolean open(String path, boolean isModal)
      Open the options dialog with some panel preselected. To open a top-level panel, pass its OptionsPanelController.TopLevelRegistration.id(). To open a subpanel, pass its OptionsPanelController.SubRegistration.location() followed by / followed by its OptionsPanelController.SubRegistration.id(). To open a container panel without specifying a particular subpanel, pass its OptionsPanelController.ContainerRegistration.id(). To avoid typos and keep track of dependencies it is recommended to define compile-time constants for all these IDs, to be used both by the annotations and by calls to this method.
      Parameters:
      path - slash-separated path of category and perhaps subcategories to be selected
      isModal - true if the options window should be in modal mode, false otherwise
      Returns:
      true if options dialog was successfully opened with required category. If this method is called when options dialog is already opened then this method will return immediately false without affecting currently selected category in opened options dialog. If category (i.e. the first item in the path) does not correspond to any of registered categories then false is returned and options dialog is not opened at all (e.g. in case that module providing such category is not installed or enabled). If subcategory doesn't exist, it opens with category selected and it returns true. It is up to particular OptionsPanelController to handle such situation.
      Since:
      1.33