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

PropertyEnv (NetBeans APIs) - NetBeans API Javadoc 4.1.0


org.openide.explorer.propertysheet
Class PropertyEnv

java.lang.Object
  extended byorg.openide.explorer.propertysheet.PropertyEnv

public class PropertyEnv
extends Object

PropertyEnv is a class which allows an object (such as a Node.Property instance) to communicate hints to property editor instances that affect the behavior or visual rendering of the property in a PropertySheet or PropertyPanel component. An instance of PropertyEnv is passed to the attachEnv() method of property editors implementing ExPropertyEditor. Such property editors may then call env.getFeatureDescriptor().get("someHintString") to retrieve hints that affect their behavior from the Node.Property object whose properties they are displaying.

Note: client code should treat this class as final; it should never be necessary to create instances of this class outside the propertysheet package or to subclass it.


Field Summary
static String PROP_STATE
          Name of the state property.
static Object STATE_INVALID
          One possible value for the setState/getState methods.
static Object STATE_NEEDS_VALIDATION
          One possible value for the setState/getState methods.
static Object STATE_VALID
          One possible value for the setState/getState methods.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Property change listener: listenning here you will be notified when the state of the environment is has been changed.
 void addVetoableChangeListener(VetoableChangeListener l)
          Vetoable change listener: listenning here you will be notified when the state of the environment is being changed (when the setState method is being called).
 Object[] getBeans()
          Array of beans that the edited property belongs to.
 FeatureDescriptor getFeatureDescriptor()
          Feature descritor that describes the property.
 Object getState()
          A getter for the current state of the environment.
 void registerInplaceEditorFactory(InplaceEditor.Factory factory)
          Register a factory for InplaceEditor instances that the property sheet should use as an inline editor for the property.
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes Property change listener.
 void removeVetoableChangeListener(VetoableChangeListener l)
          Vetoable change listener removal.
 void setState(Object newState)
          A setter that should be used by the property editor to change the state of the environment.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_STATE

public static final String PROP_STATE
Name of the state property.

See Also:
Constant Field Values

STATE_VALID

public static final Object STATE_VALID
One possible value for the setState/getState methods. With this value the editor is in a valid state.


STATE_NEEDS_VALIDATION

public static final Object STATE_NEEDS_VALIDATION
One possible value for the setState/getState methods. This one means that the editor does not know its state and it has to validate it later.


STATE_INVALID

public static final Object STATE_INVALID
One possible value for the setState/getState methods. With this one the editor is in invalid state (Ok button on custom editor panel is disabled and an invalid glyph shown on the property panel).

Method Detail

getBeans

public Object[] getBeans()
Array of beans that the edited property belongs to.


getFeatureDescriptor

public FeatureDescriptor getFeatureDescriptor()
Feature descritor that describes the property. It is feature descriptor so one can plug in PropertyDescritor and also Node.Property which both inherit from FeatureDescriptor


setState

public void setState(Object newState)
A setter that should be used by the property editor to change the state of the environment. Even the state property is bound, changes made from the editor itself are allowed without restrictions.


getState

public Object getState()
A getter for the current state of the environment.

Returns:
one of the constants STATE_VALID, STATE_INVALID, STATE_NEEDS_VALIDATION.

addVetoableChangeListener

public void addVetoableChangeListener(VetoableChangeListener l)
Vetoable change listener: listenning here you will be notified when the state of the environment is being changed (when the setState method is being called). You can veto the change and provide a displayable information in the thrown exception. Use the ErrorManager annotaion feature for the your exception to modify the message and severity.


addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Property change listener: listenning here you will be notified when the state of the environment is has been changed.

Since:
2.20

removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener l)
Vetoable change listener removal.


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Removes Property change listener.

Since:
2.20

registerInplaceEditorFactory

public void registerInplaceEditorFactory(InplaceEditor.Factory factory)
Register a factory for InplaceEditor instances that the property sheet should use as an inline editor for the property. This allows modules to supply custom inline editors globally for a type. It can be overridden on a property-by-property basis for properties that supply a hint for an inplace editor using getValue(String).

See Also:
Node.Property, InplaceEditor

toString

public String toString()


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