org.formaria.editor.project.pages.components.properties
Class PlainProperty

java.lang.Object
  extended by org.formaria.editor.project.pages.components.properties.PlainProperty
Direct Known Subclasses:
BuiltinProperty, DataProperty, EventProperty, GridBagLayoutConstraintProperty, GuideLayoutConstraintProperty, ImageProperty, LangProperty, ListProperty, SpringLayoutConstraintProperty, StyleProperty, ValidationProperty

public class PlainProperty
extends java.lang.Object


Field Summary
protected  java.lang.Class argType
           
static int BOOLEAN_PROPERTY
           
static int COMPONENT_NAME_PROPERTY
           
protected  EditorProject currentProject
          The owner project and the context in which this object operates.
static int DATA_PROPERTY
           
static int DOUBLE_PROPERTY
           
static int EVENT_HANDLER_PROPERTY
           
protected  java.lang.reflect.Method getterMethod
           
protected  java.lang.String getterName
           
static int IMAGE_NAME_PROPERTY
           
static int INT_LIST_PROPERTY
           
static int INTEGER_PROPERTY
           
protected  boolean isEnabled
           
static int LANG_PROPERTY
           
static int LAYOUT_CONSTRAINT_PROPERTY
           
static int LAYOUT_PROPERTY
           
static int LIST_PROPERTY
           
static int PLAIN_PROPERTY
           
protected  java.lang.String propertyName
           
protected  java.lang.reflect.Method setterMethod
           
protected  java.lang.String setterName
           
static int STYLE_PROPERTY
           
static int VALIDATION_PROPERTY
           
 
Constructor Summary
PlainProperty(java.lang.String name)
           
PlainProperty(java.lang.String name, int type)
           
PlainProperty(java.lang.String getter, java.lang.String setter)
           
PlainProperty(java.lang.String name, java.lang.String getter, java.lang.String setter)
           
 
Method Summary
 AriaBuilder getBuilder()
          Get the page builder
 javax.swing.table.TableCellEditor getCellEditor(javax.swing.JTable table, java.lang.Object comp, EditorProject currentProject, PropertyHelper propertyHelper, java.lang.String propertyName, int row, int col, java.lang.Object value)
          Get a table cell editor
 java.lang.Object getDisplayPropertyValue(PropertyHelper propertyHelper, PageResource pageResource, java.lang.Object comp, java.lang.String propertyName)
          Get the value of the property displayed by the editor
 boolean getEnabled(java.lang.Object comp)
          Get the enabled state of this property
 java.lang.String getExpression(java.lang.Object comp)
          Get the expression value of this property if one exists
 java.lang.String getExpression(java.lang.Object comp, java.lang.String name)
          Get the expression value of this property if one exists
 boolean getIsCloneable()
          Can this property value be cloned?
 java.lang.Object getOutputPropertyValue(PropertyHelper propertyHelper, PageResource pageResource, java.lang.Object comp, java.lang.String propertyName)
          Get the value of the property written to XML
 java.lang.String getPropertyName()
           
 int getPropertyType()
           
 java.lang.Object getPropertyValue(PropertyHelper propertyHelper, PageResource pageResource, java.lang.Object comp, java.lang.String propertyName)
          Get the value of the property exposed by the component
protected  java.lang.Object getViaReflection(java.lang.String methodName, java.lang.Object comp)
          Get a property using refelction instead of the property helper.
 boolean isDataBindingProperty(java.lang.String propertyName)
          Check if a property is a data binding property
 void setEnabled(java.lang.Object comp, boolean state)
          Set the enabled state of this property
 boolean setExpression(java.lang.Object comp, java.lang.Object expression)
          Set the expression value for this property
 boolean setExpression(java.lang.Object comp, java.lang.String name, java.lang.Object expression)
          Set the expression value for this property
 void setGetterName(java.lang.String getter)
          Set the getter name
 boolean setPropertyValue(PropertyHelper propertyHelper, PageResource pageResource, java.lang.Object comp, java.lang.String propertyName, java.lang.Object value)
          Set the value of the property exposed by the component
 void setSetterName(java.lang.String setter)
          Set the setter name
