Package org.netbeans.jemmy

Examples of org.netbeans.jemmy.ComponentChooser


  getOutput().printLine("Wait items to be " +
            (selected ? "" : "un") + "selected in component \n    : "+
            toStringSource());
  getOutput().printGolden("Wait items to be " +
        (selected ? "" : "un") + "selected");
  waitState(new ComponentChooser() {
    public boolean checkComponent(Component comp) {
                    int[] indices = getSelectedIndices();
                    for(int i = 0; i < indices.length; i++) {
                        if(indices[i] != itemIndices[i]) {
                            return(false);
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

     * @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

     * Returns cancel button.
     * @return a cancel button.
     */
    public JButton getCancelButton() {
  return((JButton)innerSearcher.
         findComponent(new ComponentChooser() {
           public boolean checkComponent(Component comp) {
         return(comp != null &&
                                  comp instanceof JButton &&
                                  comp.getParent() != null &&
          !(comp.getParent() instanceof JComboBox) &&
View Full Code Here

     * Returns field which can be used to type path.
     * @return a text field being used for path typing.
     */
    public JTextField getPathField() {
  return((JTextField)innerSearcher.
         findComponent(new ComponentChooser() {
           public boolean checkComponent(Component comp) {
         return(comp != null &&
                                  comp instanceof JTextField);
           }
           public String getDescription() {
View Full Code Here

     * Returns file list.
     * @return a list being used to display directory content.
     */
    public JList getFileList() {
  return((JList)innerSearcher.
         findComponent(new ComponentChooser() {
           public boolean checkComponent(Component comp) {
         return(comp != null &&
                                  comp instanceof JList);
           }
           public String getDescription() {
View Full Code Here

    /**
     * Waits for the file list to have required number of items.
     * @param count Number of files to wait.
     */
    public void waitFileCount(final int count) {
  waitState(new ComponentChooser() {
    public boolean checkComponent(Component comp) {
        return(getFileCount() == count);
    }
    public String getDescription() {
        return("Count of files to be equal " +
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.