|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnextapp.echo.Style
echopoint.stylesheet.SmartStyle
public class SmartStyle
The SmartStyle class is a Style that knows which
style attributes have been accessed when the applyStyle() method
is called and can then use reflection to set any unaccessed style
attributes into a Component.
All contained style attributes are marked as NOT accessed until such time as they are accessed via one of the getter methods. This is most likely done in the Component.applyStyle() method.
Any unaccessed style attributes can then be applied to the Component via bean introspection and reflection. This will look to see that the Component has a setter method of the right name (the style attribute name) and right type (the style attribute value type). If so then a reflection will will be performed to set the style attribute.
| Constructor Summary | |
|---|---|
SmartStyle()
Creates a new SmartStyle object. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getAttribute(java.lang.String key)
Returns the attribute associate with the given key as an object. |
boolean |
getBooleanAttribute(java.lang.String key)
Returns the attribute associated with the given key as a primitive boolean value. |
int |
getIntegerAttribute(java.lang.String key)
Returns the attribute associated with the given key as a primitive integer value. |
java.lang.String |
getStringAttribute(java.lang.String key)
Returns the attribute associated with the given key as a string. |
java.lang.String[] |
getUnAccessedAttributes()
Returns an array of all style attribute names that have not ben accessed. |
void |
setAttribute(java.lang.String key,
boolean value)
Sets an attribute. |
void |
setAttribute(java.lang.String key,
int value)
Sets an attribute. |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Sets an attribute. |
void |
setUnAccessedAttributes(Component c)
Will perform "relection set" on a Component for any attributes that have not be accessed for this style. |
| Methods inherited from class nextapp.echo.Style |
|---|
getAttributesMap, hasAttribute, isImmutable, setImmutable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SmartStyle()
| Method Detail |
|---|
public java.lang.Object getAttribute(java.lang.String key)
Style
getAttribute in class Stylekey - The name of the attribute to return.
Style.getAttribute(java.lang.String)public boolean getBooleanAttribute(java.lang.String key)
StyleBoolean object for
this method to execute successfully.
getBooleanAttribute in class Stylekey - The name of the attribute to return.
Style.getBooleanAttribute(java.lang.String)public int getIntegerAttribute(java.lang.String key)
StyleInteger object for
this method to execute successfully.
getIntegerAttribute in class Stylekey - The name of the attribute to return.
Style.getIntegerAttribute(java.lang.String)public java.lang.String getStringAttribute(java.lang.String key)
StylegetAttribute() with the exception
that it casts the attribute to a String. If the key maps
to an object other than a String, a
ClassCastException will be thrown.
getStringAttribute in class Stylekey - The name of the attribute to return.
Style.getStringAttribute(java.lang.String)
public void setAttribute(java.lang.String key,
boolean value)
StyleBoolean
object.
setAttribute in class Stylekey - The key to be set.value - The new value of the key.Style.setAttribute(java.lang.String, boolean)
public void setAttribute(java.lang.String key,
int value)
StyleInteger
object.
setAttribute in class Stylekey - The key to be set.value - The new value of the key.Style.setAttribute(java.lang.String, int)
public void setAttribute(java.lang.String key,
java.lang.Object value)
Style
setAttribute in class Stylekey - The key to be set.value - The new value of the key.Style.setAttribute(java.lang.String, java.lang.Object)public java.lang.String[] getUnAccessedAttributes()
public void setUnAccessedAttributes(Component c)
Once this call completes, all style attributes that have been succesffuly set will be marked as accessed.
c - - the Component to perform reflection on
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||