/** Tries to find "Copy Server JAR Files to Libraries Folder" JCheckBox in this dialog. * @return JCheckBoxOperator */ public JCheckBoxOperator cbCopyServerJARFilesToLibrariesFolder() { if (_cbCopyServerJARFilesToLibrariesFolder==null) { _cbCopyServerJARFilesToLibrariesFolder = new JCheckBoxOperator(this, "Copy Server JAR Files to Libraries Folder"); } return _cbCopyServerJARFilesToLibrariesFolder; }
public void operateOnCheckBox(JCheckBoxOperator operator) { Assert.assertTrue("Checkbox '" + operator.getText() + "' is not checked.", operator.isSelected()); } });
public void operateOnCheckBox(JCheckBoxOperator operator) { operator.changeSelection(true); } });
public static void deleteProject(String project, boolean waitStatus) { new DeleteAction().performAPI(ProjectsTabOperator.invoke().getProjectRootNode(project)); //delete project NbDialogOperator deleteProject = new NbDialogOperator("Delete Project"); // NOI18N JCheckBoxOperator delete_sources = new JCheckBoxOperator(deleteProject); if(delete_sources.isEnabled()) delete_sources.changeSelection(true); deleteProject.yes(); waitForPendingBackgroundTasks(); if(waitStatus) MainWindowOperator.getDefault().waitStatusText("Finished building "+project+" (clean)"); // NOI18N try { //sometimes dialog rises new NbDialogOperator("Question").yes(); // NOI18N }catch(Exception exc){ System.err.println("No Question dialog rises - no problem this is just workarround!"); exc.printStackTrace(System.err); } }
JCheckBoxOperator jc = new JCheckBoxOperator(mainFrame, checkBoxName); if (condition == true && !jc.isSelected()) { // if the checkbux needs to while (!jc.isSelected() && i < 5) { this.report("Setting checkox " + checkBoxName + " to on attempt-" + i); jc.clickMouse(); Thread.sleep(1000); i++; } else if (condition == false && jc.isSelected()) { // if the checkbux while (jc.isSelected() && i < retryNumber) { this.report("Setting checkox " + checkBoxName + " to off attempt-" + i); jc.clickMouse(); Thread.sleep(1000); i++;
@Test public void testChangeKeySelected() { assertFalse(panel.isChangeKeySelected()); assertFalse(new JCheckBoxOperator(frame).isSelected()); panel.setChangeKeySelected(true); assertTrue(panel.isChangeKeySelected()); assertTrue(new JCheckBoxOperator(frame).isSelected()); panel.setChangeKeySelected(false); assertFalse(panel.isChangeKeySelected()); assertFalse(new JCheckBoxOperator(frame).isSelected()); new JCheckBoxOperator(frame).setSelected(true); assertTrue(panel.isChangeKeySelected()); new JCheckBoxOperator(frame).setSelected(false); assertFalse(panel.isChangeKeySelected()); } }
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(); } }
/** checks or unchecks given JCheckBox * @param state boolean requested state */ public void checkCreateAsAJSPSegment(boolean state) { if (cbCreateAsAJSPSegment().isSelected()!=state) { cbCreateAsAJSPSegment().push(); } }
/** * check/uncheck a checkbox * * @param operator * the oprrator the checkbox is inside * @param identifier * checkbox name\index * @param enable * True will check, False will uncheck */ public void setCheckBox(ContainerOperator operator, Object identifier, boolean enable) { JCheckBoxOperator checkBox = getCheckBoxOperator(operator, identifier); String check = enable ? "check" : "uncheck"; if (!checkOperator(checkBox, identifier, "Check box is disabled!", identifier + "\nTried to " + check)) { return; } checkBox.setSelected(enable); }
public static void deleteProject(String project, boolean waitStatus) { new DeleteAction().performAPI(ProjectsTabOperator.invoke().getProjectRootNode(project)); //delete project NbDialogOperator deleteProject = new NbDialogOperator("Delete Project"); // NOI18N JCheckBoxOperator delete_sources = new JCheckBoxOperator(deleteProject); if(delete_sources.isEnabled()) delete_sources.changeSelection(true); deleteProject.yes(); waitForPendingBackgroundTasks(); if(waitStatus) MainWindowOperator.getDefault().waitStatusText("Finished building "+project+" (clean)"); // NOI18N try { //sometimes dialog rises new NbDialogOperator("Question").yes(); // NOI18N }catch(Exception exc){ System.err.println("No Question dialog rises - no problem this is just workarround!"); exc.printStackTrace(System.err); } }
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(); } }
/** checks or unchecks given JCheckBox * @param state boolean requested state */ public void checkCopyServerJARFilesToLibrariesFolder(boolean state) { if (cbCopyServerJARFilesToLibrariesFolder().isSelected()!=state) { cbCopyServerJARFilesToLibrariesFolder().push(); } }
/** * locate a Checkbox component by a given name or index and return its * operator * * @param operator * the operator to search in * @param identifier * the name\index to locate radioButton by * @return */ public JCheckBoxOperator getCheckBoxOperator(ContainerOperator operator, Object identifier) { JCheckBoxOperator checkBox = null; if (identifier instanceof String) { checkBox = new JCheckBoxOperator(operator, (String) identifier); } else { // int checkBox = new JCheckBoxOperator(operator, Integer .parseInt(identifier.toString())); } return checkBox; }
public void operateOnCheckBox(JCheckBoxOperator operator) { Assert.assertFalse("Checkbox '" + operator.getText() + "' is checked.", operator.isSelected()); } });
public void operateOnCheckBox(JCheckBoxOperator operator) { operator.changeSelection(false); } });
/** Tries to find "Create as a JSP Segment" JCheckBox in this dialog. * @return JCheckBoxOperator */ public JCheckBoxOperator cbCreateAsAJSPSegment() { if (_cbCreateAsAJSPSegment==null) { _cbCreateAsAJSPSegment = new JCheckBoxOperator(this, Bundle.getStringTrimmed( "org.netbeans.modules.web.wizards.Bundle", "OPT_JspSegment")); } return _cbCreateAsAJSPSegment; }
/** Returns operator for checkbox 'Create Main File' * @return JCheckBoxOperator */ public JCheckBoxOperator cbCreateMainFile() { if ( _cbCreateMainFile == null ) { _cbCreateMainFile = new JCheckBoxOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.ruby.rubyproject.ui.wizards.Bundle", "LBL_createMainCheckBox")); } return _cbCreateMainFile; }