com.sun.rave.designtime
Interface DesignProperty

All Known Subinterfaces:
FacesDesignProperty

public interface DesignProperty

A DesignProperty represents a single property (setter/getter method pair) on a single instance of a DesignBean at design-time. All manipulation of properties at design-time should be done via this interface. This allows the IDE to both persist the changes as well as reflect them in the design-time session.

IMPLEMENTED BY CREATOR - This interface is implemented by Creator for use by the component (bean) author.

Version:
1.0
Author:
Joe Nuxoll
See Also:
DesignBean.getProperties(), DesignBean.getProperty(String)

Method Summary
 DesignBean getDesignBean()
          Returns the DesignBean that this DesignProperty is associated with
 java.beans.PropertyDescriptor getPropertyDescriptor()
          Returns the PropertyDescriptor associated with this DesignProperty
 java.lang.Object getValue()
          Returns the current value of this DesignProperty.
 java.lang.String getValueSource()
          Returns the source-persistence String value of this property.
 boolean isModified()
          Returns true if this DesignProperty has been modified from the 'default' value.
 boolean setValue(java.lang.Object value)
          Sets the current value of this DesignProperty.
 boolean setValueSource(java.lang.String source)
          Sets the source-persistence String value for this property.
 boolean unset()
          Removes the property setting (if it exists) from the source code, and reverts the property setting back to its original (default) state.
 

Method Detail

getDesignBean


public DesignBean getDesignBean()
Returns the DesignBean that this DesignProperty is associated with

Returns:
the DesignBean that this DesignProperty is associated with

getPropertyDescriptor


public java.beans.PropertyDescriptor getPropertyDescriptor()
Returns the PropertyDescriptor associated with this DesignProperty

Returns:
the PropertyDescriptor associated with this DesignProperty

getValue


public java.lang.Object getValue()
Returns the current value of this DesignProperty. The returned value is the *actual* value that the design-time instance of the DesignBean has set for this property.

Returns:
the current value of this DesignProperty

getValueSource


public java.lang.String getValueSource()
Returns the source-persistence String value of this property. This is the value that the associated PropertyEditor would use to persist the property's current value in source code.

Returns:
the source-persistence String value of this property
See Also:
PropertyEditor.getJavaInitializationString()

isModified


public boolean isModified()
Returns true if this DesignProperty has been modified from the 'default' value. A 'modified' property is one that differs in value (== and .equals()) from a newly constructed instance of the DesignBean.

Returns:
true if this DesignProperty has been modified from the 'default' value, false if not

setValue


public boolean setValue(java.lang.Object value)
Sets the current value of this DesignProperty. This will set the *actual* value of this property on the design-time instance of this DesignBean. The associated PropertyEditor will be used to produce the appropriate Java or markup code to set the property. Calling this method results in the persistence being written, and will cause the backing file buffer to become "dirty".

Parameters:
value - The Object value to set as the currrent value of this property
Returns:
true if the property setting was successful, false if it was not
See Also:
PropertyEditor

setValueSource


public boolean setValueSource(java.lang.String source)
Sets the source-persistence String value for this property. This is the value that will acutally appear in Java source code (or markup), depending on how the property setting is persisted.

Parameters:
source - the source-persistence String value for this property
Returns:
true if the property source setting was successful, false if not

unset


public boolean unset()
Removes the property setting (if it exists) from the source code, and reverts the property setting back to its original (default) state. The original state is determined by reading the property value on a fresh instance of the associated class (that owns this property), and reading the default value of the property.

Returns:
true if the unset operation was successful, false if not