Java Code Examples for org.netbeans.jemmy.operators.JPopupMenuOperator#pushMenuNoBlock()

The following examples show how to use org.netbeans.jemmy.operators.JPopupMenuOperator#pushMenuNoBlock() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GapsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testNewSizeOfGap() {
    opDesigner = new FormDesignerOperator(FILE_NAME);
    ComponentInspectorOperator cio = new ComponentInspectorOperator();
    Node inspectorRootNode = new Node(cio.treeComponents(), FRAME_ROOT);
    inspectorRootNode.select();
    inspectorRootNode.expand();
    
    Node buttonNode = new Node(inspectorRootNode, "jButton1 [JButton]");
    buttonNode.callPopup();
    
    JPopupMenuOperator jpmo= new JPopupMenuOperator();
    waitNoEvent(500);
    jpmo.pushMenuNoBlock("Edit Layout Space...");
    waitNoEvent(500);
    
    EditLayoutSpaceOperator elso = new EditLayoutSpaceOperator();
    elso.setSizeOfGapTop("800");
    waitNoEvent(500);

    findInCode(".addContainerGap(800, Short.MAX_VALUE)", opDesigner);
}
 
Example 2
Source File: ViewsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testViewsHeapWalker2() {
    EditorOperator eo = new EditorOperator("MemoryView.java");
    new EventTool().waitNoEvent(500);
    Utilities.toggleBreakpoint(eo, 92);
    Utilities.startDebugger();
    Utilities.checkConsoleLastLineForText("Thread main stopped at MemoryView.java:92");
    Utilities.showDebuggerView(Utilities.classesViewTitle);

    TopComponentOperator tco = new TopComponentOperator(Utilities.classesViewTitle);
    JTableOperator jTableOperator = new JTableOperator(tco);
    JComboBoxOperator filter = new JComboBoxOperator(tco);
    JPopupMenuOperator popup = new JPopupMenuOperator(jTableOperator.callPopupOnCell(0, 0));
    popup.pushMenuNoBlock("Show in Instances View");
    filter.clearText();
    filter.pushKey(KeyEvent.VK_ENTER);
    new EventTool().waitNoEvent(500);
}
 
Example 3
Source File: CommonUtilities.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private static Node performTomcatServerAction(String action) {
    Node asNode = getTomcatServerNode();
    asNode.select();
    new EventTool().waitNoEvent(10000);
    String serverIDEName = asNode.getText();
    log("ServerNode name = "+serverIDEName);
    JPopupMenuOperator popup = asNode.callPopup();
    if (popup == null) {
        throw new Error("Cannot get context menu for Tomcat server node ");
    }
    boolean startEnabled = popup.showMenuItem(action).isEnabled();
    if(startEnabled) {
        popup.pushMenuNoBlock(action);
    }
    return asNode;
}
 
Example 4
Source File: ActionNoBlock.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * performs action through popup menu
 *
 * @param component component to be action performed on
 * @throws UnsupportedOperationException when action does not support popup
 * mode
 */
@Override
public void performPopup(ComponentOperator component) {
    if (popupPath == null) {
        throw new UnsupportedOperationException(getClass().toString() + " does not define popup path");
    }
    // Need to wait here to be more reliable.
    // TBD - It can be removed after issue 23663 is solved.
    new EventTool().waitNoEvent(500);
    component.clickForPopup();
    JPopupMenuOperator popup = new JPopupMenuOperator(component);
    popup.setComparator(getComparator());
    popup.pushMenuNoBlock(popupPath, "|");
    try {
        Thread.sleep(AFTER_ACTION_WAIT_TIME);
    } catch (Exception e) {
        throw new JemmyException("Sleeping interrupted", e);
    }
}
 
