本文整理汇总了Java中org.netbeans.jemmy.operators.JMenuItemOperator类的典型用法代码示例。如果您正苦于以下问题:Java JMenuItemOperator类的具体用法?Java JMenuItemOperator怎么用?Java JMenuItemOperator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JMenuItemOperator类属于org.netbeans.jemmy.operators包,在下文中一共展示了JMenuItemOperator类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSelectTestFromMainMenu
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
/**
* Test selecting appropriate test from Main menu
*/
public void testSelectTestFromMainMenu() {
//open sample class
Node n = Utilities.openFile(Utilities.SRC_PACKAGES_PATH +
"|" + TEST_PACKAGE_NAME+ "|" + Utilities.TEST_CLASS_NAME);
EditorOperator eos = new EditorOperator(Utilities.TEST_CLASS_NAME);
JMenuBarOperator jbo = new JMenuBarOperator(
MainWindowOperator.getDefault().getJMenuBar());
String[] sf = {"Navigate", "Go to Test/Tested class"};
Utilities.takeANap(Utilities.ACTION_TIMEOUT);
jbo.pushMenu(sf[0]);
JMenuItemOperator jmio = new JMenuItemOperator(new JMenuOperator(jbo, sf[0]).getItem(4));
//Check if goto test is enabled inside menu
assertTrue("Goto Test disabled when invoked from Editor!", jmio.isEnabled());
jbo.pushMenu(sf);
//Operator for opened TestClassTest
EditorOperator eo = new EditorOperator(Utilities.TEST_CLASS_NAME + "Test");
assertTrue("Test for \"" + TEST_PACKAGE_NAME +
Utilities.TEST_CLASS_NAME + "\" not opened!", eo.isVisible());
eo.close(false);
eos.close(false);
}
示例2: testSelectTestFromEditorContextMenu
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
/**
* Test selecting appropriate test from Editor's context menu
*/
public void testSelectTestFromEditorContextMenu() {
//open sample class
Node n = Utilities.openFile(Utilities.SRC_PACKAGES_PATH +
"|" + TEST_PACKAGE_NAME+ "|" + Utilities.TEST_CLASS_NAME);
EditorOperator eos = new EditorOperator(Utilities.TEST_CLASS_NAME);
eos.clickForPopup();
JPopupMenuOperator jpmo = new JPopupMenuOperator();
String[] sf = {"Navigate", "Go to Test/Tested class"};
Utilities.takeANap(Utilities.ACTION_TIMEOUT);
jpmo.pushMenu(sf[0]);
JMenuItemOperator jmio = new JMenuItemOperator(new JMenuOperator(jpmo, sf[0]).getItem(2));
//Check if goto test is enabled inside menu
assertTrue("Goto Test disabled when invoked from Explorer, over a class node!" +
"see: http://www.netbeans.org/issues/show_bug.cgi?id=88599",
jmio.isEnabled());
jpmo.pushMenu(sf);
EditorOperator eot = new EditorOperator(Utilities.TEST_CLASS_NAME);
assertTrue("Test for \"" + TEST_PACKAGE_NAME +
Utilities.TEST_CLASS_NAME + "\" not opened!", eot.isVisible());
eot.close(false);
eos.close(false);
}
示例3: closeToolbar
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
private static void closeToolbar(String menu) {
MainWindowOperator mainWindow = MainWindowOperator.getDefault();
JMenuBarOperator menuBar = new JMenuBarOperator(mainWindow.getJMenuBar());
JMenuItemOperator menuItem = menuBar.showMenuItem(menu, "|");
if (menuItem.isSelected()) {
menuItem.push();
} else {
menuItem.pushKey(java.awt.event.KeyEvent.VK_ESCAPE);
mainWindow.pushKey(java.awt.event.KeyEvent.VK_ESCAPE);
}
}
示例4: showStatusLabels
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
public static void showStatusLabels() {
JMenuBarOperator mbo = new JMenuBarOperator(MainWindowOperator.getDefault().getJMenuBar());
JMenuItemOperator mo = mbo.showMenuItem("View|Show Versioning Labels");
JCheckBoxMenuItemOperator cbmio = new JCheckBoxMenuItemOperator((JCheckBoxMenuItem) mo.getSource());
if (!cbmio.getState()) {
cbmio.doClick();
}
}
示例5: hideStatusLabels
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
public static void hideStatusLabels() {
JMenuBarOperator mbo = new JMenuBarOperator(MainWindowOperator.getDefault().getJMenuBar());
JMenuItemOperator mo = mbo.showMenuItem("View|Show Versioning Labels");
JCheckBoxMenuItemOperator cbmio = new JCheckBoxMenuItemOperator((JCheckBoxMenuItem) mo.getSource());
if (cbmio.getState()) {
cbmio.doClick();
}
}
示例6: testSelectTestFromExplorer
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
/**
* Test selecting appropriate test from Explorer
*/
public void testSelectTestFromExplorer() {
//open sample class
Utilities.openFile(Utilities.SRC_PACKAGES_PATH +
"|" + TEST_PACKAGE_NAME+ "|" + Utilities.TEST_CLASS_NAME);
EditorOperator eos = new EditorOperator(Utilities.TEST_CLASS_NAME);
//select sample class in explorer
Node pn = new ProjectsTabOperator().getProjectRootNode(
Utilities.TEST_PROJECT_NAME);
pn.select();
Node n = new Node(pn, Utilities.SRC_PACKAGES_PATH +
"|" + TEST_PACKAGE_NAME+ "|" + Utilities.TEST_CLASS_NAME);
n.select();
JMenuBarOperator jbo = new JMenuBarOperator(
MainWindowOperator.getDefault().getJMenuBar());
String[] sf = {"Navigate", "Go to Test/Tested class"};
Utilities.takeANap(Utilities.ACTION_TIMEOUT);
jbo.pushMenu(sf[0]);
JMenuItemOperator jmio = new JMenuItemOperator(new JMenuOperator(jbo, sf[0]).getItem(4));
//Check if goto test is enabled inside menu
assertTrue("Goto Test disabled when invoked from Explorer, over a class node!" +
"see: http://www.netbeans.org/issues/show_bug.cgi?id=88599",
jmio.isEnabled());
jbo.pushMenu(sf);
EditorOperator eot = new EditorOperator(Utilities.TEST_CLASS_NAME);
assertTrue("Test for \"" + TEST_PACKAGE_NAME +
Utilities.TEST_CLASS_NAME + "\" not opened!", eot.isVisible());
eot.close(false);
eos.close(false);
}
示例7: showStatusLabels
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
public static void showStatusLabels() {
JMenuBarOperator mbo = new JMenuBarOperator(MainWindowOperator.getDefault().getJMenuBar());
JMenuItemOperator mo = mbo.showMenuItem("View|Show Versioning Labels");
JCheckBoxMenuItemOperator cbmio = new JCheckBoxMenuItemOperator((JCheckBoxMenuItem) mo.getSource());
if (!cbmio.getState())
cbmio.doClick();
}
示例8: performMenu
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
@Override
public void performMenu() {
// #221165 - prevent Initializing... menu item shown forever
JMenuItemOperator[] items;
do {
items = MainWindowOperator.getDefault().menuBar().showMenuItems(TEAM_ITEM + "|" + SVN_ITEM);
// push Escape key to ensure there is no open menu
MainWindowOperator.getDefault().pushKey(KeyEvent.VK_ESCAPE);
new EventTool().waitNoEvent(100);
} while (items != null && items.length > 0 && items[0].getText().equals("Initializing..."));
super.performMenu();
}
示例9: closeToolbar
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
private static void closeToolbar(String menu){
MainWindowOperator mainWindow = MainWindowOperator.getDefault();
JMenuBarOperator menuBar = new JMenuBarOperator(mainWindow.getJMenuBar());
JMenuItemOperator menuItem = menuBar.showMenuItem(menu,"|");
if(menuItem.isSelected())
menuItem.push();
else {
menuItem.pushKey(java.awt.event.KeyEvent.VK_ESCAPE);
mainWindow.pushKey(java.awt.event.KeyEvent.VK_ESCAPE);
}
}
示例10: showStatusLabels
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
public static void showStatusLabels() {
JMenuBarOperator mbo = new JMenuBarOperator(MainWindowOperator.getDefault().getJMenuBar());
JMenuItemOperator mo = mbo.showMenuItem("View|Show Versioning Labels");
JCheckBoxMenuItemOperator cbmio = new JCheckBoxMenuItemOperator((JCheckBoxMenuItem) mo.getSource());
if (!cbmio.getState()) {
cbmio.doClick();
}
}
示例11: prepare
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
@Override
public void prepare() {
JPopupMenuOperator popupMenu = dataObjectNode.callPopup();
mio = new JMenuItemOperator(popupMenu, testedSubmenu);
}
示例12: pushAlone
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
protected void pushAlone(JMenuItemOperator subMenuOper) {
DriverManager.getButtonDriver(subMenuOper).push(subMenuOper);
}
示例13: pushLast
import org.netbeans.jemmy.operators.JMenuItemOperator; //导入依赖的package包/类
protected void pushLast(JMenuItemOperator subMenuOper, boolean mousePressed) {
DriverManager.getMouseDriver(subMenuOper).enterMouse(subMenuOper);
DriverManager.getButtonDriver(subMenuOper).release(subMenuOper);
}