org.formaria.editor.project.pages.components
Class RegisteredComponentPropertyHelper

java.lang.Object
  extended by org.formaria.editor.project.pages.components.PropertyHelper
      extended by org.formaria.editor.project.pages.components.RegisteredComponentPropertyHelper

public class RegisteredComponentPropertyHelper
extends PropertyHelper

A property helper that uses the configuration information of a registered component to setup a helper.

Copyright (c) Formaria Ltd., 2002-2003

$Revision: 1.8 $


Field Summary
protected  EditorComponentAdapter componentAdapter
           
 
Fields inherited from class org.formaria.editor.project.pages.components.PropertyHelper
alignmentOptionIds, alignmentOptions, allowsChildren, builtinProperties, className, componentType, defaultValues, defExt, extensions, fileTypeDesc, horzScrollOptionIds, isSwing, lblAlignmentOptionIds, lblAlignmentOptions, numBuiltinProperties, properties, propertyTypes, restrictsSize, scrollOptions, usesContentFile, vertScrollOptionIds
 
Constructor Summary
RegisteredComponentPropertyHelper(EditorComponentAdapter ca)
           
 
Method Summary
 javax.swing.table.TableCellEditor getCellEditor(javax.swing.JTable table, java.lang.Object comp, EditorProject currentProject, java.lang.String propertyName, int row, int col, java.lang.Object value)
          Get a table cell editor
 java.lang.String getDisplayPropertyValue(PageResource pageResource, java.lang.Object comp, java.lang.String propertyName)
          Get the value of the property displayed by the editor
protected  java.lang.Object getFieldValueViaReflection(java.lang.String fieldName, java.lang.Object comp)
          Get a property using refelction instead of the property helper.
protected  java.lang.String hasPropertyType(java.lang.String name)
          Scan the list of properties checking for a matching property name (ignoring case).
 void resetProperties()
          Add the proerties again, first clearing the list
 boolean setPropertyValue(PageResource pageResource, java.lang.Object comp, java.lang.String propertyName, java.lang.Object value)
          Set the value of the property exposed by the component
 
Methods inherited from class org.formaria.editor.project.pages.components.PropertyHelper
accepts, addPropertyType, allowsChildren, cleanupClassName, getBuilder, getClassName, getComponentType, getDefaultExtension, getDefaultValue, getEnabled, getEventClass, getEventMask, getExpression, getFileDescription, getFileExtensions, getListItems, getNumBuiltinProperties, getNumProperties, getOutputPropertyValue, getProperties, getProperty, getProperty, getPropertyDisplayName, getPropertyName, getPropertyTag, getPropertyType, getPropertyTypeName, getPropertyValue, isLangProperty, isLayoutOwner, isListProperty, isReadOnly, isSwing, restrictsSize, setAllowsChildren, setComponent, setCopiedProperties, setExpression, setFileExtensions, setRestrictsSize, setSwing, setUsesContentFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

componentAdapter

protected EditorComponentAdapter componentAdapter
Constructor Detail

RegisteredComponentPropertyHelper

public RegisteredComponentPropertyHelper(EditorComponentAdapter ca)
Method Detail

resetProperties

public void resetProperties()
Add the proerties again, first clearing the list


hasPropertyType

protected java.lang.String hasPropertyType(java.lang.String name)
Scan the list of properties checking for a matching property name (ignoring case).

Parameters:
returns - the actual property name or null if not found

setPropertyValue

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

Overrides:
setPropertyValue in class PropertyHelper
Parameters:
pageResource - the page resource to which this component belongs
comp - the component instance
propertyName - the component property name
Returns:
the true is all is OK

getDisplayPropertyValue

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

Overrides:
getDisplayPropertyValue in class PropertyHelper
Parameters:
pageResource - the page resource to which this component belongs
comp - the component instance
propertyName - the component property name
Returns:
the value

getCellEditor

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

Overrides:
getCellEditor in class PropertyHelper
Parameters:
table - the table being edite
comp - the current component
currentProject - the current project
propertyName - the property name
row - the current row
col - the current column
the - current value

getFieldValueViaReflection

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

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