EchoPoint
1.0

echopoint.stylesheet
Class SmartStyle

java.lang.Object
  extended bynextapp.echo.Style
      extended byechopoint.stylesheet.SmartStyle
All Implemented Interfaces:
java.io.Serializable

public class SmartStyle
extends nextapp.echo.Style

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.

See Also:
Serialized Form

Constructor Summary
SmartStyle()
          Creates a new SmartStyle object.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String key)
           
 boolean getBooleanAttribute(java.lang.String key)
           
 int getIntegerAttribute(java.lang.String key)
           
 java.lang.String getStringAttribute(java.lang.String key)
           
 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)
           
 void setAttribute(java.lang.String key, int value)
           
 void setAttribute(java.lang.String key, java.lang.Object value)
           
 void setUnAccessedAttributes(nextapp.echo.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
hasAttribute, isImmutable, setImmutable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartStyle

public SmartStyle()
Creates a new SmartStyle object.

Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
See Also:
Style.getAttribute(java.lang.String)

getBooleanAttribute

public boolean getBooleanAttribute(java.lang.String key)
See Also:
Style.getBooleanAttribute(java.lang.String)

getIntegerAttribute

public int getIntegerAttribute(java.lang.String key)
See Also:
Style.getIntegerAttribute(java.lang.String)

getStringAttribute

public java.lang.String getStringAttribute(java.lang.String key)
See Also:
Style.getStringAttribute(java.lang.String)

setAttribute

public void setAttribute(java.lang.String key,
                         boolean value)
See Also:
Style.setAttribute(java.lang.String, boolean)

setAttribute

public void setAttribute(java.lang.String key,
                         int value)
See Also:
Style.setAttribute(java.lang.String, int)

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
See Also:
Style.setAttribute(java.lang.String, java.lang.Object)

getUnAccessedAttributes

public java.lang.String[] getUnAccessedAttributes()
Returns an array of all style attribute names that have not ben accessed.

Returns:
String[] - an array of style attribute names.

setUnAccessedAttributes

public void setUnAccessedAttributes(nextapp.echo.Component c)
Will perform "relection set" on a Component for any attributes that have not be accessed for this style. This is designed to be called after the Component.applyStyle() method has been called.

Once this call completes, all style attributes that have been succesffuly set will be marked as accessed.

Parameters:
c - - the Component to perform reflection on

EchoPoint
1.0