Package org.fest.swing.core

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


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

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

    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

    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

        @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

TOP

Related Classes of org.fest.swing.core.NameMatcher

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.