List of usage examples for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL
String NEXT_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL.
Click Source Link
From source file:org.bonitasoft.studio.connectors.test.swtbot.TestLoadSaveConnectorConfiguration.java
License:Open Source License
@Test public void testSaveLoadConnectorConfiguration() { ConnectorConfRepositoryStore store = (ConnectorConfRepositoryStore) RepositoryManager.getInstance() .getRepositoryStore(ConnectorConfRepositoryStore.class); final int initialSize = store.getChildren().size(); final String connectorDefId = "testLoadConnectorDefinition"; final String version = "1.0.0"; final String name = "testLoadConnector"; final String name2 = "testLoadConnector2"; final String dataName = "dataLoadConnector"; final String saveName = "testLoadConnectorConfig"; createConnector(connectorDefId);//from w w w . j a v a 2 s.c o m SWTBotTestUtil.createNewDiagram(bot); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).show(); createData(dataName); //SWTBotConnectorTestUtil.addConnectorToPool(bot, connectorDefId,version, new String[]{"Uncategorized"},name); SWTBotTestUtil.selectTabbedPropertyView(bot, "Connectors"); bot.button("Add...").click(); bot.text().setText(connectorDefId); bot.table().select(connectorDefId); bot.button(IDialogConstants.NEXT_LABEL).click(); //SWTBotConnectorTestUtil.addConnectorToPool(bot, connectorLabel,connectorVersion,dbCategoryLabel, connectorName); bot.textWithLabel("Name *").setText(name); bot.button(IDialogConstants.NEXT_LABEL).click(); bot.textWithLabel("text").setText("hello world"); bot.sleep(1000); // Due to delayed observable on databinding bot.button(IDialogConstants.NEXT_LABEL).click(); SWTBotTestUtil.setOutputStorageExpressionByName(bot, dataName, String.class.getName(), 0); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.table().select(name + " -- " + connectorDefId + " (" + version + ") -- ON_FINISH"); bot.button("Edit...").click(); bot.button(IDialogConstants.NEXT_LABEL).click(); bot.toolbarButton("Save").click(); bot.textWithLabel("Name *").setText(saveName); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); //add a new connector and load previous configuration connector SWTBotTestUtil.selectTabbedPropertyView(bot, "Connectors"); bot.button("Add...").click(); //bot.tree().setFocus(); //bot.tree().expandNode("Uncategorized").select(connectorDefId + " (" + version + ")"); bot.text().setText(connectorDefId); bot.table().select(connectorDefId); bot.button(IDialogConstants.NEXT_LABEL).click(); bot.textWithLabel("Name *").setText(name2); bot.button(IDialogConstants.NEXT_LABEL).click(); bot.toolbarButton("Load").click(); final SWTBotTree wizardTree = bot.treeWithId(SWTBotConstants.SELECTION_CONNECTOR_CONFIGURATION_TREE_ID); wizardTree.setFocus(); bot.waitUntil(new ICondition() { public boolean test() throws Exception { wizardTree.getTreeItem(saveName).select(); return wizardTree.selectionCount() > 0; } public void init(SWTBot bot) { } public String getFailureMessage() { return "Cannot select tree item"; } }, 10000, 1000); bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL))); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.NEXT_LABEL))); bot.button(IDialogConstants.NEXT_LABEL).click(); assertEquals("text field should be completed with hello world", bot.textWithLabel("text").getText(), "hello world"); //remove configuration bot.toolbarButton("Load").click(); assertTrue("remove button should be enabled", bot.button("Remove").isEnabled()); bot.tree().setFocus(); bot.waitUntil(new ICondition() { public boolean test() throws Exception { bot.tree().getTreeItem(saveName).select(); return bot.tree().selectionCount() > 0; } public void init(SWTBot bot) { } public String getFailureMessage() { return "Cannot select tree item"; } }, 10000, 500); bot.waitUntil(Conditions.widgetIsEnabled(bot.button("Remove"))); bot.button("Remove").click(); bot.waitUntil(new ICondition() { public boolean test() throws Exception { return bot.tree().getAllItems().length == initialSize; } public void init(SWTBot bot) { } public String getFailureMessage() { return "Fail to delete configuration"; } }); bot.button(IDialogConstants.CANCEL_LABEL).click(); bot.button(IDialogConstants.CANCEL_LABEL).click(); bot.saveAllEditors(); assertEquals("invalid number of configuration", initialSize, store.getChildren().size()); }
From source file:org.bonitasoft.studio.connectors.test.TestTestWSConnector.java
License:Open Source License
public void testTestWSConnector() throws IOException { /*Import process*/ bot.waitUntil(Conditions.shellIsActive("Bonita Studio")); SWTBotTestUtil.importProcessWIthPathFromClass(bot, "WS_Without_Introspect--1.0.bar", "Bonita", "WS_Without_Introspect (1.0)", this.getClass(), false); SWTBotGefEditor gefEditor = bot.gefEditor("WS_Without_Introspect (1.0)"); /*Select step on which there is the connector to test*/ gefEditor.getEditPart("Step1").parent().select(); /*Open connector configuration wizard to test the connector*/ bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).setFocus(); SWTBotTestUtil.selectTabbedPropertyView(bot, "Connectors"); bot.tree().select(0);//from ww w .j a va 2 s. com bot.button("Edit...").click(); bot.waitUntil(Conditions.shellIsActive("Web Service Client")); /*In the wizard go to the right page to test it*/ bot.button(IDialogConstants.NEXT_LABEL).click(); bot.button("Test Configuration").click(); /*Wait that the correct shell opened*/ bot.waitUntil(Conditions.shellIsActive("Results")); assertContains("DOMSource", bot.tree().getAllItems()[0].getText()); bot.button("Back").click(); bot.button(IDialogConstants.CANCEL_LABEL).click(); }
From source file:org.bonitasoft.studio.contract.ui.wizard.AddInputContractFromDataWizardDialog.java
License:Open Source License
@Override public void updateButtons() { super.updateButtons(); final Button nextButton = getButton(IDialogConstants.NEXT_ID); if (getCurrentPage() instanceof CreateContractInputFromBusinessObjectWizardPage) { nextButton.setText(Messages.preview); } else {// w w w . j a va 2s . c o m nextButton.setText(IDialogConstants.NEXT_LABEL); } }
From source file:org.bonitasoft.studio.diagram.test.DiagramTests.java
License:Open Source License
/** Create & run a 4 tasks process * @author Florine Boudin//w ww .j a v a 2 s . co m * @throws Exception */ @Test public void test4TasksDiagram() throws Exception { // create a new process SWTBotTestUtil.createNewDiagram(bot); //Create 3 variables SWTBotEditor botEditor = bot.activeEditor(); SWTBotGefEditor gmfEditor = bot.gefEditor(botEditor.getTitle()); gmfEditor.click(200, 200); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).show(); SWTBotTestUtil.selectTabbedPropertyView(bot, "Data"); // Create 3 new variables setNewVariable("varText", "Text", false); setNewVariable("varBoolean", "Boolean", false); setNewVariable("varInteger", "Integer", false); // check 3 variables where created bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).show(); SWTBotTestUtil.selectTabbedPropertyView(bot, "Data"); // check the table has 3 variables SWTBotTable table = bot.table(0); Assert.assertEquals("Error: wrong number of variable created", 3, table.rowCount()); final Vector<String> taskNameList = new Vector<String>( Arrays.asList(new String[] { "Step1", "Step2", "Step3", "Step4" })); // Create 3 human tasks int i = 400; for (String taskName : taskNameList) { setTaskAsHuman(gmfEditor, taskName); if (taskName != "Step4") { // create new Task System.out.println("s = " + taskName); Assert.assertNotNull("Error: No " + taskName + " task found.", gmfEditor.getEditPart(taskName)); SWTBotTestUtil.selectTaskFromSelectedElementAndDragIt(gmfEditor, taskName, new Point(i, 110)); i += 200; } } bot.menu("Diagram").menu("Save"); // check the gmfEditor has 4 human tasks IGraphicalEditPart ig = (IGraphicalEditPart) gmfEditor.mainEditPart().part(); MainProcess mp = (MainProcess) ig.resolveSemanticElement(); int nbHumanTasks = ModelHelper.getAllItemsOfType(mp, ProcessPackage.Literals.TASK).size(); Assert.assertEquals("Error: wrong number of tasks in the process.", 4, nbHumanTasks); int nbTransistions = ModelHelper.getAllItemsOfType(mp, ProcessPackage.Literals.CONNECTION).size(); Assert.assertEquals("Error: wrong number of connections in the process.", 4, nbTransistions); // For the 3 first tasks, add a form int itmp = 0; // create a form for (String nametask : taskNameList) { if (nametask != "Step4") { //System.out.println("s = "+s); gmfEditor.getEditPart(nametask).click(); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_APPLICATION).show(); SWTBotTestUtil.selectTabbedPropertyView(bot, PAGEFLOW_LABEL); // add a form bot.button(addForm, 0).click(); // first shell "Add form..." bot.waitUntil(Conditions.shellIsActive(addFormTitle)); if (SWTBotTestUtil.testingBosSp()) { //second shell "Add form..." List<Button> buttons = bot.getFinder().findControls(new BaseMatcher<Button>() { public void describeTo(Description description) { } public boolean matches(Object item) { if (item instanceof Button) { return IDialogConstants.NEXT_LABEL.equals(((Button) item).getText()); } return false; } }); if (!buttons.isEmpty()) { SWTBotButton nextButton = bot.button(IDialogConstants.NEXT_LABEL); if (nextButton != null) { nextButton.click(); } } } // remove 2 of 3 variables in the form for (int j = 0; j < 3; j++) { if (j != itmp) { bot.checkBox(j).deselect(); } } // last shell "Add form..." bot.button(IDialogConstants.FINISH_LABEL).click(); // add script to conver to an integer on "Step3" if (nametask.equals("Step2")) { SWTBotGefEditor formEditor = bot.gefEditor(bot.activeEditor().getTitle()); formEditor.getEditPart("Var Integer").click(); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show(); SWTBotTestUtil.selectTabbedPropertyView(bot, "Data"); bot.toolbarButtonWithId(ExpressionViewer.SWTBOT_ID_EDITBUTTON, 1).click(); String valueOf = "Integer.valueOf(field_varInteger1)"; SWTBotTestUtil.setScriptExpression(bot, "theInteger", valueOf, Integer.class.getName()); bot.waitUntil(new ICondition() { public boolean test() throws Exception { return bot.textWithId(ExpressionViewer.SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).getText() .equals("theInteger"); } public void init(SWTBot bot) { } public String getFailureMessage() { return "Expression not set properly"; } }); } bot.activeEditor().saveAndClose(); itmp++; } } // Create the form for the 4th task gmfEditor.getEditPart("Step4").click(); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_APPLICATION).show(); SWTBotTestUtil.selectTabbedPropertyView(bot, PAGEFLOW_LABEL); bot.button(addForm, 0).click(); // first shell "Add form..." bot.waitUntil(Conditions.shellIsActive(addFormTitle)); if (SWTBotTestUtil.testingBosSp()) { //second shell "Add form..." bot.button(IDialogConstants.NEXT_LABEL).click(); } // last shell "Add form..." bot.button(IDialogConstants.FINISH_LABEL).click(); SWTBotGefEditor formEditor = bot.gefEditor(bot.activeEditor().getTitle()); final String[] varTab = new String[] { "Var Text", "Var Boolean", "Var Integer" }; for (String s : varTab) { formEditor.getEditPart(s).click(); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show(); SWTBotTestUtil.selectTabbedPropertyView(bot, "General"); // "Field type" bot.comboBoxWithLabel(formFieldType).setSelection("Text"); bot.activeEditor().save(); } bot.activeEditor().saveAndClose(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.test.swtbot.util.SWTBotTestUtil.java
License:Open Source License
/** * /*from w w w . j a v a 2s . c o m*/ * @param bot */ public static void editScriptConnector(SWTGefBot bot, String scriptName, String scriptText, String scriptDescription) { // 1st page editConnector(bot, "Script", "Groovy"); // 2nde page bot.textWithLabel("Name *").setText(scriptName); if (scriptDescription != null) { bot.textWithLabel("Description").setText(scriptDescription); } Assert.assertTrue("Error : Next button is not enable in Connectors Wizard.", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); bot.button(IDialogConstants.NEXT_LABEL).click(); // 3th page bot.toolbarButtonWithId(SWTBOT_ID_EDITBUTTON).click(); bot.waitUntil(Conditions.widgetIsEnabled(bot.textWithLabel("Name *"))); bot.textWithLabel("Name *").setText(scriptName); bot.styledText().setText(scriptText); bot.button(IDialogConstants.OK_LABEL).click(); //Assert.assertTrue("Error : Next button is not enable in Connectors Wizard.", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); bot.button(IDialogConstants.NEXT_LABEL).click(); // 4th page Assert.assertTrue("Error : finish button is not enable in Connectors Wizard.", bot.button(IDialogConstants.FINISH_LABEL).isEnabled()); bot.button(IDialogConstants.FINISH_LABEL).click(); }
From source file:org.bonitasoft.studio.test.swtbot.util.SWTBotTestUtil.java
License:Open Source License
/** Set the connector type and the select the connector specified in the parameters * //from w w w. j av a 2 s . c o m * @param bot * @param connectorType * @param connectorTool */ public static void editConnector(SWTGefBot bot, String connectorType, String connectorTool) { bot.waitUntil(Conditions.shellIsActive("Connectors")); // SWTBotTree tree = bot.tree(); // tree.expandNode(connectorType); // SWTBotTreeItem theItem = tree.getTreeItem(connectorType); // Assert.assertNotNull("Error : No item "+connectorType+" found in the tree.", theItem); // for( SWTBotTreeItem item : theItem.getItems()){ // System.out.println("item = "+item.getText()); // if(item.getText().startsWith(connectorTool)){ // item.select(); // item.click(); // break; // } // } bot.text().setText(connectorTool); bot.table().select(0); Assert.assertTrue("Error : No " + connectorTool + " " + connectorType + " found in the connector list", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); bot.button(IDialogConstants.NEXT_LABEL).click(); }
From source file:org.bonitasoft.studio.test.swtbot.util.SWTBotTestUtil.java
License:Open Source License
public static void editEmailConnector(SWTGefBot bot, String emailName, String emailDescription, String from, String to, String subject, String message) { // 1st page/*w w w . j a v a2 s . c o m*/ editConnector(bot, "Messaging", "Email"); // 2nde page bot.textWithLabel("Name *").setText(emailName); if (emailDescription != null && !emailDescription.isEmpty()) { bot.textWithLabel("Description").setText(emailDescription); } Assert.assertTrue("Error : Next button is not enable in Connectors Wizard.", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); bot.button(IDialogConstants.NEXT_LABEL).click(); // 3th page Assert.assertTrue("Error : Next button is not enable in Connectors Wizard.", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); bot.button(IDialogConstants.NEXT_LABEL).click(); // 4th page bot.textWithLabel("From *").setText(from); bot.textWithLabel("To *").setText(to); bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.NEXT_LABEL))); Assert.assertTrue("Error : Next button is not enable in Connectors Wizard.", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); bot.button(IDialogConstants.NEXT_LABEL).click(); // 5th page bot.textWithLabel("Subject *").setText(subject); if (message != null && !message.isEmpty()) { bot.textWithLabel("Message").setText(message); } bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.NEXT_LABEL))); Assert.assertTrue("Error : Next button is not enable in Connectors Wizard.", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); bot.button(IDialogConstants.NEXT_LABEL).click(); // 6th page Assert.assertTrue("Error : Next button is not enable in Connectors Wizard.", bot.button(IDialogConstants.FINISH_LABEL).isEnabled()); bot.button(IDialogConstants.FINISH_LABEL).click(); }
From source file:org.bonitasoft.studio.tests.processzoo.examples.TestWebPurchase.java
License:Open Source License
private void createPayForm(SWTBotGefEditor gmfEditor) { bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_APPLICATION).show(); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_APPLICATION).setFocus(); SWTBotTestUtil.selectTabbedPropertyView(bot, PAGEFLOW_LABEL); SWTBotView properties = bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_APPLICATION); properties.bot().button("Add...").click(); bot.waitUntil(Conditions.shellIsActive("Add form...")); if (SWTBotTestUtil.testingBosSp()) { SWTBotButton nextButton = bot.button(IDialogConstants.NEXT_LABEL); bot.waitUntil(Conditions.widgetIsEnabled(nextButton)); nextButton.click();//from w w w. j a va2 s . c o m } bot.button("Unselect all").click(); bot.checkBox(0).select(); bot.checkBox(1).select(); bot.checkBox(2).select(); bot.button(IDialogConstants.FINISH_LABEL).click(); SWTBotGefEditor formEditor = bot.gefEditor(bot.activeEditor().getTitle()); formEditor.activateTool("Message"); formEditor.click(500, 90); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show(); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus(); SWTBotTestUtil.selectTabbedPropertyView(bot, "Data"); bot.toolbarButtonWithId(SWTBOT_ID_EDITBUTTON).click(); bot.table().select("Script"); bot.waitUntil(Conditions.widgetIsEnabled(bot.textWithLabel("Name *"))); bot.textWithLabel("Name *").setText("thankMessage"); bot.sleep(1000); bot.styledText().setText( "\"Thank you, \" + customerName +\", for your order of a \" +products + \". Please enter your credit card information " + "and select a delivery method.\""); bot.button(IDialogConstants.OK_LABEL).click(); }
From source file:org.eclipse.edt.ide.rui.visualeditor.internal.util.Mnemonics.java
License:Open Source License
/** * Set if the mnemonics are for a wizard page * Wizard pages already have a few buttons with mnemonics set by Eclipse * We have to make sure we do not use the ones they use *///from w w w. jav a 2s .c om public Mnemonics setOnWizardPage(boolean page) { if (page) { String[] labels = new String[] { IDialogConstants.BACK_LABEL, IDialogConstants.NEXT_LABEL, IDialogConstants.FINISH_LABEL }; String used = getMnemonicsFromStrings(labels).toUpperCase(); makeUsed(used); } return this; }
From source file:org.eclipse.edt.ide.ui.internal.dialogs.MultiElementListSelectionDialog.java
License:Open Source License
protected void createButtonsForButtonBar(Composite parent) { fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, true); fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, false); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }