Examples of NameMatcher


Examples of org.fest.swing.core.NameMatcher

  /** {@inheritDoc} */
  @RunsInEDT
  @Override
  public @Nonnull DialogFixture dialog(@Nullable String name, @Nonnull Timeout timeout) {
    NameMatcher matcher = new NameMatcher(name, Dialog.class, requireShowing());
    return findDialog(matcher, timeout);
  }
View Full Code Here

Examples of org.fest.swing.core.NameMatcher

  /** {@inheritDoc} */
  @RunsInEDT
  @Override
  public @Nonnull JFileChooserFixture fileChooser(@Nullable String name, @Nonnull Timeout timeout) {
    NameMatcher matcher = new NameMatcher(name, JFileChooser.class, requireShowing());
    return findFileChooser(matcher, timeout);
  }
View Full Code Here

Examples of org.fest.swing.core.NameMatcher

   *
   * @param componentName the name of the {@code Component} to find.
   * @param componentType the type of the {@code Component} to find.
   */
  protected ComponentFinderTemplate(@Nullable String componentName, @Nonnull Class<? extends T> componentType) {
    this(new NameMatcher(componentName, componentType, true));
  }
View Full Code Here

Examples of org.fest.swing.core.NameMatcher

    return dialog(name, DEFAULT_DIALOG_LOOKUP_TIMEOUT);
  }

  /** {@inheritDoc} */
  public DialogFixture dialog(String name, Timeout timeout) {
    NameMatcher matcher = new NameMatcher(name, Dialog.class, requireShowing());
    return findDialog(matcher, timeout);
  }
View Full Code Here

Examples of org.fest.swing.core.NameMatcher

    return new JFileChooserFixture(robot, findByName(name, JFileChooser.class));
  }

  /** {@inheritDoc} */
  public JFileChooserFixture fileChooser(String name, Timeout timeout) {
    NameMatcher matcher = new NameMatcher(name, JFileChooser.class, requireShowing());
    return findFileChooser(matcher, timeout);
  }
View Full Code Here

Examples of org.fest.swing.core.NameMatcher

        @Test public void testSwitchLanguage(){
            applet.menuItem("options").click();
            DialogFixture dialog = applet.dialog();
            JTabbedPaneFixture tabs = new JTabbedPaneFixture(dialog.robot,(JTabbedPane)dialog.robot.finder().findByName("tabs"));
            tabs.selectTab(1);
            JComboBox combobox = (JComboBox)dialog.robot.finder().find(new NameMatcher("language"));
            for(int i=0;i<combobox.getItemCount();i++){
                if(((String)combobox.getItemAt(i)).equals("German")){
                    combobox.setSelectedIndex(i);
                    break;
                }
            }
            JButtonFixture applybutton = new JButtonFixture(dialog.robot, (JButton)dialog.robot.finder().find(new NameMatcher("apply",true)));
            applybutton.click();
            Assert.assertEquals("Neu", applet.menuItem("new").component().getText());
           
            for(int i=0;i<combobox.getItemCount();i++){
                if(((String)combobox.getItemAt(i)).equals("American English")){
                    combobox.setSelectedIndex(i);
                    System.out.println("set USA");
                    break;
                }
            }

            JButtonFixture okbutton = new JButtonFixture(dialog.robot, (JButton)dialog.robot.finder().find(new NameMatcher("ok",true)));
            okbutton.click();
           
            Assert.assertFalse(dialog.component().isShowing());
            Assert.assertEquals("New", applet.menuItem("new").component().getText()); // fails in test only?
        }
View Full Code Here

Examples of org.gradle.util.NameMatcher

            this.tasks = tasks;
            this.taskName = path;
            return;
        }

        NameMatcher matcher = new NameMatcher();
        String actualName = matcher.find(baseName, tasksByName.keySet());

        if (actualName != null) {
            // A partial match
            this.tasks = tasksByName.get(actualName);
            this.taskName = prefix + actualName;
            return;
        }

        throw new TaskSelectionException(matcher.formatErrorMessage("task", project));
    }
View Full Code Here

Examples of org.gradle.util.NameMatcher

            path = path.substring(1);
        }
        for (String pattern : path.split(Project.PATH_SEPARATOR)) {
            Map<String, Project> children = current.getChildProjects();

            NameMatcher matcher = new NameMatcher();
            Project child = matcher.find(pattern, children);
            if (child != null) {
                current = child;
                continue;
            }

            throw new TaskSelectionException(matcher.formatErrorMessage("project", current));
        }

        return (ProjectInternal) current;
    }
View Full Code Here

Examples of org.gradle.util.NameMatcher

            // An exact match
            return new TaskSelection(taskPath.getProject().getPath(), path, tasks);
        }

        Map<String, TaskSelectionResult> tasksByName = taskNameResolver.selectAll(taskPath.getProject(), !taskPath.isQualified());
        NameMatcher matcher = new NameMatcher();
        String actualName = matcher.find(taskPath.getTaskName(), tasksByName.keySet());
        if (actualName != null) {
            return new TaskSelection(taskPath.getProject().getPath(), taskPath.getPrefix() + actualName, tasksByName.get(actualName));
        }

        throw new TaskSelectionException(matcher.formatErrorMessage("task", taskPath.getProject()));
    }
View Full Code Here

Examples of org.gradle.util.NameMatcher

            projectPath = projectPath.substring(1);
        }
        for (String pattern : projectPath.split(Project.PATH_SEPARATOR)) {
            Map<String, Project> children = current.getChildProjects();

            NameMatcher matcher = new NameMatcher();
            Project child = matcher.find(pattern, children);
            if (child != null) {
                current = child;
                continue;
            }

            throw new ProjectLookupException(matcher.formatErrorMessage("project", current));
        }

        return (ProjectInternal) current;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.