My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 144: Add support for looking up multiple components.
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  Alex.Ruiz.05
Closed:  Jun 2008
Type-Enhancement
Priority-High
OpSys-All
Milestone-Release1.0
Module-fest-swing


Sign in to add a comment
 
Reported by Alex.Ruiz.05, Jun 05, 2008
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?
Comment 1 by Alex.Ruiz.05, 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
Comment 2 by Alex.Ruiz.05, 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
Sign in to add a comment

Hosted by Google Code