public static interface JideSwingUtilities.GetHandler
if ( condition() ) {
return action();
}
.
Here is an example to get the first child of the specified type.
public static Component getFirstChildOf(final Class clazz, Component c) {
return getRecursively(c, new GetHandler() {
public boolean condition(Component c) {
return clazz.isAssignableFrom(c.getClass());
}
public Component action(Component c) {
return c;
}
});
}
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
action(java.awt.Component c)
The action you want to perform on this component.
|
boolean |
condition(java.awt.Component c)
If true, it will call
action(java.awt.Component) on this component. |
boolean condition(java.awt.Component c)
action(java.awt.Component)
on this component.c
- the componentjava.awt.Component action(java.awt.Component c)
condition(java.awt.Component)
returns true.c
- the componentJideSwingUtilities.getRecursively(java.awt.Component,com.jidesoft.swing.JideSwingUtilities.GetHandler)
.