01: package abbot.finder.matchers;
02:
03: import abbot.finder.Matcher;
04:
05: import abbot.util.ExtendedComparator;
06:
07: import java.awt.Component;
08:
09: import java.util.ArrayList;
10: import java.util.List;
11:
12: import javax.swing.JMenu;
13: import javax.swing.JMenuItem;
14: import javax.swing.JPopupMenu;
15:
16: /**
17: * Extension of JMenuItemMatcher that only matches JMenu rather than
18: * all JMenuItem
19: *
20: * @author gdavison
21: * @version $Id: JMenuMatcher.java 1419 2005-01-05 18:34:48 +0000 (Wed, 05 Jan 2005) twall $
22: */
23: public class JMenuMatcher extends JMenuItemMatcher {
24:
25: public JMenuMatcher(String label) {
26: super (label);
27: }
28:
29: public boolean matches(Component c) {
30: if (c instanceof JMenu) {
31: return super .matches(c);
32: }
33: return false;
34: }
35:
36: }
|