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


Java JPopupMenuOperator.pushMenu方法代码示例

本文整理汇总了Java中org.netbeans.jemmy.operators.JPopupMenuOperator.pushMenu方法的典型用法代码示例。如果您正苦于以下问题:Java JPopupMenuOperator.pushMenu方法的具体用法?Java JPopupMenuOperator.pushMenu怎么用?Java JPopupMenuOperator.pushMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.jemmy.operators.JPopupMenuOperator的用法示例。


在下文中一共展示了JPopupMenuOperator.pushMenu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newWatch

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/**
 * Tests that it is possible to add watches.
 */
public void newWatch() throws IllegalAccessException, InvocationTargetException, InvalidExpressionException {
    Node projectNode = new ProjectsTabOperator().getProjectRootNode(DEBUG_TEST_PROJECT_ANT);
    Node testFile = new Node(new SourcePackagesNode(projectNode), "advanced|VariablesTest.java");
    new OpenAction().perform(testFile);
    EditorOperator eo = new EditorOperator("VariablesTest.java");
    eo.setCaretPositionToLine(49);
    new ToggleBreakpointAction().perform();
    MainWindowOperator.StatusTextTracer stt = MainWindowOperator.getDefault().getStatusTextTracer();
    stt.start();
    new DebugJavaFileAction().perform(testFile);
    stt.waitText("Thread main stopped at VariablesTest.java:49");
    stt.stop();
    new ActionNoBlock("Debug|New Watch...", null).perform();
    NbDialogOperator newWatchDialog = new NbDialogOperator("New Watch");
    new JEditorPaneOperator(newWatchDialog, 0).setText("n");
    newWatchDialog.ok();
    TopComponentOperator variablesView = new TopComponentOperator(new ContainerOperator(MainWindowOperator.getDefault(), VIEW_CHOOSER), "Variables");
    JTableOperator variablesTable = new JTableOperator(variablesView);
    assertEquals("n", variablesTable.getValueAt(0, 0).toString());
    org.openide.nodes.Node.Property property = (org.openide.nodes.Node.Property) variablesTable.getValueAt(0, 2);
    assertEquals("50", property.getValue());
    JPopupMenuOperator menu = new JPopupMenuOperator(variablesTable.callPopupOnCell(0, 0));
    menu.pushMenu("Delete All");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:AntSanityTest.java

示例2: deleteNode

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/**
 * Deletes a node (file, package)
 * using pop-up menu
 */
public static void deleteNode(String path) {
    try {
        Node pn = new ProjectsTabOperator().getProjectRootNode(
                Utilities.TEST_PROJECT_NAME);
        if(pn != null && pn.isPresent()) {
            pn.select();
            Node n = new Node(pn, path);
            n.select();
            JPopupMenuOperator jpmo = n.callPopup();
            jpmo.pushMenu("Delete");
            new NbDialogOperator(CONFIRM_OBJECT_DELETION).btOK().push(); //confirm
            takeANap(500);
        }
    } catch (TimeoutExpiredException e) {
        System.out.println("Node hasn't been found!!!");
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:Utilities.java

示例3: testSelectTestFromEditorContextMenu

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:GotoTest.java

示例4: testResultWindowOpened

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/** Tests visiblility of results window */
public void testResultWindowOpened() {
    //open Test package
    Node n = Utilities.openFile(Utilities.TEST_PACKAGES_PATH +
            "|" + TEST_PACKAGE_NAME + "|" + Utilities.TEST_CLASS_NAME);

    Utilities.takeANap(5000);
    JPopupMenuOperator jpmo = n.callPopup();
    Utilities.takeANap(5000);
    jpmo.pushMenu(Utilities.RUN_FILE);
    Utilities.takeANap(9000);
    ResultWindowOperator rwo = ResultWindowOperator.invoke();
    assertTrue("Junit Output window should be visible", rwo.isVisible());
    rwo.close(); //close it
    assertFalse("Junit Output window is visible," +
            "should be closed", rwo.isShowing());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:ResultsWindowTest.java

示例5: selectCommitAction

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/**
     * Selects specified commit action for given row.
     *
     * @param rowIndex index of row to be selected
     * @param action name of action to be selected
     */
    public void selectCommitAction(int rowIndex, String action) {
//        tabFiles().clickOnCell(rowIndex, 2);
//        JComboBoxOperator combo = new JComboBoxOperator(tabFiles());
//        combo.selectItem(action);
        Rectangle rec = tabFiles().getCellRect(rowIndex, 0, true);
        tabFiles().clickForPopup(rec.x + rec.width / 2, rec.y + rec.height / 2);
        JPopupMenuOperator pmo = new JPopupMenuOperator();
        pmo.pushMenu(action);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:CommitOperator.java

示例6: pushCreateTestsPopup

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/**
 * Pushes Tools|Create Junit tests over a node
 * @param n the node where the action will be invoked
 */
public static void pushCreateTestsPopup(Node n) {
    JPopupMenuOperator jpmo = n.callPopup();
    String[] path = {"Tools", Bundle.getString(Utilities.JUNIT_BUNDLE,
            "LBL_Action_CreateTest")};
            jpmo.pushMenu(path);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:Utilities.java

示例7: testFilterButtonEnabled

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/**
 * Test whether filter button inside results window is enabled
 */
public void testFilterButtonEnabled() {
    Node n = Utilities.openFile(Utilities.TEST_PACKAGES_PATH + "|"
            + TEST_PACKAGE_NAME + "|EmptyJUnitTest");
    JPopupMenuOperator jpmo = n.callPopup();
    jpmo.pushMenu(Utilities.RUN_FILE);
    Utilities.takeANap(4000);
    ResultWindowOperator rwo = ResultWindowOperator.invoke();
    assertTrue("Filter button should eb enabled",
            rwo.isFilterButtonEnabled());
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:ResultsWindowTest.java

示例8: performPopup

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/** Performs popup menu on specified row in history list.
 * @param rowIndex index of row (starts at 0)
 * @param popupPath popup menu path
 */
public void performPopup(int rowIndex, String popupPath) {
    Point point = lstHistory().getClickPoint(rowIndex);
    lstHistory().clickForPopup(point.x, point.y);
    JPopupMenuOperator popup = new JPopupMenuOperator();
    popup.pushMenu(popupPath);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:SearchHistoryOperator.java

示例9: selectCommitAction

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/** Selects specified commit action for given row.
 * @param rowIndex index of row to be selected
 * @param action name of action to be selected
 */
public void selectCommitAction(int rowIndex, String action) {
    Rectangle rec = tabFiles().getCellRect(rowIndex, 0, true);
    tabFiles().clickForPopup(rec.x + rec.width / 2, rec.y + rec.height / 2);
    JPopupMenuOperator pmo = new JPopupMenuOperator();
    pmo.pushMenu(action);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:CommitOperator.java

示例10: open

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
public ComponentOperator open() {
    JPopupMenuOperator popup = this.openNode.callPopup();
    if (popup == null) {
        throw new Error("Cannot get context menu for node ");
    }
    try {
        popup.pushMenu(OPEN);
    } catch (org.netbeans.jemmy.TimeoutExpiredException tee) {
        throw new Error("Cannot push menu item ");
    }

    return MIDletEditorOperator.findMIDletEditorOperator(midletName);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:OpenMIDletEditorTest.java

示例11: deleteNode

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/**
 * Deletes a node (file, package, project)
 * using pop-up menu
 */
public static void deleteNode(String path) {
    Node pn = new ProjectsTabOperator().getProjectRootNode(
            Utilities.TEST_PROJECT_NAME);
    if(pn != null && pn.isPresent()) {
        pn.select();
        Node n = new Node(pn, path);
        n.select();
        JPopupMenuOperator jpmo = n.callPopup();
        jpmo.pushMenu("Delete");
        new NbDialogOperator(CONFIRM_OBJECT_DELETION).btYes().push(); //confirm
        takeANap(500);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:Utilities.java

示例12: performPopupAction

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
/**
 * Performs popup action on this widget.
 *
 * @param popupPath path of popup menu item (e.g. 'Go|Next')
 */
public void performPopupAction(String popupPath) {
    Point center = getCenter();
    getViewOperator().clickForPopup(center.x, center.y);
    JPopupMenuOperator popupOper = new JPopupMenuOperator();
    popupOper.setComparator(getComparator());
    popupOper.pushMenu(popupPath, "|", getComparator());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:WidgetOperator.java

示例13: clickForTextPopup

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
protected void clickForTextPopup(EditorOperator eo, String menu) {
    JEditorPaneOperator txt = eo.txtEditorPane();
    JEditorPane epane = (JEditorPane) txt.getSource();
    try {
        Rectangle rct = epane.modelToView(epane.getCaretPosition());
        txt.clickForPopup(rct.x, rct.y);
        JPopupMenuOperator popup = new JPopupMenuOperator();
        popup.pushMenu(menu);
    } catch (BadLocationException ex) {
        System.out.println("=== Bad location");
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:GeneralCSSPrep.java

示例14: open

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
public ComponentOperator open(){
    JPopupMenuOperator popup =  openNode.callPopup();
    popup.pushMenu("Open");
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:OpenFilesTest.java

示例15: open

import org.netbeans.jemmy.operators.JPopupMenuOperator; //导入方法依赖的package包/类
@Override
public ComponentOperator open() {
    JPopupMenuOperator popup = openNode.callPopup();
    popup.pushMenu("Open");
    return new TopComponentOperator(fileName);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:OpenFilesNoCloneableEditorTest.java


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