org.openmdx.portal.servlet.attribute
Class AttributeValue

java.lang.Object
  extended by org.openmdx.portal.servlet.attribute.AttributeValue
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BinaryValue, BooleanValue, CodeValue, DateValue, NullValue, NumberValue, ObjectReferenceValue, TextValue

public abstract class AttributeValue
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  ApplicationContext application
           
protected  FieldDef fieldDef
           
protected  Object object
           
 
Constructor Summary
AttributeValue(Object object, FieldDef fieldDef, ApplicationContext application)
           
 
Method Summary
static AttributeValue createAttributeValue(String valueClassName, Object object, FieldDef fieldDef, ApplicationContext application)
           
 Autocompleter_1_0 getAutocompleter(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 target)
           
 String getBackColor()
          Returns the background color of the field/value as W3C CSS color, null if not defined.
 String getColor()
          Returns the color of the field/value as W3C CSS color, null if not defined.
 DataBinding_1_0 getDataBinding()
           
abstract  Object getDefaultValue()
           
 FieldDef getFieldDef()
           
 String getIconKey()
          Returns icon key.
protected  String getLabel(Attribute attribute)
           
 String getMultiplicity()
           
 String getName()
           
 Object getObject()
           
 String getString(String feature, boolean shortFormat)
           
 String getStringifiedValue(HtmlPage p, boolean multiLine, boolean forEditing, boolean shortFormat)
          Returns stringified attribute value.
protected  String getStringifiedValueInternal(HtmlPage p, Object v, boolean multiLine, boolean forEditing, boolean shortFormat)
          Prepares a single stringified Value to append.
protected  String getUpperBound(String defaultValue)
           
 Object getValue(boolean shortFormat)
           
protected  Object getValue(String feature, boolean shortFormat)
           
protected  Collection getValues(boolean shortFormat)
           
 boolean isChangeable()
           
 boolean isEnabled()
           
 boolean isOptionalValued()
           
 boolean isSingleValued()
           
 void paint(Attribute attribute, HtmlPage p, String id, String label, org.openmdx.base.accessor.jmi.cci.RefObject_1_0 lookupObject, int nCols, int tabIndex, String gapModifier, String styleModifier, String widthModifier, String rowSpanModifier, String readonlyModifier, String disabledModifier, String lockedModifier, String stringifiedValue, boolean forEditing)
          Paints the attribute to p.
 void refresh()
          refresh attribute value, i.e.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fieldDef

protected final FieldDef fieldDef

object

protected Object object

application

protected ApplicationContext application
Constructor Detail

AttributeValue

public AttributeValue(Object object,
                      FieldDef fieldDef,
                      ApplicationContext application)
Method Detail

createAttributeValue

public static AttributeValue createAttributeValue(String valueClassName,
                                                  Object object,
                                                  FieldDef fieldDef,
                                                  ApplicationContext application)

refresh

public void refresh()
refresh attribute value, i.e. if value is cached the current value must be retieved from object.


getFieldDef

public FieldDef getFieldDef()

isSingleValued

public boolean isSingleValued()

isOptionalValued

public boolean isOptionalValued()

getMultiplicity

public String getMultiplicity()

getObject

public Object getObject()

getName

public String getName()

isChangeable

public boolean isChangeable()

isEnabled

public boolean isEnabled()

getValue

protected Object getValue(String feature,
                          boolean shortFormat)

getValue

public Object getValue(boolean shortFormat)

getValues

protected Collection getValues(boolean shortFormat)

getLabel

protected String getLabel(Attribute attribute)

getDefaultValue

public abstract Object getDefaultValue()

getString

public String getString(String feature,
                        boolean shortFormat)

getStringifiedValue

public String getStringifiedValue(HtmlPage p,
                                  boolean multiLine,
                                  boolean forEditing,
                                  boolean shortFormat)
Returns stringified attribute value.


getStringifiedValueInternal

protected String getStringifiedValueInternal(HtmlPage p,
                                             Object v,
                                             boolean multiLine,
                                             boolean forEditing,
                                             boolean shortFormat)
Prepares a single stringified Value to append.


toString

public String toString()
Overrides:
toString in class Object

getBackColor

public String getBackColor()
Returns the background color of the field/value as W3C CSS color, null if not defined.


getColor

public String getColor()
Returns the color of the field/value as W3C CSS color, null if not defined.


getIconKey

public String getIconKey()
Returns icon key.


getDataBinding

public DataBinding_1_0 getDataBinding()

getAutocompleter

public Autocompleter_1_0 getAutocompleter(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 target)

getUpperBound

protected String getUpperBound(String defaultValue)

paint

public void paint(Attribute attribute,
                  HtmlPage p,
                  String id,
                  String label,
                  org.openmdx.base.accessor.jmi.cci.RefObject_1_0 lookupObject,
                  int nCols,
                  int tabIndex,
                  String gapModifier,
                  String styleModifier,
                  String widthModifier,
                  String rowSpanModifier,
                  String readonlyModifier,
                  String disabledModifier,
                  String lockedModifier,
                  String stringifiedValue,
                  boolean forEditing)
           throws org.openmdx.base.exception.ServiceException
Paints the attribute to p.

Parameters:
attribute - attribute to paint
p - target page
id - optional id for input fields. null if forEditing==false
label - field label. If null attribute.getLabel() is used as default
lookupObject - base where object lookup starts from. null if forEditing==false
nCols - column span
tabIndex - tab index of generated input field. -1 if forEditing==false
gapModifier - gap modifier before attribute-specific code is generated. null if forEditing==true
styleModifier - style tag for generated element. null if forEditing==true
widthModifier - width tag for generated element. null if forEditing==true
rowSpanModifier - row span modifier
readonlyModifier - readonly modifier. null if forEditing==false
disabledModifier - disabled modifier. null if forEditing==false
lockedModifier - modifier to lock field. null if forEditing==false
stringifiedValue - stringified value of field
forEditing - field is paint in edit mode if true
Throws:
org.openmdx.base.exception.ServiceException


This software is published under the BSD license. Copyright © 2006-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.