|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent org.openide.explorer.propertysheet.PropertyPanel
A visual component for editing individual properties. It takes an instance of PropertyModel and displays an editor component for it.
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
static int |
PREF_CUSTOM_EDITOR
Constant defining a preference for rendering the value. |
static int |
PREF_INPUT_STATE
Constant defining a preference for rendering the value. |
static int |
PREF_READ_ONLY
Constant defining a preference for rendering the value. |
static int |
PREF_TABLEUI
Constant defining a preference for a borderless UI suitable for use in a table |
static String |
PROP_MODEL
Name of the 'model' property. |
static String |
PROP_PREFERENCES
Name of the 'preferences' property. |
static String |
PROP_PROPERTY_EDITOR
Deprecated. - the property editor is re-fetched from the underlying property object as needed. It is up to the property object to cache or not cache the property editor. This property will no longer be fired. |
static String |
PROP_STATE
Name of property 'state' that describes the state of the embeded PropertyEditor. |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
PropertyPanel()
Creates new PropertyPanel backed by a dummy property |
|
PropertyPanel(Node.Property p)
Create a new property panel for displaying/editing the specified property |
|
PropertyPanel(Node.Property p,
int preferences)
Create a new property panel for the specified property with the specified preferences. |
|
PropertyPanel(Object bean,
String propertyName,
int preferences)
Creates new PropertyPanel with DefaultPropertyModel |
|
PropertyPanel(PropertyModel model,
int preferences)
Creates a new PropertyPanel. |
Method Summary | |
void |
addNotify()
Overridden to install the inner component that will display the property |
protected void |
firePropertyChange(String nm,
Object old,
Object nue)
Overridden to catch changes in those client properties that are relevant to PropertyPanel |
AccessibleContext |
getAccessibleContext()
|
Dimension |
getMinimumSize()
Overridden to return the preferred size |
PropertyModel |
getModel()
Get the property model associated with this property panel. |
int |
getPreferences()
Returns the preferences set for this property panel. |
Dimension |
getPreferredSize()
|
Node.Property |
getProperty()
Fetch the property that this PropertyPanel displays. |
PropertyEditor |
getPropertyEditor()
Deprecated. The property panel does not cache the property editor, and depending on its state, it may not consistently return the same property editor instance on repeated calls. The current implementation will do so for editable states, but there is no guarantee this will remain so in the future. |
Object |
getState()
Getter for the state of the property editor. |
boolean |
isFocusable()
Overridden to return false in cases that the preferences specify a read-only state |
boolean |
isChangeImmediate()
Getter for property changeImmediate. |
protected void |
processFocusEvent(FocusEvent fe)
|
void |
removeNotify()
Overridden to dispose the component that actually displays the property and any state information associated with it |
void |
requestFocus()
Overridden to do nothing in a read only state, since some custom property editors (File chooser) are capable of receiving focus even if they are disabled, effectively making focus disappear |
void |
setBackground(Color c)
|
void |
setEnabled(boolean enabled)
Sets whether or not this component is enabled. |
void |
setForeground(Color c)
|
void |
setChangeImmediate(boolean changeImmediate)
Setter for property changeImmediate. |
void |
setModel(PropertyModel model)
Setter for property model. |
void |
setPreferences(int preferences)
Setter for visual preferences in displaying of the value of the property. |
void |
setProperty(Node.Property p)
Set or change the property this PropertyPanel will display |
String |
toString()
Overridden to provide information from the embedded property renderer if not in custom editor mode |
void |
updateValue()
If the editor is ExPropertyEditor it tries to change the getState property to PropertyEnv.STATE_VALID
state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int PREF_READ_ONLY
public static final int PREF_CUSTOM_EDITOR
public static final int PREF_INPUT_STATE
public static final int PREF_TABLEUI
public static final String PROP_PREFERENCES
public static final String PROP_MODEL
public static final String PROP_PROPERTY_EDITOR
public static final String PROP_STATE
org.openide.explorer.propertysheet.PropertyEnv.getState
,
Constant Field ValuesConstructor Detail |
public PropertyPanel()
public PropertyPanel(Object bean, String propertyName, int preferences)
preferences
- the preferences that affect how this propertypanel
will operatebean
- The instance of beanpropertyName
- The name of the property to be displayedpublic PropertyPanel(PropertyModel model, int preferences)
model
- The model to displayPropertyModel
public PropertyPanel(Node.Property p, int preferences)
p
- preferences
- public PropertyPanel(Node.Property p)
p
- A Property object for this node to representNode.Property
Method Detail |
public void setBackground(Color c)
public void setForeground(Color c)
protected void firePropertyChange(String nm, Object old, Object nue)
public boolean isFocusable()
public void requestFocus()
protected void processFocusEvent(FocusEvent fe)
public void addNotify()
public void removeNotify()
public Dimension getPreferredSize()
public Dimension getMinimumSize()
public int getPreferences()
public void setPreferences(int preferences)
preferences
- PREF_XXXX constantspublic PropertyModel getModel()
public void setModel(PropertyModel model)
model
- New model.public final void setProperty(Node.Property p)
p
- the Propertypublic final Node.Property getProperty()
public final Object getState()
setState
method of the PropertyEnv
environment.
PropertyEnv.STATE_VALID
if the editor is not the ExPropertyEditor
one or other constant from PropertyEnv.STATE_*
that was assigned to PropertyEnv
public void updateValue()
getState
property to PropertyEnv.STATE_VALID
state. This may be vetoed, in such case a warning is presented to the user
and the getState
will still return the original value
(different from STATE_VALID).
Also updates the value if
org.openide.explorer.propertysheet.editors.EnhancedCustomPropertyEditor
is used.
public PropertyEditor getPropertyEditor()
null
if it is not possible
to obtain a property editor.
Note: When not in custom editor mode, PropertyPanel does
not cache the editor supplied by the property. If the PropertyPanel
was initialized from an instance of (deprecated) DefaultPropertyModel,
a different instance of the property editor may be constructed and
returned for each call. Client code must take this into account.
. For cases of initialization via a Node.Property object,
it is up to the supplied Property to cache or not cache the property
editor returned from getPropertyEditor()
as suits its
needs.
null
public void setEnabled(boolean enabled)
enabled
- flag defining the action.public boolean isChangeImmediate()
public void setChangeImmediate(boolean changeImmediate)
changeImmediate
- New value of property changeImmediate.public String toString()
public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |