|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| JWindowFinder.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 |
package junit.extensions.jfcunit.finder;
|
|
| 2 |
|
|
| 3 |
import java.awt.Component;
|
|
| 4 |
|
|
| 5 |
import javax.swing.JWindow;
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
/**
|
|
| 9 |
* Class for checking if the component being searched for has been found
|
|
| 10 |
* The pattern syntax can be found at the Jakarta RegExp API Documentation in {@link org.apache.regexp.RE}.
|
|
| 11 |
*
|
|
| 12 |
* @author <a href="mailto:vraravam@thoughtworks.com">Vijay Aravamudhan : ThoughtWorks Inc.</a>
|
|
| 13 |
*/
|
|
| 14 |
public class JWindowFinder extends AbstractWindowFinder { |
|
| 15 |
/**
|
|
| 16 |
* Constructor accepting all arguments needed to filter component.
|
|
| 17 |
* Since a JWindow does not have any attribute that can be used for filtering,
|
|
| 18 |
* the "default" constructor inherited from AbstractWindowFinder is "hidden".
|
|
| 19 |
*/
|
|
| 20 | 2 |
public JWindowFinder() {
|
| 21 | 2 |
super(null, true); |
| 22 |
} |
|
| 23 |
|
|
| 24 |
/**
|
|
| 25 |
* Method that returns true if the given component matches the search
|
|
| 26 |
* criteria.
|
|
| 27 |
*
|
|
| 28 |
* @param comp The component to test
|
|
| 29 |
* @return true if this component is a match
|
|
| 30 |
*/
|
|
| 31 | 2 |
public boolean testComponent(final Component comp) { |
| 32 | 2 |
return ((comp != null) && isValidForProcessing(comp, JWindow.class)); |
| 33 |
} |
|
| 34 |
} |
|
| 35 |
|
|
||||||||||