Skip to content

Attribute Value Handling

pm4j edited this page Feb 5, 2012 · 8 revisions

.

External interface declared in PmAttr

Value access

Type safe value access

Methods: T getValue() and void setValue(T value)

Access values as strings

Methods: String getValueAsString() and void setValueAsString(String text)
The string representation is often used to for view controls that support only string values.

Get a localized value

String getValueLocalized()
A localized (human readable) value string output is sometimes useful. PmAttrBoolean and PmAttrEnum<T_ENUM> provide implementations that localize the current value. All other attribute classes just provide the same string as provided by getValueAsString().
See the wiki page Localizaton for more information.

Reset values to default values

PmDataInput: void resetPmValues()
Resets all editable attribute values of the PM subtree to the value provided by PmAttrBase.getDefaultValue().

Type specific attribute subclasses:

For basic types PmAttrBoolean PmAttrDouble PmAttrEnum PmAttrInteger PmAttrList PmAttrLong PmAttrString PmAttrDate

For user defined types PmAttrImpl

Attributes that convert the backing item value type to an external PM type: PmAttrPmList PmAttrPmRef

Wiki pages for related aspects:

Implementation interface

Declaration of a simple attribute

PmAttrString s = new P

Clone this wiki locally