本文整理汇总了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();
}
示例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()"));
}
示例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()"));
}
示例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()"));
}
示例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);
}
示例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;
}
示例7: ToolbarButtonChooser
import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public ToolbarButtonChooser(String buttonTooltip, StringComparator comparator) {
this.buttonTooltip = buttonTooltip;
this.comparator = comparator;
}
示例8: AccessibleDescriptionChooser
import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public AccessibleDescriptionChooser(String description, StringComparator comparator) {
this.description = description;
this.comparator = comparator;
}
示例9: AccessibleNameChooser
import org.netbeans.jemmy.operators.Operator.StringComparator; //导入依赖的package包/类
public AccessibleNameChooser(String name, StringComparator comparator) {
this.name = name;
this.comparator = comparator;
}
示例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;
}
示例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;
}