当前位置: 首页>>代码示例>>Java>>正文


Java StringComparator类代码示例

本文整理汇总了Java中org.netbeans.jemmy.operators.Operator.StringComparator的典型用法代码示例。如果您正苦于以下问题:Java StringComparator类的具体用法?Java StringComparator怎么用?Java StringComparator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StringComparator类属于org.netbeans.jemmy.operators.Operator包,在下文中一共展示了StringComparator类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectCategory

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
/** Selects a category with given name.
 * @param name name of category to be selected
 */
public void selectCategory(final String name) {
    new EventTool().waitNoEvent(300);  // prevent clicking on category button when panel not initialized
    final StringComparator comparator = this.getComparator();
    new JLabelOperator(this, new ComponentChooser() {
        public boolean checkComponent(Component comp) {
            if(comp.getClass().getName().equals("org.netbeans.modules.options.OptionsPanel$CategoryButton")||// NOI18N
                    comp.getClass().getName().equals("org.netbeans.modules.options.OptionsPanel$NimbusCategoryButton")) { // NOI18N
                if(((JLabel)comp).getText() != null) {
                    return comparator.equals(((JLabel)comp).getText(), name);
                }
            }
            return false;
        }
        public String getDescription() {
            return "OptionsPanel$CategoryButton with text "+name; // NOI18N
        }
    }).clickMouse();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:OptionsOperator.java

示例2: testCompletionDot

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public void testCompletionDot() throws Exception {
    eo.makeComponentVisible();
    eo.typeKey('.');

    CompletionJListOperator lrComplOp = new CompletionJListOperator();
    lrComplOp.getCompletionItems();

    lrComplOp.clickOnItem("println()", new StringComparator() {

        @Override
        public boolean equals(String caption, String match) {
            return caption.contains(match);
        }
    }, 2); //doubleclick

    assertTrue("The line does not contain the clicked item from CompletionList!",
            eo.contains("System.out.println()"));

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CompletionJListOperatorTest.java

示例3: testCompletionInvoke

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public void testCompletionInvoke() throws Exception {
    eo.makeComponentVisible();
    eo.insert(".");

    CompletionJListOperator lrComplOp = CompletionJListOperator.showCompletion();
    lrComplOp.getCompletionItems();

    lrComplOp.clickOnItem("println()", new StringComparator() {

        @Override
        public boolean equals(String caption, String match) {
            return caption.contains(match);
        }
    }, 2); //doubleclick

    assertTrue("The line does not contain the clicked item from CompletionList!",
            eo.contains("System.out.println()"));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:CompletionJListOperatorTest.java

示例4: testCompletionCtrlSpace

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public void testCompletionCtrlSpace() throws Exception {
    eo.insert(".");

    eo.requestFocus();
    eo.txtEditorPane().pushKey(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK); //press ctrl+space

    CompletionJListOperator lrComplOp = new CompletionJListOperator();
    lrComplOp.getCompletionItems();

    lrComplOp.clickOnItem("println()", new StringComparator() {

        @Override
        public boolean equals(String caption, String match) {
            return caption.contains(match);
        }
    }, 2); //doubleclick

    assertTrue("The line does not contain the clicked item from CompletionList!",
            eo.contains("System.out.println()"));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:CompletionJListOperatorTest.java

示例5: buildProject

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
/**
 * Build project and wait for finish
 * @param project
 */
public static void buildProject(String project) {
    JavaProjectRootNode prn = JavaProjectsTabOperator.invoke().getJavaProjectRootNode(project);
    prn.buildProject();
    StringComparator sc = MainWindowOperator.getDefault().getComparator();        
    MainWindowOperator.getDefault().setComparator(new Operator.DefaultStringComparator(false, true));
    MainWindowOperator.getDefault().waitStatusText("Finished building "); // NOI18N
    MainWindowOperator.getDefault().setComparator(sc);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:CommonUtilities.java

示例6: getComparator

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
/**
 * Gets comparator set for this action instance.
 *
 * @return comparator set for this action instance.
 */
public StringComparator getComparator() {
    if (comparator == null) {
        comparator = defaultComparator;
    }
    return comparator;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:Action.java

示例7: ToolbarButtonChooser

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public ToolbarButtonChooser(String buttonTooltip, StringComparator comparator) {
    this.buttonTooltip = buttonTooltip;
    this.comparator = comparator;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:OverflowToolbarOperator.java

示例8: AccessibleDescriptionChooser

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public AccessibleDescriptionChooser(String description, StringComparator comparator) {
    this.description = description;
    this.comparator = comparator;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:AccessibleDescriptionChooser.java

示例9: AccessibleNameChooser

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public AccessibleNameChooser(String name, StringComparator comparator) {
    this.name = name;
    this.comparator = comparator;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:AccessibleNameChooser.java

示例10: StringPropChooser

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
/**
 * Constructs a StringPropChooser object.
 *
 * @param propNames Names of methods/fields
 * @param params Parameters values for methods. <BR>
 * @param classes Parameters classes.
 * @param results Objects to compare converted to String method/field values
 * to.
 * @param comparator Defines string comparision criteria.
 */
public StringPropChooser(String[] propNames,
        Object[][] params,
        Class<?>[][] classes,
        String[] results,
        StringComparator comparator) {
    super(propNames, params, classes, results);
    this.comparator = comparator;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:StringPropChooser.java

示例11: setComparator

import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
/**
 * Sets comparator fot this action. Comparator is used for all actions after
 * this method is called.
 *
 * @param comparator new comparator to be set (e.g. new
 * Operator.DefaultStringComparator(true, true); to search string item
 * exactly and case sensitive)
 */
public void setComparator(StringComparator comparator) {
    this.comparator = comparator;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:Action.java


注:本文中的org.netbeans.jemmy.operators.Operator.StringComparator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。