protected  boolean setViaReflection(java.lang.String methodName, java.lang.Object comp, java.lang.Object value, boolean isBoolean)
          Set a property using reflection instead of the property helper.
 boolean setViaReflection(java.lang.String methodName, java.lang.Object comp, java.lang.Object value, java.lang.Class objectClass)
          Set a property using refelction instead of the property helper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAIN_PROPERTY

public static final int PLAIN_PROPERTY
See Also:
Constant Field Values

STYLE_PROPERTY

public static final int STYLE_PROPERTY
See Also:
Constant Field Values

EVENT_HANDLER_PROPERTY

public static final int EVENT_HANDLER_PROPERTY
See Also:
Constant Field Values

IMAGE_NAME_PROPERTY

public static final int IMAGE_NAME_PROPERTY
See Also:
Constant Field Values

LIST_PROPERTY

public static final int LIST_PROPERTY
See Also:
Constant Field Values

VALIDATION_PROPERTY

public static final int VALIDATION_PROPERTY
See Also:
Constant Field Values

BOOLEAN_PROPERTY

public static final int BOOLEAN_PROPERTY
See Also:
Constant Field Values

DATA_PROPERTY

public static final int DATA_PROPERTY
See Also:
Constant Field Values

INTEGER_PROPERTY

public static final int INTEGER_PROPERTY
See Also:
Constant Field Values

DOUBLE_PROPERTY

public static final int DOUBLE_PROPERTY
See Also:
Constant Field Values

LAYOUT_PROPERTY

public static final int LAYOUT_PROPERTY
See Also:
Constant Field Values

LAYOUT_CONSTRAINT_PROPERTY

public static final int LAYOUT_CONSTRAINT_PROPERTY
See Also:
Constant Field Values

COMPONENT_NAME_PROPERTY

public static final int COMPONENT_NAME_PROPERTY
See Also:
Constant Field Values

INT_LIST_PROPERTY

public static final int INT_LIST_PROPERTY
See Also:
Constant Field Values

LANG_PROPERTY

public static final int LANG_PROPERTY
See Also:
Constant Field Values

getterName

protected java.lang.String getterName

setterName

protected java.lang.String setterName

getterMethod

protected java.lang.reflect.Method getterMethod

setterMethod

protected java.lang.reflect.Method setterMethod

propertyName

protected java.lang.String propertyName

isEnabled

protected boolean isEnabled

argType

protected java.lang.Class argType

currentProject

protected EditorProject currentProject
The owner project and the context in which this object operates.

Constructor Detail

PlainProperty

public PlainProperty(java.lang.String getter,
                     java.lang.String setter)

PlainProperty

public PlainProperty(java.lang.String name,
                     java.lang.String getter,
                     java.lang.String setter)

PlainProperty

public PlainProperty(java.lang.String name)

PlainProperty

public PlainProperty(java.lang.String name,
                     int type)
Method Detail

getBuilder

public AriaBuilder getBuilder()
Get the page builder

Returns:
the builder

setSetterName

public void setSetterName(java.lang.String setter)
Set the setter name

Parameters:
setter - the setter name

setGetterName

public void setGetterName(java.lang.String getter)
Set the getter name

Parameters:
getter - the getter name

getPropertyType

public int getPropertyType()

getPropertyName

public java.lang.String getPropertyName()

getEnabled

public boolean getEnabled(java.lang.Object comp)
Get the enabled state of this property


setEnabled

public void setEnabled(java.lang.Object comp,
                       boolean state)
Set the enabled state of this property


getIsCloneable

public boolean getIsCloneable()
Can this property value be cloned?

Returns:
true if the property can be cloned

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(javax.swing.JTable table,
                                                       java.lang.Object comp,
                                                       EditorProject currentProject,
                                                       PropertyHelper propertyHelper,
                                                       java.lang.String propertyName,
                                                       int row,
                                                       int col,
                                                       java.lang.Object value)
