Examples of ClassMatcher


Examples of abbot.finder.matchers.ClassMatcher

    /** Returns the Applet descendent of the given Container, if any. */
    public static Applet findAppletDescendent(Container c) {
        try {
            return (Applet)BasicFinder.getDefault().
                find(c, new ClassMatcher(Applet.class));
        }
        catch(ComponentSearchException e) {
            return null;
        }
    }
View Full Code Here

Examples of abbot.finder.matchers.ClassMatcher

        // The interface abbot.finder.Matcher allows you to define whatever
        // matching specification you'd like.  We know there's only one
        // JList in the hierarchy we're searching, so we can look up by
        // class with an instance of ClassMatcher.
        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() {
View Full Code Here

Examples of edu.umd.cs.findbugs.filter.ClassMatcher

        case BUGCODE:
            return new BugMatcher(s.getFrom(bug), null, null);
        case CATEGORY:
            return new BugMatcher(null, null, s.getFrom(bug));
        case CLASS:
            return new ClassMatcher(s.getFrom(bug));
        case DESIGNATION:
            return new DesignationMatcher(s.getFrom(bug));

        case FIRSTVERSION:
            return new FirstVersionMatcher(s.getFrom(bug), RelationalOp.EQ);
        case LASTVERSION:
            return new LastVersionMatcher(s.getFrom(bug), RelationalOp.EQ);
        case PACKAGE:
            String p = Sortables.CLASS.getFrom(bug);
            int lastDot = p.lastIndexOf('.');
            if (lastDot > 0) {
                p = p.substring(0, lastDot);
            }
            return new ClassMatcher("~" + p + "\\.[^.]+");
        case PRIORITY:
            return new PriorityMatcher(Integer.toString(bug.getPriority()));

        case TYPE:
            return new BugMatcher(null, s.getFrom(bug), null);
View Full Code Here

Examples of edu.umd.cs.findbugs.filter.ClassMatcher

        case BUGCODE:
            return new BugMatcher(value, null, null);
        case CATEGORY:
            return new BugMatcher(null, null, value);
        case CLASS:
            return new ClassMatcher(value);
        case DESIGNATION:
            return new DesignationMatcher(value);

        case FIRSTVERSION:
            return new FirstVersionMatcher(value, RelationalOp.EQ);
        case LASTVERSION:
            return new LastVersionMatcher(value, RelationalOp.EQ);
        case PACKAGE:
            return new ClassMatcher("~" + value + "\\.[^.]+");
        case PRIORITY:
            return new PriorityMatcher(value);
        case PROJECT:
            throw new NotImplementedYetException("Matchers for Projects not supported yet");
View Full Code Here

Examples of edu.umd.cs.findbugs.filter.ClassMatcher

        nextMatchedIsDisabled = "true".equals(disabled);
        if (qName.equals("Bug")) {
            addMatcher(new BugMatcher(getOptionalAttribute(attributes, "code"), getOptionalAttribute(attributes, "pattern"),
                    getOptionalAttribute(attributes, "category")));
        } else if (qName.equals("Class")) {
            addMatcher(new ClassMatcher(getRequiredAttribute(attributes, "name", qName)));
        } else if (qName.equals("FirstVersion")) {
            addMatcher(new FirstVersionMatcher(getRequiredAttribute(attributes, "value", qName), getRequiredAttribute(attributes,
                    "relOp", qName)));
        } else if (qName.equals("LastVersion")) {
            addMatcher(new LastVersionMatcher(getRequiredAttribute(attributes, "value", qName), getRequiredAttribute(attributes,
                    "relOp", qName)));
        } else if (qName.equals("Designation")) {
            addMatcher(new DesignationMatcher(getRequiredAttribute(attributes, "designation", qName)));
        } else if (qName.equals("BugCode")) {
            addMatcher(new BugMatcher(getRequiredAttribute(attributes, "name", qName), "", ""));
        } else if (qName.equals("Local")) {
            addMatcher(new LocalMatcher(getRequiredAttribute(attributes, "name", qName)));
        } else if (qName.equals("BugPattern")) {
            addMatcher(new BugMatcher("", getRequiredAttribute(attributes, "name", qName), ""));
        } else if (qName.equals("Priority")) {
            addMatcher(new PriorityMatcher(getRequiredAttribute(attributes, "value", qName)));
        } else if (qName.equals("Confidence")) {
            addMatcher(new ConfidenceMatcher(getRequiredAttribute(attributes, "value", qName)));
        } else if (qName.equals("Rank")) {
            addMatcher(new RankMatcher(getRequiredAttribute(attributes, "value", qName)));
        } else if (qName.equals("Package")) {
            String pName = getRequiredAttribute(attributes, "name", qName);
            pName = pName.startsWith("~") ? pName : "~" + pName.replace(".", "\\.");
            addMatcher(new ClassMatcher(pName + "\\.[^.]+"));
        } else if (qName.equals("Method")) {
            String name = getOptionalAttribute(attributes, "name");
            String params = getOptionalAttribute(attributes, "params");
            String returns = getOptionalAttribute(attributes, "returns");
            String role = getOptionalAttribute(attributes, "role");
            addMatcher(new MethodMatcher(name, params, returns, role));
        } else if (qName.equals("Field")) {
            String name = getOptionalAttribute(attributes, "name");
            String type = getOptionalAttribute(attributes, "type");
            addMatcher(new FieldMatcher(name, type));
        } else if (qName.equals("Or")) {
            CompoundMatcher matcher = new OrMatcher();
            pushCompoundMatcherAsChild(matcher);
        } else if (qName.equals("And") || qName.equals("Match")) {
            AndMatcher matcher = new AndMatcher();
            pushCompoundMatcherAsChild(matcher);
            if (qName.equals("Match")) {
                String classregex = getOptionalAttribute(attributes, "classregex");
                String classMatch = getOptionalAttribute(attributes, "class");

                if (classregex != null) {
                    addMatcher(new ClassMatcher("~" + classregex));
                } else if (classMatch != null) {
                    addMatcher(new ClassMatcher(classMatch));
                }
            }
        } else if(qName.equals("Not")) {
            NotMatcher matcher = new NotMatcher();
            pushCompoundMatcherAsChild(matcher);
View Full Code Here

Examples of net.sf.swtbot.matcher.ClassMatcher

   * @return a wrapper around a Text widget matching the specified criteria.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.0
   */
  public SWTBotText text(String text, int index) throws WidgetNotFoundException {
    List findControls = finder.findControls(new DecoratingAndMatcher(new ClassMatcher(Text.class), new TextMatcher(text)));
    if (findControls.isEmpty())
      throw new WidgetNotFoundException("Could not find any text widget");
    return new SWTBotText((Text) findControls.get(index));
  }
View Full Code Here

Examples of net.sf.swtbot.matcher.ClassMatcher

   * @param index the index of the table
   * @return a wrapper around the table widget.
   * @throws WidgetNotFoundException if the widget is not found.
   */
  public SWTBotTable table(int index) throws WidgetNotFoundException {
    List findControls = finder.findControls(new ClassMatcher(Table.class));
    if (findControls.isEmpty())
      throw new WidgetNotFoundException("Could not find any table");
    return new SWTBotTable((Table) findControls.get(index));
  }
View Full Code Here

Examples of net.sf.swtbot.matcher.ClassMatcher

   * @param shell the shell containing a table.
   * @return a wrapper around the table widget.
   * @throws WidgetNotFoundException if the table is not found.
   */
  public SWTBotTable table(SWTBotShell shell) throws WidgetNotFoundException {
    List findControls = finder.findControls(shell.widget, new ClassMatcher(Table.class), true);
    if (findControls.isEmpty())
      throw new WidgetNotFoundException("Could not find any table");
    return new SWTBotTable((Table) findControls.get(0));
  }
View Full Code Here

Examples of net.sf.swtbot.matcher.ClassMatcher

   * @return a wrapper around the list widget.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.0
   */
  public SWTBotList list(int index) throws WidgetNotFoundException {
    List findControls = finder.findControls(new ClassMatcher(org.eclipse.swt.widgets.List.class));
    if (findControls.isEmpty())
      throw new WidgetNotFoundException("Could not find any table");
    return new SWTBotList((org.eclipse.swt.widgets.List) findControls.get(index));
  }
View Full Code Here

Examples of net.sf.swtbot.matcher.ClassMatcher

   * @return a wrapper around the tree widget.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.0
   */
  public SWTBotTree tree(int index) throws WidgetNotFoundException {
    List findControls = finder.findControls(new ClassMatcher(Tree.class));
    if (findControls.isEmpty())
      throw new WidgetNotFoundException("Could not find any tree");
    return new SWTBotTree((Tree) findControls.get(index));
  }
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.