|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.editor.project.pages.components.PropertyHelper
public abstract class PropertyHelper
A helper class to describe the properties of an individual component
Copyright (c) Formaria Ltd., 2002-2006
$Revision: 1.33 $
| Field Summary | |
|---|---|
protected static int[] |
alignmentOptionIds
|
protected static java.lang.String[] |
alignmentOptions
|
protected boolean |
allowsChildren
|
protected static java.util.ArrayList<java.lang.String> |
builtinProperties
|
protected java.lang.String |
className
|
protected java.lang.String |
componentType
|
protected java.util.Hashtable<java.lang.String,java.lang.String> |
defaultValues
|
protected java.lang.String |
defExt
|
protected java.lang.String[] |
extensions
|
protected java.lang.String |
fileTypeDesc
|
protected static int[] |
horzScrollOptionIds
|
protected boolean |
isSwing
|
protected static int[] |
lblAlignmentOptionIds
|
protected static java.lang.String[] |
lblAlignmentOptions
|
protected int |
numBuiltinProperties
|
protected java.util.ArrayList<java.lang.String> |
properties
|
protected static java.util.Hashtable<java.lang.String,PlainProperty> |
propertyTypes
|
protected boolean |
restrictsSize
|
protected static java.lang.String[] |
scrollOptions
|
protected boolean |
usesContentFile
|
protected static int[] |
vertScrollOptionIds
|
| Constructor Summary | |
|---|---|
PropertyHelper()
|
|
| Method Summary | |
|---|---|
boolean |
accepts(java.lang.String targetClass)
Does this property helper work with the specified class |
boolean |
addPropertyType(java.lang.String name,
PlainProperty type)
Add a property type if it is not already present |
boolean |
allowsChildren()
Check if this component allows children to be added. |
void |
cleanupClassName()
|
AriaBuilder |
getBuilder()
Get the page builder |
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 |
getClassName()
Gets the className of the soure component. |
java.lang.String |
getComponentType()
|
java.lang.String |
getDefaultExtension()
|
java.lang.String |
getDefaultValue(PageResource pageResource,
java.lang.Object comp,
java.lang.String propertyName)
Get the value of the property exposed by the component |
java.lang.String |
getDisplayPropertyValue(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,
java.lang.String propertyName)
Is the property enabled |
java.lang.Class |
getEventClass(java.lang.Object comp,
java.lang.String propertyName)
Get the event class attribute |
long |
getEventMask(java.lang.Object comp,
java.lang.String propertyName)
Get the event mask attribute |
java.lang.String |
getExpression(java.lang.Object comp,
java.lang.String propertyName)
Get the expression value of this property if one exists |
java.lang.String |
getFileDescription()
Get a description of the file extension set to be used for file/image names in the popup chooser |
java.lang.String[] |
getFileExtensions()
Get the file extension set to be used for file/image names in the popup chooser |
java.lang.String[] |
getListItems(java.lang.Object comp,
java.lang.String propertyName)
Get the items to display for a list property |
int |
getNumBuiltinProperties()
Get the number of built-in properties |
int |
getNumProperties(java.lang.Object comp)
Get the number of properties that the component exposes |
java.lang.String |
getOutputPropertyValue(PageResource pageResource,
java.lang.Object comp,
java.lang.String propertyName)
Get the value of the property written to the XML file |
java.util.ArrayList |
getProperties(int propertyType)
Get the names of the proeprties provided for this component of the specified type |
PlainProperty |
getProperty(java.lang.String name)
Get a property of the specified name |
PlainProperty |
getProperty(java.lang.String name,
boolean checkTags)
Get a property of the specified name |
java.lang.String |
getPropertyDisplayName(java.lang.String key)
Get the display name of the property |
java.lang.String |
getPropertyName(int i)
Get the name of the property |
java.lang.String |
getPropertyTag(int i)
Get the XML tag name for the property |
int |
getPropertyType(java.lang.String propertyName)
Get the type of the property |
java.lang.String |
getPropertyTypeName(java.lang.String propertyName)
Get the type name of the property displaying the name (synonym) |
java.lang.String |
getPropertyValue(PageResource pageResource,
java.lang.Object comp,
java.lang.String propertyName)
Get the value of the property exposed by the component |
boolean |
isLangProperty(java.lang.String propertyName)
Is this a lang property |
boolean |
isLayoutOwner()
Is this helper's component oen that supports layouts? |
boolean |
isListProperty(java.lang.String propertyName)
Is this a list property |
boolean |
isReadOnly(java.lang.String propertyName)
Is the property read-only? |
boolean |
isSwing()
Is this a swing component helper? |
boolean |
restrictsSize()
Flag the component as having a restricted size if true is returned |
void |
setAllowsChildren(boolean state)
Set the component allows children flag |
void |
setComponent(java.lang.Object comp)
|
void |
setCopiedProperties(PageResource page,
java.awt.Component srcComp,
java.awt.Component targetComp)
Calls the relevant component helper to set the attributes of a new component when a paste operation has been invoked from the main menu. |
boolean |
setExpression(java.lang.Object comp,
java.lang.String propertyName,
java.lang.Object expression)
Set the expression value for this property |
void |
setFileExtensions(java.lang.String desc,
java.lang.String defaultExt,
java.lang.String[] newExtensions)
Set the array/list of extensions used by the file/image name chooser |
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 |
void |
setRestrictsSize(boolean state)
Set the flag for restricted size |
void |
setSwing(boolean iss)
Sets the flag to indicate if this is a swing component helper? |
void |
setUsesContentFile(boolean ucf)
Sets the flag to indicate if this is component uses a content file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String[] alignmentOptions
protected static final int[] alignmentOptionIds
protected static final java.lang.String[] lblAlignmentOptions
protected static final int[] lblAlignmentOptionIds
protected static final java.lang.String[] scrollOptions
protected static final int[] horzScrollOptionIds
protected static final int[] vertScrollOptionIds
protected static java.util.Hashtable<java.lang.String,PlainProperty> propertyTypes
protected static java.util.ArrayList<java.lang.String> builtinProperties
protected boolean usesContentFile
protected boolean allowsChildren
protected boolean restrictsSize
protected boolean isSwing
protected int numBuiltinProperties
protected java.lang.String className
protected java.lang.String componentType
protected java.lang.String[] extensions
protected java.lang.String fileTypeDesc
protected java.lang.String defExt
protected java.util.ArrayList<java.lang.String> properties
protected java.util.Hashtable<java.lang.String,java.lang.String> defaultValues
| Constructor Detail |
|---|
public PropertyHelper()
| Method Detail |
|---|
public AriaBuilder getBuilder()
public boolean addPropertyType(java.lang.String name,
PlainProperty type)
name - the name of the new propertytype - the property type
public void setComponent(java.lang.Object comp)
public java.lang.String getClassName()
public boolean accepts(java.lang.String targetClass)
targetClass -
public void cleanupClassName()
public java.lang.String getComponentType()
public int getNumProperties(java.lang.Object comp)
public int getNumBuiltinProperties()
public java.lang.String getPropertyName(int i)
i - the property index
public java.lang.String getPropertyDisplayName(java.lang.String key)
key - the property index
public java.lang.String getPropertyTag(int i)
i - the property index
public PlainProperty getProperty(java.lang.String name)
name - the property name
public PlainProperty getProperty(java.lang.String name,
boolean checkTags)
name - the property namecheckTags - true to check if a property tag matches the name and that property is contained in the list of properties.
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)
table - the table being editedcomp - the current componentcurrentProject - the current projectpropertyName - the property namerow - the current rowcol - the current columnthe - current value
public boolean getEnabled(java.lang.Object comp,
java.lang.String propertyName)
propertyName - the property namecomp - the component instance
public int getPropertyType(java.lang.String propertyName)
propertyName - the property name
public java.lang.String getPropertyTypeName(java.lang.String propertyName)
propertyName - the property name
public java.util.ArrayList getProperties(int propertyType)
propertyType - the property type e.g. PlainProperty.DATA_PROPERTY
public java.lang.String getDisplayPropertyValue(PageResource pageResource,
java.lang.Object comp,
java.lang.String propertyName)
pageResource - the page resource to which this component belongscomp - the component instancepropertyName - the component property name
public java.lang.String getPropertyValue(PageResource pageResource,
java.lang.Object comp,
java.lang.String propertyName)
pageResource - the page resource to which this component belongscomp - the component instancepropertyName - the component property namepropertyName - the property name
public java.lang.String getOutputPropertyValue(PageResource pageResource,
java.lang.Object comp,
java.lang.String propertyName)
pageResource - the page resource to which this component belongscomp - the component instancepropertyName - the component property name
public java.lang.String getDefaultValue(PageResource pageResource,
java.lang.Object comp,
java.lang.String propertyName)
pageResource - the page resource to which this component belongscomp - the component instancepropertyName - the component property name
public boolean setPropertyValue(PageResource pageResource,
java.lang.Object comp,
java.lang.String propertyName,
java.lang.Object value)
pageResource - the page resource to which this component belongscomp - the component instancepropertyName - the component property name
public long getEventMask(java.lang.Object comp,
java.lang.String propertyName)
propertyName - the component property name
public java.lang.Class getEventClass(java.lang.Object comp,
java.lang.String propertyName)
propertyName - the component property name
public java.lang.String[] getListItems(java.lang.Object comp,
java.lang.String propertyName)
propertyName - the property name
public boolean allowsChildren()
public void setAllowsChildren(boolean state)
state - true to allow addition of children. By default false is returnedpublic boolean restrictsSize()
public void setRestrictsSize(boolean state)
state - true for restricted sizepublic void setSwing(boolean iss)
iss - true if it is a swing helperpublic void setUsesContentFile(boolean ucf)
ucf - true if it is a swing helperpublic boolean isSwing()
public boolean isListProperty(java.lang.String propertyName)
public boolean isLangProperty(java.lang.String propertyName)
public boolean isLayoutOwner()
public boolean isReadOnly(java.lang.String propertyName)
propertyName - the name of the selected property
public void setCopiedProperties(PageResource page,
java.awt.Component srcComp,
java.awt.Component targetComp)
srcComp - the component which was selected when the copy or cut command
was invokedtargetComp - the new component which will be added to the current pagepublic java.lang.String[] getFileExtensions()
public java.lang.String getFileDescription()
public java.lang.String getDefaultExtension()
public void setFileExtensions(java.lang.String desc,
java.lang.String defaultExt,
java.lang.String[] newExtensions)
desc - the description of the file type.defaultExt - the default file extensionnewExtensions -
public java.lang.String getExpression(java.lang.Object comp,
java.lang.String propertyName)
propertyName - the name of the property
public boolean setExpression(java.lang.Object comp,
java.lang.String propertyName,
java.lang.Object expression)
comp - the component instancepropertyName - the name of the propertyexpression - the new expression
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||