com.sun.rave.designtime.markup
Interface AttributePropertyEditor

All Superinterfaces:
java.beans.PropertyEditor

public interface AttributePropertyEditor
extends java.beans.PropertyEditor

The AttributePropertyEditor interface extends the PropertyEditor interface (a special type of property editor for markup attributes) to add the ability to persist and resolve complex types in markup. Normally, JavaBeans properties are persisted using the PropertyEditor method: "getJavaInitializationString()", which must return a valid Java expression as a String. When an IDE rebuilds the state of a saved file, a Java compiler is used to interpret the property settings.

In markup attributes, a Java expression is not typically what is used to store a setting - and thus a Java compiler cannot be used to interpret the expressions stored in markup. This interface is designed to replace the "getJavaInitializationString()" and compiler interpretation steps in property persistence.

IMPLEMENTED BY THE COMPONENT AUTHOR - This interface is designed to be implemented by the component (bean) author.

Version:
1.0
Author:
Joe Nuxoll

Method Summary
 java.lang.String getMarkupInitializationString()
          This method is intended for use when generating markup to set the value of a property.
 java.lang.Object resolveMarkupInitializationString(java.lang.String initString)
          This method is called while "resurrecting" the state of a DesignBean from markup.
 
Methods inherited from interface java.beans.PropertyEditor
addPropertyChangeListener, getAsText, getCustomEditor, getJavaInitializationString, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setAsText, setValue, supportsCustomEditor
 

Method Detail

getMarkupInitializationString


public java.lang.String getMarkupInitializationString()

This method is intended for use when generating markup to set the value of a property. It should return a fragment of markup that can be used to initialize a variable with the current property value. It is not necessary to include the quote marks, as any attribute string will be automatically enclosed in quotes. If quotes are included, they will not double-up.

Example results are "2", "#FF00FF", "#{WebPage1.button1}", etc.

Returns:
A fragment of markup representing an initializer for the current value of this PropertyEditor. This will be enclosed in quote marks in the markup.

resolveMarkupInitializationString


public java.lang.Object resolveMarkupInitializationString(java.lang.String initString)
This method is called while "resurrecting" the state of a DesignBean from markup. The string stored as the attribute value will be passed in (initString), and an instance of the appropriate type for the property setting is expected to be returned.

Parameters:
initString - The String stored as the attribute value
Returns:
The appropriately typed instance representing the property setting.