站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

OptionsPanelController (Options Dialog and SPI) - NetBeans API Javadoc (Current Development Version)

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

org.netbeans.spi.options
Class OptionsPanelController

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

public abstract class OptionsPanelController
extends Object

PanelController creates visual representation of one Options Dialog category, and manages communication between Options Dialog and this panel.


Field Summary
static String PROP_CHANGED
          Property name constant.
static String PROP_HELP_CTX
          Property name constant.
static String PROP_VALID
          Property name constant.
 
Constructor Summary
OptionsPanelController()
           
 
Method Summary
abstract  void addPropertyChangeListener(PropertyChangeListener l)
          Registers new listener.
abstract  void applyChanges()
          This method is called when Options Dialog "OK" button is pressed.
abstract  void cancel()
          This method is called when Options Dialog "Cancel" button is pressed.
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.
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.
abstract  void update()
          Component should load its data here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_VALID

public static final String PROP_VALID
Property name constant.

See Also:
Constant Field Values

PROP_CHANGED

public static final String PROP_CHANGED
Property name constant.

See Also:
Constant Field Values

PROP_HELP_CTX

public static final String PROP_HELP_CTX
Property name constant.

See Also:
Constant Field Values
Constructor Detail

OptionsPanelController

public OptionsPanelController()
Method Detail

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 after getComponent(org.openide.util.Lookup) method. Update method can be called more than one time for the same instance of JComponent obtained from getComponent(org.openide.util.Lookup) call.


applyChanges

public abstract void applyChanges()
This method is called when Options Dialog "OK" button is pressed. This method can be called even before update () method is called.


cancel

public abstract void cancel()
This method is called when Options Dialog "Cancel" button is pressed. This method can be called even before update () method is called.


isValid

public abstract boolean isValid()
Should return true 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 return true if some option value in this category has been changed.

Returns:
true if some option value in this category has been changed

getLookup

public Lookup getLookup()
Each option category can provide some lookup. Options Dialog master lookup is composed from these individual lookups. Master lookup can be obtained from getComponent(org.openide.util.Lookup) call. This lookup is designed to support communication anong individual panels in one Options Dialog.

Returns:
lookup provided by this Options Dialog panel

getComponent

public abstract JComponent getComponent(Lookup masterLookup)
Returns visual component representing this options category. This method is called before update() method.

Parameters:
masterLookup - master lookup composed from lookups provided by individual OptionsPanelControllers - getLookup()
Returns:
visual component representing this options category

getHelpCtx

public abstract HelpCtx getHelpCtx()
Get current help context asociated with this panel.

Returns:
current help context

addPropertyChangeListener

public abstract void addPropertyChangeListener(PropertyChangeListener l)
Registers new listener.

Parameters:
l - a new listener

removePropertyChangeListener

public abstract void removePropertyChangeListener(PropertyChangeListener l)
Unregisters given listener.

Parameters:
l - a listener to be removed

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

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.