de.matthiasmann.twl.textarea
Class StyleAttribute<T>

java.lang.Object
  extended by de.matthiasmann.twl.textarea.StyleAttribute<T>
Type Parameters:
T - the data type for this style attribute

public final class StyleAttribute<T>
extends java.lang.Object


Field Summary
static StyleAttribute<Color> BACKGROUND_COLOR
           
static StyleAttribute<Color> BACKGROUND_COLOR_HOVER
           
static StyleAttribute<java.lang.String> BACKGROUND_IMAGE
           
static StyleAttribute<java.lang.Boolean> BREAKWORD
           
static StyleAttribute<TextAreaModel.Clear> CLEAR
           
static StyleAttribute<Color> COLOR
           
static StyleAttribute<Color> COLOR_HOVER
           
static StyleAttribute<TextAreaModel.Display> DISPLAY
           
static StyleAttribute<TextAreaModel.FloatPosition> FLOAT_POSITION
           
static StyleAttribute<StringList> FONT_FAMILIES
           
static StyleAttribute<java.lang.Boolean> FONT_ITALIC
           
static StyleAttribute<Value> FONT_SIZE
           
static StyleAttribute<java.lang.Integer> FONT_WEIGHT
           
static StyleAttribute<Value> HEIGHT
           
static StyleAttribute<TextAreaModel.HAlignment> HORIZONTAL_ALIGNMENT
           
static StyleAttribute<java.lang.Boolean> INHERIT_HOVER
           
static StyleAttribute<java.lang.String> LIST_STYLE_IMAGE
           
static StyleAttribute<OrderedListType> LIST_STYLE_TYPE
           
static BoxAttribute MARGIN
           
static StyleAttribute<Value> MARGIN_BOTTOM
           
static StyleAttribute<Value> MARGIN_LEFT
           
static StyleAttribute<Value> MARGIN_RIGHT
           
static StyleAttribute<Value> MARGIN_TOP
           
static BoxAttribute PADDING
           
static StyleAttribute<Value> PADDING_BOTTOM
           
static StyleAttribute<Value> PADDING_LEFT
           
static StyleAttribute<Value> PADDING_RIGHT
           
static StyleAttribute<Value> PADDING_TOP
           
static StyleAttribute<java.lang.Boolean> PREFORMATTED
           
static StyleAttribute<java.lang.Integer> TAB_SIZE
           
static StyleAttribute<TextDecoration> TEXT_DECORATION
           
static StyleAttribute<TextDecoration> TEXT_DECORATION_HOVER
           
static StyleAttribute<Value> TEXT_INDENT
           
static StyleAttribute<TextAreaModel.VAlignment> VERTICAL_ALIGNMENT
           
static StyleAttribute<Value> WIDTH
           
 
Method Summary
static StyleAttribute<?> getAttribute(int ordinal)
          Returns the StyleAttribute given it's unique id.
static StyleAttribute<?> getAttribute(java.lang.String name)
          Returns the StyleAttribute given it's name.
 java.lang.Class<T> getDataType()
           
 T getDefaultValue()
           
static int getNumAttributes()
          Returns the number of implemented StyleAttributes.
 boolean isInherited()
          A inherited attribute will be looked up in the parent style if it is not set.
 java.lang.String name()
          Returns the name of this StyleAttribute.
 int ordinal()
          Returns a unique id for this StyleAttribute.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HORIZONTAL_ALIGNMENT

public static final StyleAttribute<TextAreaModel.HAlignment> HORIZONTAL_ALIGNMENT

VERTICAL_ALIGNMENT

public static final StyleAttribute<TextAreaModel.VAlignment> VERTICAL_ALIGNMENT

TEXT_INDENT

public static final StyleAttribute<Value> TEXT_INDENT

TEXT_DECORATION

public static final StyleAttribute<TextDecoration> TEXT_DECORATION

TEXT_DECORATION_HOVER

public static final StyleAttribute<TextDecoration> TEXT_DECORATION_HOVER

FONT_FAMILIES

public static final StyleAttribute<StringList> FONT_FAMILIES

FONT_SIZE

public static final StyleAttribute<Value> FONT_SIZE

FONT_WEIGHT