Get a table cell editor

Parameters:
table - the table being edited
comp - the current component
currentProject - the current project
propertyHelper - the owner propertyHelper
propertyName - the property name
row - the current row
col - the current column
propertyName - the property name
the - current value

getOutputPropertyValue

public java.lang.Object getOutputPropertyValue(PropertyHelper propertyHelper,
                                               PageResource pageResource,
                                               java.lang.Object comp,
                                               java.lang.String propertyName)
Get the value of the property written to XML

Parameters:
propertyHelper - the helper that is using this property
pageResource - the page resource to which this component belongs
comp - the component instance
Returns:
the value

getPropertyValue

public java.lang.Object getPropertyValue(PropertyHelper propertyHelper,
                                         PageResource pageResource,
                                         java.lang.Object comp,
                                         java.lang.String propertyName)
Get the value of the property exposed by the component

Parameters:
propertyHelper - the helper that is using this property
pageResource - the page resource to which this component belongs
comp - the component instance
Returns:
the value

getDisplayPropertyValue

public java.lang.Object getDisplayPropertyValue(PropertyHelper propertyHelper,
                                                PageResource pageResource,
                                                java.lang.Object comp,
                                                java.lang.String propertyName)
Get the value of the property displayed by the editor

Parameters:
propertyHelper - the helper that is using this property
pageResource - the page resource to which this component belongs
comp - the component instance
Returns:
the value

setPropertyValue

public boolean setPropertyValue(PropertyHelper propertyHelper,
                                PageResource pageResource,
                                java.lang.Object comp,
                                java.lang.String propertyName,
                                java.lang.Object value)
Set the value of the property exposed by the component

Parameters:
propertyHelper - the helper that is using this property
pageResource - the page resource to which this component belongs
comp - the component instance
propertyName - the name of the property
Returns:
true if the property is set OK

getViaReflection

protected java.lang.Object getViaReflection(java.lang.String methodName,
                                            java.lang.Object comp)
Get a property using refelction instead of the property helper.

Parameters:
methodName - the method name
comp - the component being modified
Returns:
the property value

setViaReflection

protected boolean setViaReflection(java.lang.String methodName,
                                   java.lang.Object comp,
                                   java.lang.Object value,
                                   boolean isBoolean)
Set a property using reflection instead of the property helper.

Parameters:
methodName - the method name
comp - the component being modified
value - the new value
isBoolean - is it a boolean property being modified
Returns:
true if the property is set OK

setViaReflection

public boolean setViaReflection(java.lang.String methodName,
                                java.lang.Object comp,
                                java.lang.Object value,
                                java.lang.Class objectClass)
Set a property using refelction instead of the property helper.

Parameters:
methodName - the method name
comp - the component being modified
value - the new value
objectClass - the class of the argument of the set method being invoked
Returns:
true if the property is set OK

getExpression

public java.lang.String getExpression(java.lang.Object comp)
Get the expression value of this property if one exists

Returns:
the expression or null

getExpression

public java.lang.String getExpression(java.lang.Object comp,
                                      java.lang.String name)
Get the expression value of this property if one exists

Returns:
the expression or null

setExpression

public boolean setExpression(java.lang.Object comp,
                             java.lang.Object expression)
Set the expression value for this property

Parameters:
comp - the component instance
expression - the new expression
Returns:
true if the value is an expression and it is stored, otherwise false is returned

setExpression

public boolean setExpression(java.lang.Object comp,
                             java.lang.String name,
                             java.lang.Object expression)
Set the expression value for this property

Parameters:
comp - the component instance
expression - the new expression
name - the name by which the property is known
Returns:
true if the value is an expression and it is stored, otherwise false is returned

isDataBindingProperty

public boolean isDataBindingProperty(java.lang.String propertyName)
Check if a property is a data binding property

Parameters:
propertyName - the name of the property
Returns:
true if this is a data binding property