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

java.lang.Object
  extended by org.formaria.editor.project.pages.components.properties.PlainProperty
      extended by org.formaria.editor.project.pages.components.properties.ListProperty
          extended by org.formaria.editor.project.pages.components.properties.LayoutConstraintProperty
Direct Known Subclasses:
CardConstraintProperty

public class LayoutConstraintProperty
extends ListProperty

A helper class for working with layout manager contraints.

Copyright (c) Formaria Ltd., 2002-2003

License: see license.txt

$Revision: 1.11 $


Field Summary
static java.lang.String[] BorderConstraints
           
protected  LayoutHelper layoutHelper
           
 
Fields inherited from class org.formaria.editor.project.pages.components.properties.ListProperty
getterMethod, ids, options
 
Fields inherited from class org.formaria.editor.project.pages.components.properties.PlainProperty
argType, BOOLEAN_PROPERTY, COMPONENT_NAME_PROPERTY, currentProject, DATA_PROPERTY, DOUBLE_PROPERTY, EVENT_HANDLER_PROPERTY, getterName, IMAGE_NAME_PROPERTY, INT_LIST_PROPERTY, INTEGER_PROPERTY, isEnabled, LANG_PROPERTY, LAYOUT_CONSTRAINT_PROPERTY, LAYOUT_PROPERTY, LIST_PROPERTY, PLAIN_PROPERTY, propertyName, setterMethod, setterName, STYLE_PROPERTY, VALIDATION_PROPERTY
 
Constructor Summary
LayoutConstraintProperty()
          Creates a new instance of LayoutConstraintProperty
 
Method Summary
 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
static java.lang.Object getCurrentConstraint(java.lang.Object comp)
          Gets a constraint object corresponding to a constraint name
 boolean getEnabled(java.lang.Object comp)
          Get the enabled state of this property
 java.lang.String[] getListItems(PropertyHelper helper, java.lang.Object comp)
          Get the items to display for a list property
 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
 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
 
Methods inherited from class org.formaria.editor.project.pages.components.properties.ListProperty
setPropertyValue
 
Methods inherited from class org.formaria.editor.project.pages.components.properties.PlainProperty
getBuilder, getDisplayPropertyValue, getExpression, getExpression, getIsCloneable, getOutputPropertyValue, getPropertyName, getViaReflection, isDataBindingProperty, setEnabled, setExpression, setExpression, setGetterName, setSetterName, setViaReflection, setViaReflection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BorderConstraints

public static final java.lang.String[] BorderConstraints

layoutHelper

protected LayoutHelper layoutHelper
Constructor Detail

LayoutConstraintProperty

public LayoutConstraintProperty()
Creates a new instance of LayoutConstraintProperty

Method Detail

getEnabled

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

Overrides:
getEnabled in class PlainProperty

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

Overrides:
getPropertyValue in class ListProperty
Parameters:
propertyHelper - the helper that is using this property
pageResource - the page resource to which this component belongs
comp - the component instance
propertyName - the property name
Returns:
the value

getCurrentConstraint

public static java.lang.Object getCurrentConstraint(java.lang.Object comp)
Gets a constraint object corresponding to a constraint name

Parameters:
comp - the component whose constraint you want
Returns:
the constraint object

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

Overrides:
getCellEditor in class ListProperty
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
the - current 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

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

getListItems

public java.lang.String[] getListItems(PropertyHelper helper,
                                       java.lang.Object comp)
Get the items to display for a list property

Overrides:
getListItems in class ListProperty
Parameters:
helper - the calling property helper
Returns:
an array of list items

getPropertyType

public int getPropertyType()
Overrides:
getPropertyType in class ListProperty