org.netbeans.modules.options.api/1 1.18.1

org.netbeans.spi.options
Class OptionsCategory

java.lang.Object
  extended by org.netbeans.spi.options.OptionsCategory

public abstract class OptionsCategory
extends Object

This class represents one category (like "Fonts & Colors" or "Editor") in Options Dialog.

Normally panels are registered using one of the annotations in OptionsPanelController. They may also be registered in a layer manually as follows:

   <folder name="OptionsDialog">
       <file name="General.instance">
           <attr name="instanceCreate" methodvalue="org.netbeans.spi.options.OptionsCategory.createCategory"/>
           <attr name="title" bundlevalue="org.netbeans.core.ui.options.general.Bundle#CTL_General_Options_Title"/>
           <attr name="categoryName" bundlevalue="org.netbeans.core.ui.options.general.Bundle#CTL_General_Options"/>
           <attr name="iconBase" stringvalue="org/netbeans/modules/options/resources/generalOptions.png"/>
           <attr name="controller" newvalue="org.netbeans.core.ui.options.general.GeneralOptionsPanelController"/>
           <attr name="keywords" bundlevalue="org.netbeans.core.ui.options.general.Bundle#KW_General"/>
           <attr name="keywordsCategory" stringvalue="General"/>
           <attr name="description" bundlevalue="org.netbeans.core.ui.options.general.Bundle#CTL_General_Options_Description"/>
           <attr name="position" intvalue="100"/>
       </file>
   </folder>
where:
controller should be an instance of OptionsPanelController
title should be a localized string where title of your tab inside OD is stored Currently unused.
categoryName should be a localized string for your tab's category name
iconBase should be relative path to icon wou wish to display inside OD
keywords should be localized keywords list, separated by comma in Bundle, for quickserach purposes
keywordsCategory should be relative path to your panel inside Options dialog
description should be a localized string where your tab description is stored Currently unused.

Or, when registering a category with sub-panels, instead of
            <attr name="controller" newvalue="org.netbeans.core.ui.options.general.GeneralOptionsPanelController"/>
 
there is an option to use
            <attr name="advancedOptionsFolder" stringvalue="OptionsDialog/JavaOptions"/>
 
and supply a folder where instaces of AdvancedOption should be registered. Its instances would be found automatically and shown as sub-panels

Use standard position attributes to sort items registered in layers.

See Also:
AdvancedOption, OptionsPanelController

Constructor Summary
OptionsCategory()
           
 
Method Summary
abstract  OptionsPanelController create()
          Returns new OptionsPanelController for this category.
abstract  String getCategoryName()
          Returns name of category used in list on the top side of Options Dialog.
 Icon getIcon()
          Returns 32x32 icon used in list on the top of Options Dialog.
 String getIconBase()
          Deprecated. This method will not be a part of NB50! Use getIcon() instead.
abstract  String getTitle()
          This text will be used in title component on the top of Options Dialog when your panel will be selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionsCategory

public OptionsCategory()
Method Detail

getIconBase

public String getIconBase()
Deprecated. This method will not be a part of NB50! Use getIcon() instead.

Returns base name of 32x32 icon (gif, png) used in list on the left side of Options Dialog. See AbstractNode.setIconBase(java.lang.String) method for more info.

Returns:
base name of 32x32 icon

getIcon

public Icon getIcon()
Returns 32x32 icon used in list on the top of Options Dialog.

Returns:
32x32 icon

getCategoryName

public abstract String getCategoryName()
Returns name of category used in list on the top side of Options Dialog.

Returns:
name of category

getTitle

public abstract String getTitle()
This text will be used in title component on the top of Options Dialog when your panel will be selected.

Currently unused.

Returns:
title of this panel

create

public abstract OptionsPanelController create()
Returns new OptionsPanelController for this category. PanelController creates visual component to be used inside of the Options Dialog. You should not do any time-consuming operations inside the constructor, because it blocks initialization of OptionsDialog. Initialization should be implemented in update method.

Returns:
new instance of PanelController for this options category

org.netbeans.modules.options.api/1 1.18.1

Built on September 7 2010.  |  Portions Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved.