|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.matthiasmann.twl.textarea.Style
public class Style
Stores the styles which should be applied to a certain element.
| Constructor Summary | |
|---|---|
|
Style()
Creates an empty Style without a parent, class reference and no attributes |
protected |
Style(Style src)
|
|
Style(Style parent,
StyleSheetKey styleSheetKey)
Creates an Style with the given parent and class reference. |
|
Style(Style parent,
StyleSheetKey styleSheetKey,
java.util.Map<StyleAttribute<?>,java.lang.Object> values)
Creates an Style with the given parent and class reference and copies the given attributes. |
| Method Summary | ||
|---|---|---|
protected void |
ensureValues()
|
|
|
get(StyleAttribute<V> attribute,
StyleSheetResolver resolver)
Retrives the value of the specified attribute from the resolved style. |
|
|
getNoResolve(StyleAttribute<V> attribute,
StyleSheetResolver resolver)
Retrives the value of the specified attribute without resolving the style. |
|
Style |
getParent()
Returns the parent of this Style or null. |
|
|
getRaw(StyleAttribute<V> attribute)
Retrives the value of the specified attribute without resolving the style. |
|
StyleSheetKey |
getStyleSheetKey()
Returns the style sheet key for this Style or null. |
|
protected void |
put(StyleAttribute<?> attribute,
java.lang.Object value)
|
|
protected void |
putAll(java.util.Map<StyleAttribute<?>,java.lang.Object> values)
|
|
protected void |
putAll(Style src)
|
|
protected java.lang.Object |
rawGet(int idx)
|
|
Style |
resolve(StyleAttribute<?> attribute,
StyleSheetResolver resolver)
Resolves the Style in which the specified attribute is defined. |
|
java.util.Map<StyleAttribute<?>,java.lang.Object> |
toMap()
Creates a map which will contain all set attributes of this Style. |
|
Style |
with(java.util.Map<StyleAttribute<?>,java.lang.Object> values)
Creates a copy of this Style and sets the specified attributes. |
|
|
with(StyleAttribute<V> attribute,
V value)
Creates a copy of this Style and sets the specified attributes. |
|
Style |
withoutNonInheritable()
Returns a Style which doesn't contain any value for an attribute where StyleAttribute.isInherited() returns false. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Style()
public Style(Style parent,
StyleSheetKey styleSheetKey)
parent - the parent style. Can be null.styleSheetKey - key for style sheet lookup. Can be null.
public Style(Style parent,
StyleSheetKey styleSheetKey,
java.util.Map<StyleAttribute<?>,java.lang.Object> values)
parent - the parent style. Can be null.styleSheetKey - key for style sheet lookup. Can be null.values - a map with attributes for this Style. Can be null.protected Style(Style src)
| Method Detail |
|---|
public Style resolve(StyleAttribute<?> attribute,
StyleSheetResolver resolver)
attribute - The attribute to lookup.resolver - A StyleSheetResolver to resolve the style sheet key. Can be null.
StyleAttribute.isInherited(),
getParent()
public <V> V getNoResolve(StyleAttribute<V> attribute,
StyleSheetResolver resolver)
V - The data type of the attributeattribute - The attribute to lookup.resolver - A StyleSheetResolver to resolve the style sheet key. Can be null.
public <V> V get(StyleAttribute<V> attribute,
StyleSheetResolver resolver)
V - The data type of the attributeattribute - The attribute to lookup.resolver - A StyleSheetResolver to resolve the style sheet key. Can be null.
resolve(de.matthiasmann.twl.textarea.StyleAttribute, de.matthiasmann.twl.textarea.StyleSheetResolver),
getNoResolve(de.matthiasmann.twl.textarea.StyleAttribute, de.matthiasmann.twl.textarea.StyleSheetResolver)public <V> V getRaw(StyleAttribute<V> attribute)
V - The data type of the attributeattribute - The attribute to lookup.
public Style getParent()
StyleAttribute.isInherited()public StyleSheetKey getStyleSheetKey()
public Style with(java.util.Map<StyleAttribute<?>,java.lang.Object> values)
values - The attributes to set in the new Style.
public <V> Style with(StyleAttribute<V> attribute,
V value)
V - The data type of the attributeattribute - The attribute to set.value - The new value of that attribute. Can be null.
public Style withoutNonInheritable()
StyleAttribute.isInherited() returns false.
protected void put(StyleAttribute<?> attribute,
java.lang.Object value)
protected final void putAll(java.util.Map<StyleAttribute<?>,java.lang.Object> values)
protected final void putAll(Style src)
protected final void ensureValues()
protected final java.lang.Object rawGet(int idx)
public java.util.Map<StyleAttribute<?>,java.lang.Object> toMap()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||