Example 5
Source File: GeneralPHP.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void SetTagsSupport(String sTag, String sProject, boolean b) {
    // Open project properties
    ProjectsTabOperator pto = new ProjectsTabOperator();
    ProjectRootNode prn = pto.getProjectRootNode(sProject);
    prn.select();
    prn.callPopup();
    JPopupMenuOperator popup = new JPopupMenuOperator();
    popup.pushMenuNoBlock("Properties");
    JDialogOperator jdProperties = new JDialogOperator("Project Properties - ");
    // Set support
    JCheckBoxOperator box = new JCheckBoxOperator(jdProperties, sTag);
    if (box.isSelected() ^ b) {
        box.clickMouse();
    }
    //Sleep( 10000 );
    // Close dialog
    JButtonOperator bOk = new JButtonOperator(jdProperties, "OK");
    bOk.push();
    jdProperties.waitClosed();
}
 
Example 6
Source File: GapsTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testpopUpDialogInvoke() {
    opDesigner = new FormDesignerOperator(FILE_NAME);
    opDesigner.clickForPopup(400, 70);
    JPopupMenuOperator jpmo= new JPopupMenuOperator();
    waitNoEvent(500);
    jpmo.pushMenuNoBlock("Edit Layout Space...");
    waitNoEvent(500);
    EditLayoutSpaceOperator elso = new EditLayoutSpaceOperator();
    
    elso.Ok();
}
 
Example 7
Source File: GapsTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testpopUpDialogOnButton() {
    opDesigner = new FormDesignerOperator(FILE_NAME);
    
    ComponentInspectorOperator cio = new ComponentInspectorOperator();
    Node inspectorRootNode = new Node(cio.treeComponents(), FRAME_ROOT);
    inspectorRootNode.select();
    inspectorRootNode.expand();
    
    Node buttonNode = new Node(inspectorRootNode, "jButton1 [JButton]");
    buttonNode.callPopup();
    
    JPopupMenuOperator jpmo= new JPopupMenuOperator();
    waitNoEvent(500);
    jpmo.pushMenuNoBlock("Edit Layout Space...");
    waitNoEvent(500);
    
    
    
    EditLayoutSpaceOperator elso = new EditLayoutSpaceOperator();
    
    elso.verify();
    
    assertEquals("default small", (String) elso.cbBottom().getItemAt(0));
    assertEquals("default medium", (String) elso.cbBottom().getItemAt(1));
    assertEquals("default large", (String) elso.cbBottom().getItemAt(2));
    
    assertEquals("default", (String) elso.cbLeft().getItemAt(0));
    elso.Cancel();
}
 
Example 8
Source File: WidgetOperator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Performs popup action on this widget and no block further execution.
 *
 * @param popupPath path of popup menu item (e.g. 'Go|Next')
 */
public void performPopupActionNoBlock(String popupPath) {
    Point center = getCenter();
    getViewOperator().clickForPopup(center.x, center.y);
    JPopupMenuOperator popupOper = new JPopupMenuOperator();
    popupOper.setComparator(getComparator());
    popupOper.pushMenuNoBlock(popupPath, "|", getComparator());
}
 
Example 9
Source File: GeneralPHP.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void SetPhpVersion(String sProject, int version) {
    // Open project properties
    ProjectsTabOperator pto = new ProjectsTabOperator();
    ProjectRootNode prn = pto.getProjectRootNode(sProject);
    prn.select();
    prn.callPopup();
    JPopupMenuOperator popup = new JPopupMenuOperator();
    popup.pushMenuNoBlock("Properties");
    JDialogOperator jdProperties = new JDialogOperator("Project Properties - ");
    // Set support
    JComboBoxOperator box = new JComboBoxOperator(jdProperties, 1);
    switch (version) {
        case 2:
            box.selectItem(0);
            break;
        case 3:
            box.selectItem(1);
            break;
        case 4:
            box.selectItem(2);
            break;
        default:
            box.selectItem(2);
            break;
    }
    //Sleep( 10000 );
    // Close dialog
    JButtonOperator bOk = new JButtonOperator(jdProperties, "OK");
    bOk.push();
    jdProperties.waitClosed();
}
 
