Package abbot.finder

Examples of abbot.finder.Matcher


   * Returns the component of a given class in <code>container</code> hierarchy.
   */
  public static Component findComponent(Container container,
                                        final Class componentClass)
      throws ComponentSearchException {
    return new BasicFinder().find(container, new Matcher () {
        public boolean matches(Component component) {
          return componentClass.isInstance(component);
        }
      });
  }
View Full Code Here


        new ClassMatcher(JList.class, true));
    textureCount = availableTexturesList.getModel().getSize();
    // Select modified texture
    availableTexturesList.setSelectedValue(modifiedTexture, true);
    final JButton deleteButton = (JButton)new BasicFinder().find(textureDialog,
        new Matcher() {
          public boolean matches(Component c) {
            return c instanceof JButton && ((JButton)c).getText().equals(preferences.getLocalizedString(
                TextureChoiceComponent.class, "deleteTextureButton.text"));
          }
        });
    tester.invokeAndWait(new Runnable() {
        public void run() {
          // Display confirm dialog box later in Event Dispatch Thread to avoid blocking test thread
          deleteButton.doClick();       
        }
      });
    tester.waitForIdle();
    // Wait for confirm dialog to be shown
    final String confirmDeleteSelectedCatalogTextureDialogTitle = preferences.getLocalizedString(
        TextureChoiceComponent.class, "confirmDeleteSelectedCatalogTexture.title");
    tester.waitForFrameShowing(new AWTHierarchy(), confirmDeleteSelectedCatalogTextureDialogTitle);
    // Check dialog box is displayed
    JDialog confirmDialog = (JDialog)new BasicFinder().find(textureDialog, 
        new Matcher() {
            public boolean matches(Component c) {
              return c instanceof JDialog && ((JDialog)c).getTitle().equals(
                  confirmDeleteSelectedCatalogTextureDialogTitle);
            }
          });
View Full Code Here

  private JDialog showImportTextureWizard(final UserPreferences preferences,
                                          Container parent, JComponentTester tester,
                                          final boolean modify)
            throws ComponentSearchException {
    final JButton button = (JButton)new BasicFinder().find(parent,
        new Matcher() {
          public boolean matches(Component c) {
            return c instanceof JButton
                && ((JButton)c).getText() != null
                && ((JButton)c).getText().equals(preferences.getLocalizedString(
                    TextureChoiceComponent.class,
View Full Code Here

        Component list = getFinder().find(new ClassMatcher(JList.class));
        JListTester tester = new JListTester();

        // We could also use an instance of ClassMatcher, but this shows
        // how you can put more conditions into the Matcher.
        JLabel label = (JLabel)getFinder().find(labeledList, new Matcher() {
            public boolean matches(Component c) {
                return c.getClass().equals(JLabel.class)
                    && c.getParent() == labeledList;
            }
        });
View Full Code Here

                return c instanceof JFormattedTextField;
            }
        }
        BasicFinder finder = new BasicFinder();
       
        Matcher m = new FieldMatcher();
        JFormattedTextField f = null;
        try {
            f = (JFormattedTextField) finder.find( c, m );
        } catch (ComponentNotFoundException ex) {
            ex.printStackTrace();
View Full Code Here

                return c instanceof JSlider;
            }
        }
        BasicFinder finder = new BasicFinder();
       
        Matcher m = new FieldMatcher();
        JSlider f = null;
        try {
            f = (JSlider) finder.find( c, m );
        } catch (ComponentNotFoundException ex) {
            ex.printStackTrace();
View Full Code Here

                return c instanceof JTextField && staticName.equals( c.getName() );
            }
        }
        BasicFinder finder = new BasicFinder();
       
        Matcher m = new FieldMatcher();
        JTextField f = null;
        try {
            f = (JTextField) finder.find( editor, m );
        } catch (ComponentNotFoundException ex) {
            ex.printStackTrace();
View Full Code Here

            public boolean matches( Component c ) {
                return c instanceof JButton && staticName.equals( c.getName() );
            }
        }
        BasicFinder finder = new BasicFinder();
        Matcher m = new FieldMatcher();
        JButton btn = null;
        try {
            btn = (JButton) finder.find( editor, m );
        } catch (ComponentNotFoundException ex) {
            ex.printStackTrace();
View Full Code Here

            public boolean matches( Component c ) {
                return c instanceof JButton && staticName.equals( c.getName() );
            }
        }
        BasicFinder finder = new BasicFinder();
        Matcher m = new FieldMatcher();
        JButton btn = null;
        try {
            btn = (JButton) finder.find( editor, m );
        } catch (ComponentNotFoundException ex) {
            ex.printStackTrace();
View Full Code Here

TOP

Related Classes of abbot.finder.Matcher

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.