Package org.netbeans.jemmy

Examples of org.netbeans.jemmy.ComponentSearcher


     */
    public static JPopupMenuOperator waitJPopupMenu(final ComponentChooser popupChooser) {
  try {
      WindowOperator wind = new WindowOperator(new WindowWaiter().waitWindow(new ComponentChooser() {
        public boolean checkComponent(Component comp) {
      ComponentSearcher searcher = new ComponentSearcher((Container)comp);
      searcher.setOutput(JemmyProperties.getCurrentOutput().createErrorOutput());
      return(searcher.findComponent(popupChooser) != null);
        }
        public String getDescription() {
      return("Window containing \"" + popupChooser.getDescription() + "\" popup");
        }
    }));
View Full Code Here


     */
    public static JPopupMenuOperator waitJPopupMenu(final String menuItemText) {
  return(waitJPopupMenu(new ComponentChooser() {
    public boolean checkComponent(Component comp) {
        if(comp instanceof JPopupMenu) {
       ComponentSearcher searcher = new ComponentSearcher((Container)comp);
       searcher.setOutput(JemmyProperties.getCurrentOutput().createErrorOutput());
       return(searcher.findComponent(new JMenuItemOperator.
                   JMenuItemByLabelFinder(menuItemText,
                        Operator.getDefaultStringComparator())) !=
              null);
        } else {
      return(false);
View Full Code Here

  public JPopupWindowFinder() {
            this(ComponentSearcher.getTrueChooser("Any JPopupWindow"));
  }
  public boolean checkComponent(Component comp) {
      if(comp.isShowing() && comp instanceof Window) {
    ComponentSearcher cs = new ComponentSearcher((Container)comp);
    cs.setOutput(JemmyProperties.getCurrentOutput().createErrorOutput());
    return(cs.findComponent(ppFinder)
           != null);
      }
      return(false);
  }
View Full Code Here

     * Constructor.
     * @param comp a component
     */
    public JFileChooserOperator(JFileChooser comp) {
  super(comp);
  innerSearcher = new ComponentSearcher(comp);
  setTimeouts(JemmyProperties.getProperties().getTimeouts());
  setOutput(JemmyProperties.getProperties().getOutput());
    }
View Full Code Here

  }
  public boolean checkComponent(Component comp) {
            if(comp != null &&
               comp instanceof Window &&
               ((Window)comp).isVisible()) {
                ComponentSearcher searcher =
                    new ComponentSearcher((Container)comp);
                searcher.setOutput(output);
                return(searcher.findComponent(subChooser) != null);
            } else {
                return(false);
            }
        }
View Full Code Here

                    }
                };
  }
  public boolean checkComponent(Component comp) {
      if(comp.isShowing() && comp instanceof Window) {
    ComponentSearcher cs = new ComponentSearcher((Container)comp);
    cs.setOutput(JemmyProperties.getCurrentOutput().createErrorOutput());
    return(cs.findComponent(ppFinder)
           != null);
      }
      return(false);
  }
View Full Code Here

            menuCont = this;
        }
        JMenuItemOperator result;
        // isVisible() on items returns false on mac, so we need a special searcher.
        if(System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) { // NOI18N
            ComponentSearcher searcher = new ComponentSearcher((Container)menuCont.getSource());
            searcher.setOutput(output);
            Component c = searcher.findComponent(new JMenuItemOperator.JMenuItemByLabelFinder(path[path.length-1], getComparator()));
            result = new JMenuItemOperator((JMenuItem)c);
        } else {
            result = new JMenuItemOperator(menuCont, path[path.length - 1]);
        }
        result.copyEnvironment(this);
View Full Code Here

      }
      public String getDescription() {
    return("");
      }
  };
  ComponentSearcher searcher = new ComponentSearcher((Container)getSource());
  searcher.setOutput(output.createErrorOutput());
  JButton butt0 = (JButton)searcher.findComponent(chooser, 0);
  JButton butt1 = (JButton)searcher.findComponent(chooser, 1);

  if(butt0 == null || butt1 == null) {
      minButtOperator = null;
      maxButtOperator = null;
      return;
View Full Code Here

  ComponentChooser pChooser;
  public PopupWindowChooser(ComponentChooser pChooser) {
      this.pChooser = pChooser;
  }
  public boolean checkComponent(Component comp) {
      ComponentSearcher cs = new ComponentSearcher((Container)comp);
      cs.setOutput(TestOut.getNullOutput());
      return(cs.findComponent(pChooser) != null);
  }
View Full Code Here

    popupWindow = getWindow();
      } else {
    popupWindow = WindowWaiter.getWindow(getWindow(), pChooser);
      }
      if(popupWindow != null) {
    ComponentSearcher sc = new ComponentSearcher(popupWindow);
    sc.setOutput(TestOut.getNullOutput());
    return(sc.findComponent(cChooser));
      } else {
    return(null);
      }
  }
View Full Code Here

TOP

Related Classes of org.netbeans.jemmy.ComponentSearcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.