Class OptionsPanelController
java.lang.Object
org.netbeans.spi.options.OptionsPanelController
PanelController creates visual representation of one Options Dialog
category, and manages communication between Options Dialog and this
panel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
Registers a panel with child panels at the top level of the Options dialog.static @interface
Registers keywords for some panel in the Options dialog.static @interface
Similar toOptionsPanelController.Keywords
but permits multiple registrations of one class.static @interface
Registers a subpanel inside a top-level container panel in the Options dialog.static @interface
Registers a simple panel at the top level of the Options dialog. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Registers new listener.abstract void
This method is called off EDT when Options Dialog "OK" or "Apply" button is pressed.abstract void
cancel()
This method is called when Options Dialog "Cancel" button is pressed.static final OptionsPanelController
createAdvanced
(String subpath) Deprecated.abstract JComponent
getComponent
(org.openide.util.Lookup masterLookup) Returns visual component representing this options category.abstract org.openide.util.HelpCtx
Get current help context asociated with this panel.org.openide.util.Lookup
Each option category can provide some lookup.void
handleSuccessfulSearch
(String searchText, List<String> matchedKeywords) Handle successful search in some panel in options window.abstract boolean
Should returntrue
if some option value in this category has been changed.abstract boolean
isValid()
Should returntrue
if some option value in this category is valid.abstract void
Unregisters given listener.protected void
setCurrentSubcategory
(String subpath) Enables to handle selection of current subcategory.final void
setSubcategory
(String subpath) Enables to handle selection of subcategory.abstract void
update()
Component should load its data here.
-
Field Details
-
PROP_VALID
-
PROP_CHANGED
-
PROP_HELP_CTX
-
-
Constructor Details
-
OptionsPanelController
public OptionsPanelController()
-
-
Method Details
-
createAdvanced
Deprecated.UseOptionsPanelController.ContainerRegistration
instead.Creates an advanced tabbed controller, just like Miscellaneous section.- Parameters:
subpath
- path to folder under OptionsDialog folder containing instances of AdvancedOption class. Path is composed from registration names divided by slash. E.g. "MyCategory" for the following registration:<folder name="OptionsDialog"> <file name="MyCategory.instance"> <attr name="instanceClass" stringvalue="org.foo.MyCategory"/> <attr name="position" intvalue="900"/> </file> <folder name="MyCategory"> <file name="SubCategory1.instance"> <attr name="instanceClass" stringvalue="org.foo.Subcategory1"/> </file> <file name="SubCategory2.instance"> <attr name="instanceClass" stringvalue="org.foo.Subcategory2"/> </file> </file> </folder>
- Returns:
- OptionsPanelController a controller wrapping all AdvancedOption instances found in the folder
- Since:
- 1.8
-
update
public abstract void update()Component should load its data here. You should not do any time-consuming operations inside the constructor, because it blocks initialization of OptionsDialog. Initialization should be implemented in update method. This method is called aftergetComponent(org.openide.util.Lookup)
method. Update method can be called more than one time for the same instance of JComponent obtained fromgetComponent(org.openide.util.Lookup)
call. -
applyChanges
public abstract void applyChanges()This method is called off EDT when Options Dialog "OK" or "Apply" button is pressed. -
cancel
public abstract void cancel()This method is called when Options Dialog "Cancel" button is pressed. -
isValid
public abstract boolean isValid()Should returntrue
if some option value in this category is valid.- Returns:
true
if some option value in this category is valid
-
isChanged
public abstract boolean isChanged()Should returntrue
if some option value in this category has been changed.- Returns:
true
if some option value in this category has been changed
-
getLookup
public org.openide.util.Lookup getLookup()Each option category can provide some lookup. Options Dialog master lookup is composed from these individual lookups. Master lookup can be obtained fromgetComponent(org.openide.util.Lookup)
call. This lookup is designed to support communication anong individual panels in one Options Dialog. There is no guarantee that this method will be called from AWT thread.- Returns:
- lookup provided by this Options Dialog panel
-
handleSuccessfulSearch
Handle successful search in some panel in options window. By default no action is performed. Each implementor should make special actions, for example to choose a specific sub-panel, if this is required.Note that if the search is cleared (user presses
Esc
orEnter
with empty text) this method is called withnull
as values for both the parameters, giving the implementors the chance to undo the filtering done is some previous invocation.- Parameters:
searchText
- the text the user has entered in the search box in the options window.matchedKeywords
- the list of matched keywords for a specific panel in the options window.- Since:
- 1.30
-
getComponent
Returns visual component representing this options category. This method is called beforeupdate()
method.- Parameters:
masterLookup
- master lookup composed from lookups provided by individual OptionsPanelControllers -getLookup()
- Returns:
- visual component representing this options category
-
setCurrentSubcategory
Enables to handle selection of current subcategory. It is called fromOptionsDisplayer.open(java.lang.String)
, if some subpath is defined.- Parameters:
subpath
- path of subcategories to be selected. Path is composed from registration names divided by slash.- Since:
- 1.8
- See Also:
-
setSubcategory
Enables to handle selection of subcategory. It is meant to be called from a composite OptionspanelController and delegates tosetCurrentSubcategory(java.lang.String)
.- Parameters:
subpath
- path of subcategory to be selected. Path is composed from registration names divided by slash.- Since:
- 1.38
-
getHelpCtx
public abstract org.openide.util.HelpCtx getHelpCtx()Get current help context asociated with this panel.- Returns:
- current help context
-
addPropertyChangeListener
Registers new listener.- Parameters:
l
- a new listener
-
removePropertyChangeListener
Unregisters given listener.- Parameters:
l
- a listener to be removed
-
OptionsPanelController.ContainerRegistration
instead.