/** 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; }
/** * 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; }
/** 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; }
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 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);
@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(); } }
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(); } }