to.etc.domui.component.meta
Annotation Type MetaDisplayProperty


@Documented
@Retention(value=RUNTIME)
public @interface MetaDisplayProperty

Used to define a property to show in a table, used to define the names and to override display properties for a single table.

Author:
Frits Jalvingh Created on Jul 13, 2008

Required Element Summary
 java.lang.String name
          The name of the property to show.
 
Optional Element Summary
 java.lang.Class<? extends IConverter<?>> converterClass
          Define a Converter class to use to convert the value from the property to a string.
 java.lang.String defaultLabel
          When set this overrides the default label as set by the property metadata.
 SortableType defaultSortable
          When set, this defines this field as being a field that a table can show a "sort button" on.
 int displayLength
          An indication of the display length to use for this field, in characters.
 java.lang.String join
          When present, this will force a join of this property and the next one specified in the display property list, and the string specified here will be used as a "separator" between the two values.
 

Element Detail

name

public abstract java.lang.String name
The name of the property to show. You can also specify a dotted path to some parent entity's property here. This will be replaced with a Property reference once the JDK 7 team gets off it's ass and starts to bloody define something useful 8-(

Returns:

defaultLabel

public abstract java.lang.String defaultLabel
When set this overrides the default label as set by the property metadata. It must be set to a key in the current class's resource file. This is usually set when displaying a property from a parent relation property (using a dotted path) to override the label as defined on the parent relation's property.

Returns:
Default:
"$*$"

defaultSortable

public abstract SortableType defaultSortable
When set, this defines this field as being a field that a table can show a "sort button" on. The first time the sort button is pressed it sorts either ascending or descending, depending on this property's value. Setting this only defines the property as "sortable"; it does not define the "initial sort" for a table. You need to do that using MetaObject.defaultSortColumn(). The "default" in this name refers to the default order (ascending or descending).

Returns:
Default:
to.etc.domui.component.meta.SortableType.UNKNOWN

displayLength

public abstract int displayLength
An indication of the display length to use for this field, in characters. When present it will influence the percentage widths used in the table. The default value is -1. In this case the real "length" of the property, as defined in MetaProperty.length() or any JPA Annotation like Column#length().

Returns:
Default:
-1

converterClass

public abstract java.lang.Class<? extends IConverter<?>> converterClass
Define a Converter class to use to convert the value from the property to a string. When unset the code defaults to the conversion specified on the property itself, either by an explicit MetaProperty.converterClass() setting or by the default conversions registered with the conversion factory.

Returns:
Default:
to.etc.domui.converter.DummyConverter.class

join

public abstract java.lang.String join

When present, this will force a join of this property and the next one specified in the display property list, and the string specified here will be used as a "separator" between the two values. The join means that the two (or more) properties are joined together in a single table column, as a single string. A typical use case for instance is to create a single visible table column for something like Address, where the address is displayed as:

Returns:
Default:
"$*$"