public static final StyleAttribute<java.lang.Integer> FONT_WEIGHT

FONT_ITALIC

public static final StyleAttribute<java.lang.Boolean> FONT_ITALIC

TAB_SIZE

public static final StyleAttribute<java.lang.Integer> TAB_SIZE

LIST_STYLE_IMAGE

public static final StyleAttribute<java.lang.String> LIST_STYLE_IMAGE

LIST_STYLE_TYPE

public static final StyleAttribute<OrderedListType> LIST_STYLE_TYPE

PREFORMATTED

public static final StyleAttribute<java.lang.Boolean> PREFORMATTED

BREAKWORD

public static final StyleAttribute<java.lang.Boolean> BREAKWORD

COLOR

public static final StyleAttribute<Color> COLOR

COLOR_HOVER

public static final StyleAttribute<Color> COLOR_HOVER

INHERIT_HOVER

public static final StyleAttribute<java.lang.Boolean> INHERIT_HOVER

CLEAR

public static final StyleAttribute<TextAreaModel.Clear> CLEAR

DISPLAY

public static final StyleAttribute<TextAreaModel.Display> DISPLAY

FLOAT_POSITION

public static final StyleAttribute<TextAreaModel.FloatPosition> FLOAT_POSITION

WIDTH

public static final StyleAttribute<Value> WIDTH

HEIGHT

public static final StyleAttribute<Value> HEIGHT

BACKGROUND_IMAGE

public static final StyleAttribute<java.lang.String> BACKGROUND_IMAGE

BACKGROUND_COLOR

public static final StyleAttribute<Color> BACKGROUND_COLOR

BACKGROUND_COLOR_HOVER

public static final StyleAttribute<Color> BACKGROUND_COLOR_HOVER

MARGIN_TOP

public static final StyleAttribute<Value> MARGIN_TOP

MARGIN_LEFT

public static final StyleAttribute<Value> MARGIN_LEFT

MARGIN_RIGHT

public static final StyleAttribute<Value> MARGIN_RIGHT

MARGIN_BOTTOM

public static final StyleAttribute<Value> MARGIN_BOTTOM

PADDING_TOP

public static final StyleAttribute<Value> PADDING_TOP

PADDING_LEFT

public static final StyleAttribute<Value> PADDING_LEFT

PADDING_RIGHT

public static final StyleAttribute<Value> PADDING_RIGHT

PADDING_BOTTOM

public static final StyleAttribute<Value> PADDING_BOTTOM

MARGIN

public static final BoxAttribute MARGIN

PADDING

public static final BoxAttribute PADDING
Method Detail

isInherited

public boolean isInherited()
A inherited attribute will be looked up in the parent style if it is not set.

Returns:
true if this attribute is inherited from the parent.

getDataType

public java.lang.Class<T> getDataType()

getDefaultValue

public T getDefaultValue()

ordinal

public int ordinal()
Returns a unique id for this StyleAttribute. This value is may change when this class is modified and should not be used for persistent storage.

Returns:
a unique id < getNumAttributes
See Also:
getNumAttributes()

name

public java.lang.String name()
Returns the name of this StyleAttribute. This method uses reflection to search for the field name.

Returns:
the name of this StyleAttribute.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNumAttributes

public static int getNumAttributes()
Returns the number of implemented StyleAttributes.

Returns:
the number of implemented StyleAttributes.

getAttribute

public static StyleAttribute<?> getAttribute(int ordinal)
                                      throws java.lang.IndexOutOfBoundsException
Returns the StyleAttribute given it's unique id.

Parameters:
ordinal - the unique id of the desired StyleAttribute.
Returns:
the StyleAttribute given it's unique id.
Throws:
java.lang.IndexOutOfBoundsException - if the given id is invalid.
See Also:
ordinal()

getAttribute

public static StyleAttribute<?> getAttribute(java.lang.String name)
                                      throws java.lang.IllegalArgumentException
Returns the StyleAttribute given it's name.

Parameters:
name - the name of the StyleAttribute.
Returns:
the StyleAttribute
Throws:
java.lang.IllegalArgumentException - if no StyleAttribute with the given name exists.
See Also:
name()