/** Tries to find null JTextField in this dialog. * @return JTextFieldOperator */ public JTextFieldOperator txtContextPath() { if (_txtContextPath==null) { _txtContextPath = new JTextFieldOperator(this); } return _txtContextPath; }
/** Sets given location in text field Location. * @param location Project With Existing Sources location */ public void setLocation(String location) { txtLocation().setText(location); }
/** gets text for txtLocation * @return String text */ public String getProjectLocation() { return txtLocation().getText(); }
Action action = new Action("File|New Project", null); action.perform(); WizardOperator wo = new WizardOperator("New Project"); wo.next(); JTextFieldOperator txtName = new JTextFieldOperator( (JTextField) new JLabelOperator(wo, "Project Name:").getLabelFor()); txtName.clearText(); txtName.typeText("MyProject"); wo.finish();
/** * Adds GlassFish server using path from glassfish.home property */ public static void addApplicationServer() { String glassfishHome = System.getProperty("glassfish.home"); if (glassfishHome == null) { throw new Error("Can't add GlassFish server. glassfish.home property is not set."); } String addServerMenuItem = Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.actions.Bundle", "LBL_Add_Server_Instance"); // Add Server... String addServerInstanceDialogTitle = Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.wizard.Bundle", "LBL_ASIW_Title"); //"Add Server Instance" RuntimeTabOperator rto = RuntimeTabOperator.invoke(); Node serversNode = new Node(rto.getRootNode(), "Servers"); // Let's check whether GlassFish is already added if (!serversNode.isChildPresent("GlassFish")) { // There is no GlassFish node so we'll add it serversNode.performPopupActionNoBlock(addServerMenuItem); WizardOperator addServerInstanceDialog = new WizardOperator(addServerInstanceDialogTitle); new JListOperator(addServerInstanceDialog, 1).selectItem("GlassFish Server"); addServerInstanceDialog.next(); new JTextFieldOperator(addServerInstanceDialog).setText(glassfishHome); addServerInstanceDialog.next(); addServerInstanceDialog.finish(); } }
/** types text for txtJSPFileName * @param text String text */ public void typeJSPFileName(String text) { txtJSPFileName().typeText(text); }
@SuppressWarnings("ResultOfObjectAllocationIgnored") @Test public void testTabbedPane() { final ComponentChooser keyFileChooser = new NameComponentChooser("keyFileChooser"); new JTabbedPaneOperator(frame).selectPage(AuthenticationPanel.AUTH_KEY_FILE); // select tab for key files new JButtonOperator(frame, keyFileChooser).push(); // open file chooser JFileChooserOperator fc = new TFileChooserOperator(frame); fc.cancel(); new JTabbedPaneOperator(frame).selectPage(AuthenticationPanel.AUTH_PASSWD); // select tab for passwords new JLabelOperator(frame, LABEL_TEXT); fc = null; new JTabbedPaneOperator(frame).selectPage(AuthenticationPanel.AUTH_KEY_FILE); // select tab for key files new JButtonOperator(frame, keyFileChooser).push(); // open file chooser fc = new TFileChooserOperator(frame); final File file = new File("test"); fc.setSelectedFile(file); fc.approve(); fc.getQueueTool().waitEmpty(WAIT_EMPTY); JTextFieldOperator tf = new JTextFieldOperator(frame); assertEquals(file.getPath(), tf.getText()); fc = null; new JTabbedPaneOperator(frame).selectPage(AuthenticationPanel.AUTH_PASSWD); // select tab for passwords new JLabelOperator(frame, LABEL_TEXT); } }
new JTextFieldOperator(addServerInstanceDialog).enterText(appServerPath);
/** * Adds GlassFish server using path from glassfish.home property */ public static void addApplicationServer() { String glassfishHome = System.getProperty("glassfish.home"); if (glassfishHome == null) { throw new Error("Can't add GlassFish server. glassfish.home property is not set."); } String addServerMenuItem = Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.actions.Bundle", "LBL_Add_Server_Instance"); // Add Server... String addServerInstanceDialogTitle = Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.wizard.Bundle", "LBL_ASIW_Title"); //"Add Server Instance" RuntimeTabOperator rto = RuntimeTabOperator.invoke(); Node serversNode = new Node(rto.getRootNode(), "Servers"); // Let's check whether GlassFish is already added if (!serversNode.isChildPresent("GlassFish")) { // There is no GlassFish node so we'll add it serversNode.performPopupActionNoBlock(addServerMenuItem); WizardOperator addServerInstanceDialog = new WizardOperator(addServerInstanceDialogTitle); new JListOperator(addServerInstanceDialog, 1).selectItem("GlassFish Server"); addServerInstanceDialog.next(); new JTextFieldOperator(addServerInstanceDialog).setText(glassfishHome); addServerInstanceDialog.next(); addServerInstanceDialog.finish(); } }
/** types text for txtProject * @param text String text */ public void typeProject(String text) { txtProject().typeText(text); }
new ClassReference("org.netbeans.jemmy.explorer.GUIBrowser") .startApplication(); JFrameOperator mainFrame = new JFrameOperator("GUI Browser"); new JButtonOperator(mainFrame, "Reload In").push(); new JLabelOperator(mainFrame, "Reloaded"); JTreeOperator tree = new JTreeOperator(mainFrame); //click in the middle of the tree tree.clickMouse(); //collapse node tree.collapsePath(tree.findPath("", "|")); //expand node tree.expandPath(tree.findPath("", "|")); //select node tree.selectPath(tree.findPath("GUI Browser", "|")); JTextFieldOperator testField = new JTextFieldOperator(mainFrame); //type new value in the text field testField.clearText(); testField.typeText("3");
new JListOperator(addServerInstanceDialog, 1).selectItem(glassFishV3ListItem); new JButtonOperator(addServerInstanceDialog, nextButtonCaption).push(); new JTextFieldOperator(addServerInstanceDialog).enterText(appServerPath); new JButtonOperator(addServerInstanceDialog, finishButtonCaption).push();
/** Tries to find null JTextField in this dialog. * @return JTextFieldOperator */ public JTextFieldOperator txtProjectFolder() { if (_txtProjectFolder==null) { _txtProjectFolder = new JTextFieldOperator(this, 2); } return _txtProjectFolder; }
public static void addTomcatServer() { String appServerPath = System.getProperty("tomcat.installRoot"); if (appServerPath == null) { throw new Error("Can't add tomcat server. tomcat.installRoot property is not set."); } String addServerMenuItem = Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.actions.Bundle", "LBL_Add_Server_Instance"); // Add Server... String addServerInstanceDialogTitle = Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.wizard.Bundle", "LBL_ASIW_Title"); //"Add Server Instance" String nextButtonCaption = Bundle.getStringTrimmed("org.openide.Bundle", "CTL_NEXT"); String finishButtonCaption = Bundle.getStringTrimmed("org.openide.Bundle", "CTL_FINISH"); RuntimeTabOperator rto = RuntimeTabOperator.invoke(); Node serversNode = new Node(rto.getRootNode(), "Servers"); // Let's check whether GlassFish is already added if (!serversNode.isChildPresent("Tomcat")) { serversNode.performPopupActionNoBlock(addServerMenuItem); NbDialogOperator addServerInstanceDialog = new NbDialogOperator(addServerInstanceDialogTitle); new JListOperator(addServerInstanceDialog, 1).selectItem("Tomcat"); new JButtonOperator(addServerInstanceDialog, nextButtonCaption).push(); new JTextFieldOperator(addServerInstanceDialog, 1).setText(appServerPath); new JCheckBoxOperator(addServerInstanceDialog,1).changeSelection(false); new JButtonOperator(addServerInstanceDialog, finishButtonCaption).push(); } }
/** Sets given object name in the text field. * @param objectName name of object */ public void setObjectName(String objectName) { txtObjectName().setText(objectName); }
/** gets text for txtFolder * @return String text */ public String getFolder() { return txtFolder().getText(); }
/** types text for txtCreatedFile * @param text String text */ public void typeCreatedFile(String text) { txtCreatedFile().typeText(text); }