|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object echopoint.util.ComponentKit
A utility to class to help with Component manipulation
Nested Class Summary | |
static interface |
ComponentKit.ComponentTraversalCallBack
ComponentOperationCallBack is an interface
used during the traverseComponent() method. |
Method Summary | |
static nextapp.echo.Component[] |
getComponentPath(nextapp.echo.Component parent,
nextapp.echo.Component child)
This method will return an array of Components that indicates the path from parent to child. |
static nextapp.echo.Component |
getComponentRoot(nextapp.echo.Component child)
Returns the highest Component parent starting from child. |
static java.lang.Object |
getIdentifier(nextapp.echo.Component component,
java.lang.String attrName)
|
static boolean |
remove(nextapp.echo.Component parent,
nextapp.echo.Component child)
This method will remove a child component from anywhere in the component hierarchy from parent downwards. |
static void |
setEnabled(nextapp.echo.Component component,
boolean enabled)
This method makes the component, and all its children, enabled or disabled. |
static void |
setIdentifier(nextapp.echo.Component component,
java.lang.String attrName,
java.lang.Object attrValue)
|
static boolean |
setProperty(nextapp.echo.Component component,
java.lang.String propertyName,
java.lang.Object propertyValue)
This method will use reflection to set a property on a given component, and all of its children. |
static boolean |
setProperty(nextapp.echo.Component component,
java.lang.String propertyName,
java.lang.Object propertyValue,
java.lang.Class filterClass)
This method will use reflection to set a property on a given component, and all of its children. |
static void |
setVisible(nextapp.echo.Component component,
boolean visible)
This method makes the component, and all its children, visible or invisible. |
static void |
traverseComponent(nextapp.echo.Component startComponent,
ComponentKit.ComponentTraversalCallBack traverseCallBack)
This method will traverse the current component and all its children, in a depth first manner, and call the ComponentTraversalCallBack object for each component found. |
static void |
traverseInstance(nextapp.echo.EchoInstance instance,
ComponentKit.ComponentTraversalCallBack traverseCallBack)
This method will traverse the EchoInstance and all its child components, in a depth first manner, and call the ComponentTraversalCallBack object for each component found. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean remove(nextapp.echo.Component parent, nextapp.echo.Component child)
parent
- - an ancestor of childchild
- - the component to remove
public static nextapp.echo.Component[] getComponentPath(nextapp.echo.Component parent, nextapp.echo.Component child)
parent
- the parent component to be searchedchild
- - the child component to find.
public static nextapp.echo.Component getComponentRoot(nextapp.echo.Component child)
child
- - the component to start searching at
public static void setVisible(nextapp.echo.Component component, boolean visible)
component
- - the component inquestionvisible
- - true to make all components visible or
false to make them invisiblepublic static void setEnabled(nextapp.echo.Component component, boolean enabled)
component
- - the component inquestionenabled
- - true to make all components enabled or
false to make them disabledpublic static void setIdentifier(nextapp.echo.Component component, java.lang.String attrName, java.lang.Object attrValue)
IdKit.setAttribute(Component, String, Object)
public static java.lang.Object getIdentifier(nextapp.echo.Component component, java.lang.String attrName)
IdKit.getAttribute(Component, String)
public static void traverseComponent(nextapp.echo.Component startComponent, ComponentKit.ComponentTraversalCallBack traverseCallBack)
startComponent
- - the component to start at.traverseCallBack
- - the ComponentTraversalCallBack to call when a component is foundpublic static void traverseInstance(nextapp.echo.EchoInstance instance, ComponentKit.ComponentTraversalCallBack traverseCallBack)
instance
- - the EchoInstance to traverse.traverseCallBack
- - the ComponentTraversalCallBack to call when a component is foundpublic static boolean setProperty(nextapp.echo.Component component, java.lang.String propertyName, java.lang.Object propertyValue)
ComponentKit.setProperty(myComponent, "font", new Font(Font.VERDANA,Font.BOLD,8));
This method uses JavaBean rules for setting properties, that is it will look for a method called setXxx that takes one parameter, where Xxx is the setter method of the property to be set. Failing that it will look for setXXX and finally just XXX.
This method guarantees not to throw any exceptions, but rather return false if it cannot set the properties on an eligble object.
component
- - the component in questionpropertyName
- - then name of the property to setpropertyValue
- - the new value
public static boolean setProperty(nextapp.echo.Component component, java.lang.String propertyName, java.lang.Object propertyValue, java.lang.Class filterClass)
ComponentKit.setProperty(myComponent, "font", new Font(Font.VERDANA,Font.BOLD,8), RadionButton.class);
This method uses JavaBean rules for setting properties, that is it will look for a method called setXxx that takes one parameter, where Xxx is the setter method of the property to be set. Failing that it will look for setXXX and finally just XXX.
If a non null filterClass
is provided then it will only set properties on components
that are assignable from the filterClass. If the filterClass is null, then all
components will be matched.
This method guarantees not to throw any exceptions, but rather return false if it cannot set the properties on an eligble object.
component
- - the component in questionpropertyName
- - then name of the property to setpropertyValue
- - the new valuefilterClass
- - only sets components derived from the filter class or matches
all components if its null.
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |