Package org.netbeans.jemmy

Examples of org.netbeans.jemmy.ComponentChooser


     */
    public void waitSelected(final boolean selected) {
  getOutput().printLine("Wait button to be selected \n    : "+
            toStringSource());
  getOutput().printGolden("Wait button to be selected");
  waitState(new ComponentChooser() {
    public boolean checkComponent(Component comp) {
                    return(getState() == selected);
    }
    public String getDescription() {
        return("Items has been " +
View Full Code Here


     */
    public Window getWindow() {
        if(getSource() instanceof Window) {
            return((Window)getSource());
        }
  Window window = (Window)getContainer(new ComponentChooser() {
                public boolean checkComponent(Component comp) {
                    return(comp instanceof Window);
                }
                public String getDescription() {
                    return("");
View Full Code Here

     * Waits for the component to be visible or unvisible.
     * @param visibility required visiblity.
     * @throws TimeoutExpiredException
     */
    public void waitComponentVisible(final boolean visibility) {
  waitState(new ComponentChooser() {
                public boolean checkComponent(Component comp) {
                    return(isVisible() == visibility);
                }
                public String getDescription() {
                    return("Component is " + (visibility ? "" : " not ") + "visible");
View Full Code Here

                }
            });
    }

    public void waitComponentShowing(final boolean visibility) {
  waitState(new ComponentChooser() {
                public boolean checkComponent(Component comp) {
                    return(isShowing() == visibility);
                }
                public String getDescription() {
                    return("Component is " + (visibility ? "" : " not ") + "showing");
View Full Code Here

     */
    public void waitSelected(final boolean selected) {
  getOutput().printLine("Wait button to be selected \n    : "+
            toStringSource());
  getOutput().printGolden("Wait button to be selected");
  waitState(new ComponentChooser() {
    public boolean checkComponent(Component comp) {
                    return(isSelected() == selected);
    }
    public String getDescription() {
        return("Items has been " +
View Full Code Here

     * @param popupChooser a component chooser specifying criteria for JPopupMenu.
     * @return a JPopupMenu fitting the criteria.
     */
    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);
        }
View Full Code Here

     * Waits popup containing menu item with <code>menuItemText</code> text.
     * @param menuItemText a text of a menu item which supposed to be displayed inside the popup.
     * @return a JPopupMenu fitting the criteria.
     */
    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.
View Full Code Here

            qt.waitEmpty(10);
        }
        //end of 1.5 workaround
        oper.clickForPopup(x, y, mouseButton);
        oper.getTimeouts().sleep("JMenuOperator.WaitBeforePopupTimeout");
  return(waitJPopupMenu(waitJPopupWindow(new ComponentChooser() {
                public boolean checkComponent(Component cmp) {
                    Component invoker = ((JPopupMenu)cmp).getInvoker();
                    return(invoker == oper.getSource() ||
                           (invoker instanceof Container &&
                            ((Container)invoker).isAncestorOf(oper.getSource())) ||
View Full Code Here

         * Constructs JPopupWindowFinder.
         * @param sf searching criteria for a JPopupMenu inside the window..
         */
  public JPopupWindowFinder(ComponentChooser sf) {
      subFinder = new JPopupMenuFinder(sf);
            ppFinder = new ComponentChooser() {
                    public boolean checkComponent(Component comp) {
                        return(comp.isShowing() &&
                               comp.isVisible() &&
                               subFinder.checkComponent(comp));
                    }
View Full Code Here

  getOutput().printLine("Wait " + Integer.toString(index) +
            "'th item to be selected in component \n    : "+
            toStringSource());
  getOutput().printGolden("Wait " + Integer.toString(index) +
        "'th item to be selected");
  waitState(new ComponentChooser() {
    public boolean checkComponent(Component comp) {
        return(getSelectedIndex() == index);
    }
    public String getDescription() {
        return("Has " + Integer.toString(index) + "'th item selected");
View Full Code Here

TOP

Related Classes of org.netbeans.jemmy.ComponentChooser

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.