| Issue 144: | Add support for looking up multiple components. | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
E-mail from Simeon Fitch:
I'm looking for a recommendation on how to best use the FEST-Swing API
to get a collection of all components matching a criteria implemented
by a ComponentMatcher. It's very much in a similar vein as the
ComponentPrinter.printComponents(PrintStream, Class<? extends
Component>) method, except that I want the found components placed in
a collection rather than written to the PrintStream.
Here's the approach I'm taking, but it seems like a kludge since it's
using the finder in a way that's doesn't seem intended.
final List<AbstractButton> allButtons = new
LinkedList<AbstractButton>();
ComponentFinder finder = _fixture.robot.finder();
try {
finder.find(new ComponentMatcher() {
public boolean matches(Component c) {
if(c instanceof AbstractButton) {
allButtons.add((AbstractButton) c);
}
return false;
}
});
}
catch (ComponentLookupException ex) {
}
Is there a better way?
|
||||||||||||||||
,
Jun 05, 2008
Added methods 'findAll(ComponentMatcher)' and 'findAll(Container, ComponentMatcher)' to org.fest.swing.core.ComponentFinder to look up all the components that match certain search criteria.
Status: Fixed
|
|||||||||||||||||
,
Nov 30, 2008
Set the module as a label, instead of being part of the title.
Summary: Add support for looking up multiple components.
Labels: Module-fest-swing |
|||||||||||||||||
|
|
|||||||||||||||||