public abstract class OptionsPanelController extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
OptionsPanelController.ContainerRegistration
Registers a panel with child panels at the top level of the Options dialog.
|
static interface |
OptionsPanelController.Keywords
Registers keywords for some panel in the Options dialog.
|
static interface |
OptionsPanelController.KeywordsRegistration
Similar to
OptionsPanelController.Keywords but permits multiple registrations of
one class. |
static interface |
OptionsPanelController.SubRegistration
Registers a subpanel inside a top-level container panel in the Options dialog.
|
static interface |
OptionsPanelController.TopLevelRegistration
Registers a simple panel at the top level of the Options dialog.
|
Modifier and Type | Field and Description |
---|---|
static String |
PROP_CHANGED
Property name constant.
|
static String |
PROP_HELP_CTX
Property name constant.
|
static String |
PROP_VALID
Property name constant.
|
Constructor and Description |
---|
OptionsPanelController() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addPropertyChangeListener(PropertyChangeListener l)
Registers new listener.
|
abstract void |
applyChanges()
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 OptionsPanelController |
createAdvanced(String subpath)
Deprecated.
Use
OptionsPanelController.ContainerRegistration instead. |
abstract JComponent |
getComponent(Lookup masterLookup)
Returns visual component representing this options category.
|
abstract HelpCtx |
getHelpCtx()
Get current help context asociated with this panel.
|
Lookup |
getLookup()
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 |
isChanged()
Should return
true if some option value in this
category has been changed. |
abstract boolean |
isValid()
Should return
true if some option value in this
category is valid. |
abstract void |
removePropertyChangeListener(PropertyChangeListener l)
Unregisters given listener.
|
protected void |
setCurrentSubcategory(String subpath)
Enables to handle selection of current subcategory.
|
void |
setSubcategory(String subpath)
Enables to handle selection of subcategory.
|
abstract void |
update()
Component should load its data here.
|
public static final String PROP_VALID
public static final String PROP_CHANGED
public static final String PROP_HELP_CTX
@Deprecated public static final OptionsPanelController createAdvanced(String subpath)
OptionsPanelController.ContainerRegistration
instead.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>
public abstract void update()
OptionsPanelController.getComponent(org.openide.util.Lookup)
method.
Update method can be called more than one time for the same instance
of JComponent obtained from OptionsPanelController.getComponent(org.openide.util.Lookup)
call.public abstract void applyChanges()
public abstract void cancel()
public abstract boolean isValid()
true
if some option value in this
category is valid.true
if some option value in this
category is validpublic abstract boolean isChanged()
true
if some option value in this
category has been changed.true
if some option value in this
category has been changedpublic Lookup getLookup()
OptionsPanelController.getComponent(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.public void handleSuccessfulSearch(String searchText, List<String> matchedKeywords)
Note that if the search is cleared (user presses Esc
or Enter
with empty text)
this method is called with null
as values for both the parameters, giving the
implementors the chance to undo the filtering done is some previous invocation.
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.public abstract JComponent getComponent(Lookup masterLookup)
OptionsPanelController.update()
method.masterLookup
- master lookup composed from lookups provided by
individual OptionsPanelControllers
- OptionsPanelController.getLookup()
protected void setCurrentSubcategory(String subpath)
OptionsDisplayer.open(java.lang.String)
,
if some subpath is defined.subpath
- path of subcategories to be selected. Path is
composed from registration names divided by slash.OptionsDisplayer
public final void setSubcategory(String subpath)
OptionsPanelController.setCurrentSubcategory(java.lang.String)
.subpath
- path of subcategory to be selected. Path is
composed from registration names divided by slash.public abstract HelpCtx getHelpCtx()
public abstract void addPropertyChangeListener(PropertyChangeListener l)
l
- a new listenerpublic abstract void removePropertyChangeListener(PropertyChangeListener l)
l
- a listener to be removed