Example 10
Source File: AcceptanceTestCaseXSD.java    From netbeans with Apache License 2.0 4 votes vote down vote up
protected void AddItInternal(
    int iColumn,
    String sItName,
    String sMenuToAdd,
    String sRadioName,
    String sTypePath,
    String sAddedName
  )
{
  // Swicth to Schema view
  new JMenuBarOperator(MainWindowOperator.getDefault()).pushMenu("View|Editors|Schema");

  // Select first column, Attributes
  SchemaMultiView opMultiView = new SchemaMultiView( JAXB_PACKAGE_NAME + ".xsd" );
  opMultiView.switchToSchema( );
  opMultiView.switchToSchemaColumns( );
  JListOperator opList = opMultiView.getColumnListOperator( iColumn );
  opList.selectItem( sItName );

  // Right click on Reference Schemas
  int iIndex = opList.findItemIndex( sItName );
  Point pt = opList.getClickPoint( iIndex );
  opList.clickForPopup( pt.x, pt.y );

  // Click Add Attribute...
  JPopupMenuOperator popup = new JPopupMenuOperator( );
  popup.pushMenuNoBlock( sMenuToAdd + "..." );

  // Get dialog
  JDialogOperator jadd = new JDialogOperator( sMenuToAdd.replace( "|", " " ) );

  // Set unique name
  JTextFieldOperator txt = new JTextFieldOperator( jadd, 0 );
  txt.setText( sAddedName );

  // Use existing definition
  if( null != sRadioName )
  {
    JRadioButtonOperator jex = new JRadioButtonOperator( jadd, sRadioName );
    jex.setSelected( true );
  }

  // Get tree
  if( null != sTypePath )
  {
    JTreeOperator jtree = new JTreeOperator( jadd, 0 );
    TreePath path = jtree.findPath( sTypePath );
  
    jtree.selectPath( path );
    jtree.clickOnPath( path );
  }

  // Close
  JButtonOperator jOK = new JButtonOperator( jadd, "OK" ); // TODO : OK
  jOK.push( );
  jadd.waitClosed( );

  // Check attribute was added successfully
  opList = opMultiView.getColumnListOperator( iColumn + 1 );
  iIndex = opList.findItemIndex( sAddedName );
  if( -1 == iIndex )
    fail( "It was not added." );

}
 
Example 11
Source File: VersioningOperator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Performs popup menu on specified row and no block further execution.
 * @param row row number to be selected (starts from 0)
 * @param popupPath popup menu path
 */
public void performPopupNoBlock(int row, String popupPath) {
    tabFiles().selectCell(row, 0);
    JPopupMenuOperator popup = new JPopupMenuOperator(tabFiles().callPopupOnCell(row, 0));
    popup.pushMenuNoBlock(popupPath);
}
 
Example 12
Source File: Utilities.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/**
 * Pushes Tools|Create Junit tests over a node
 * @param n the node where the action will be invoked
 */
public static void pushFindPopup(Node n) {
    JPopupMenuOperator jpmo = n.callPopup();
    jpmo.pushMenuNoBlock(Bundle.getString(UTILITIES_BUNDLE,
            "TEXT_TITLE_CUSTOMIZE"));
}
 
Example 13
Source File: VersioningOperator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Performs popup menu on specified row and no block further execution.
 * @param row row number to be selected (starts from 0)
 * @param popupPath popup menu path
 */
public void performPopupNoBlock(int row, String popupPath) {
    tabFiles().selectCell(row, 0);
    JPopupMenuOperator popup = new JPopupMenuOperator(tabFiles().callPopupOnCell(row, 0));
    popup.pushMenuNoBlock(popupPath);
}
 
Example 14
Source File: VersioningOperator.java    From netbeans with Apache License 2.0 2 votes vote down vote up
/**
 * Performs popup menu on specified row and no block further execution.
 *
 * @param row row number to be selected (starts from 0)
 * @param popupPath popup menu path
 */
public void performPopupNoBlock(int row, String popupPath) {
    tabFiles().selectCell(row, 0);
    JPopupMenuOperator popup = new JPopupMenuOperator(tabFiles().callPopupOnCell(row, 0));
    popup.pushMenuNoBlock(popupPath);
}