Example usage for org.eclipse.jface.dialogs IDialogConstants FINISH_LABEL

List of usage examples for org.eclipse.jface.dialogs IDialogConstants FINISH_LABEL

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants FINISH_LABEL.

Prototype

String FINISH_LABEL

To view the source code for org.eclipse.jface.dialogs IDialogConstants FINISH_LABEL.

Click Source Link

Document

The label for finish buttons.

Usage

From source file:org.bonitasoft.studio.tests.data.DataWizardIT.java

License:Open Source License

@Test
public void testMoveData() throws Exception {
    final Pool pool = createProcessWithData();
    final Lane lane = (Lane) pool.getElements().get(0);
    final SWTBotEditor botEditor = bot.activeEditor();
    final SWTBotGefEditor gmfEditor = bot.gefEditor(botEditor.getTitle());

    final SWTBotGefEditPart parent = gmfEditor.getEditPart("Step1").parent();
    final Activity step = (Activity) ((IGraphicalEditPart) parent.part()).resolveSemanticElement();
    final SWTBotGefEditPart poolPart = gmfEditor.getEditPart(pool.getName()).parent();
    poolPart.select();/*www. j  a va2 s .  c om*/
    poolPart.click();
    addDataOnSelectedElementWithName("dataToMove", SWTBotConstants.VIEWS_PROPERTIES_POOL_DATA_VARIABLES);
    final int nbPoolData = pool.getData().size();
    final int nbStepData = step.getData().size();
    bot.tableWithId(SWTBotConstants.SWTBOT_ID_PROCESS_DATA_LIST).select("dataToMove -- Text");
    // button("Move...")
    bot.button(Messages.moveData).click();
    bot.tree().getTreeItem("Pool " + pool.getName()).getNode("Lane " + lane.getName()).select("Task Step1");
    bot.button(IDialogConstants.FINISH_LABEL).click();
    SWTBotTestUtil.waitUntilBonitaBPmShellIsActive(bot);
    bot.menu("Diagram").menu("Save").click();
    bot.waitUntil(new DefaultCondition() {

        @Override
        public boolean test() throws Exception {
            return nbStepData + 1 == step.getData().size();
        }

        @Override
        public String getFailureMessage() {
            return "data not removed";
        }
    });
    assertEquals("data not added", nbPoolData - 1, pool.getData().size());
    SWTBotTestUtil.waitUntilBonitaBPmShellIsActive(bot);
    bot.menu("Diagram").menu("Close").click();
}

From source file:org.bonitasoft.studio.tests.data.DataWizardIT.java

License:Open Source License

/**
 * Add a Text Data/*from  w ww.  j  a  v  a 2 s . c  om*/
 *
 * @param dataName
 */
private void addDataOnSelectedElementWithName(final String dataName, final String tabId) {
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).show();
    SWTBotTestUtil.selectTabbedPropertyView(bot, tabId);

    bot.buttonWithId(SWTBotConstants.SWTBOT_ID_ADD_PROCESS_DATA).click();
    // Shell "New variable"
    bot.waitUntil(Conditions.shellIsActive(Messages.newVariable));

    bot.textWithLabel(Messages.name + " *").setText(dataName);
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)));
    bot.button(IDialogConstants.FINISH_LABEL).click();
    SWTBotTestUtil.waitUntilBonitaBPmShellIsActive(bot);
    final BotApplicationWorkbenchWindow applicationWorkbenchWindow = new BotApplicationWorkbenchWindow(bot);
    applicationWorkbenchWindow.save();
    SWTBotTestUtil.waitUntilBonitaBPmShellIsActive(bot);
}

From source file:org.bonitasoft.studio.tests.data.DataWizardIT.java

License:Open Source License

@Test
public void testDataDefaultValueReturnType() throws Exception {
    SWTBotTestUtil.createNewDiagram(bot);
    final SWTBotEditor botEditor = bot.activeEditor();
    final SWTBotGefEditor gmfEditor = bot.gefEditor(botEditor.getTitle());

    final IGraphicalEditPart part = (IGraphicalEditPart) gmfEditor.mainEditPart().part();
    final MainProcess model = (MainProcess) part.resolveSemanticElement();
    final Pool pool = (Pool) model.getElements().get(0);

    gmfEditor.getEditPart(pool.getName()).parent().select();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).show();

    SWTBotTestUtil.selectTabbedPropertyView(bot, SWTBotTestUtil.VIEWS_PROPERTIES_POOL_DATA_VARIABLES);

    bot.buttonWithId(SWTBotConstants.SWTBOT_ID_ADD_PROCESS_DATA).click();
    // Shell "New variable"
    bot.waitUntil(Conditions.shellIsActive(Messages.newVariable));

    final String dataName = "myDataName";
    bot.textWithLabel(Messages.name + " *").setText(dataName);

    String defaultValue = "test return type";
    bot.textWithLabel(Messages.defaultValueLabel).setText(defaultValue);
    bot.sleep(500);//from  w  ww  .j  av a2s.  co m

    bot.toolbarButtonWithId(ExpressionViewer.SWTBOT_ID_EDITBUTTON).click();
    assertEquals("Expression return type should be " + String.class.getName(), String.class.getName(),
            bot.comboBoxWithLabel(Messages.returnType).getText());
    bot.button(IDialogConstants.OK_LABEL).click();

    bot.comboBoxWithLabel(Messages.datatypeLabel).setSelection(DataTypeLabels.integerDataType);

    defaultValue = "50";
    bot.textWithLabel(Messages.defaultValueLabel).setText(defaultValue);
    bot.sleep(500);
    bot.toolbarButtonWithId(ExpressionViewer.SWTBOT_ID_EDITBUTTON).click();
    assertEquals("Expression return type should be " + Integer.class.getName(), Integer.class.getName(),
            bot.comboBoxWithLabel(Messages.returnType).getText());

    bot.button(IDialogConstants.OK_LABEL).click();

    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)));
    bot.button(IDialogConstants.FINISH_LABEL).click();
    SWTBotTestUtil.waitUntilBonitaBPmShellIsActive(bot);
    final BotApplicationWorkbenchWindow applicationWorkbenchWindow = new BotApplicationWorkbenchWindow(bot);
    applicationWorkbenchWindow.save();

    SWTBotTestUtil.waitUntilBonitaBPmShellIsActive(bot);
    applicationWorkbenchWindow.close();
}

From source file:org.bonitasoft.studio.tests.data.DataWizardIT.java

License:Open Source License

@Test
public void testMaxLengthDescription() {
    final BotApplicationWorkbenchWindow botApplicationWorkbenchWindow = new BotApplicationWorkbenchWindow(bot);
    final BotProcessDiagramPerspective diagramPerspective = botApplicationWorkbenchWindow.createNewDiagram();
    final BotProcessDiagramPropertiesViewFolder diagramPropertiesPart = diagramPerspective
            .getDiagramPropertiesPart();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).setFocus();
    final BotDataPropertySection dataTab = diagramPropertiesPart.selectDataTab().selectPoolDataTab();

    final BotAddDataWizardPage addDataDialog = dataTab.addData();

    addDataDialog.setName("MyName");
    assertThat(bot.button(IDialogConstants.FINISH_LABEL).isEnabled()).isFalse().overridingErrorMessage(
            "We shouldn't be able to create a data with an Uppercase as first charater");
    addDataDialog.setName("myName");
    String text270 = "";
    for (int i = 0; i < 270; i++) {
        text270 += "a";
    }//from  w w w  .j a  v  a 2  s . co  m
    addDataDialog.setDescription(text270);
    assertThat(bot.button(IDialogConstants.FINISH_LABEL).isEnabled()).isFalse()
            .overridingErrorMessage("We shouldn't be able to put more than 255 characters");
    String text255 = "";
    for (int i = 0; i < 254; i++) {
        text255 += "b";
    }
    addDataDialog.setDescription(text255);
    assertThat(bot.button(IDialogConstants.FINISH_LABEL).isEnabled()).isTrue()
            .overridingErrorMessage("We should be able to put at least 254 characters");
    bot.button(IDialogConstants.CANCEL_LABEL).click();
}

From source file:org.bonitasoft.studio.tests.data.DataWizardIT.java

License:Open Source License

@Test
public void testCreateDataWithExistingId() {
    //Add the data myData on pool
    final String dataName = "myData_ToTestCreateDataWithExistingId";
    final String dataName1 = "myData_ToTestCreateDataWithExistingId1";
    final BotApplicationWorkbenchWindow botApplicationWorkbenchWindow = new BotApplicationWorkbenchWindow(bot);
    final BotProcessDiagramPerspective diagramPerspective = botApplicationWorkbenchWindow.createNewDiagram();
    final BotProcessDiagramPropertiesViewFolder diagramPropertiesPart = diagramPerspective
            .getDiagramPropertiesPart();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).setFocus();
    final BotDataPropertySection dataTab = diagramPropertiesPart.selectDataTab().selectPoolDataTab();

    BotAddDataWizardPage addDataDialog = dataTab.addData();

    addDataDialog.setName(dataName);// w ww. j  av a2  s. co m
    addDataDialog.finish();

    //try to add a data myData on step
    diagramPerspective.activeProcessDiagramEditor().selectElement("Step1");
    addDataDialog = diagramPropertiesPart.selectDataTab().selectLocalDataTab().addData();
    ;
    addDataDialog.setName(dataName);
    assertThat(bot.button(IDialogConstants.FINISH_LABEL).isEnabled()).isFalse();
    addDataDialog.setName(dataName1);
    addDataDialog.finish();

    //add a second task and add a data named myData1
    diagramPerspective.activeProcessDiagramEditor().addElement("Step1", "Human", PositionConstants.EAST);
    addDataDialog = diagramPropertiesPart.selectDataTab().selectLocalDataTab().addData();
    addDataDialog.setName(dataName1);
    addDataDialog.finish();
}

From source file:org.bonitasoft.studio.tests.data.TestData.java

License:Open Source License

@Test
public void testMaxLengthDescription() {
    SWTBotTestUtil.createNewDiagram(bot);
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).show();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "Data");
    bot.button(Messages.addData).click();

    bot.textWithLabel(Messages.name + " *").setText("MyName");
    assertFalse("We shouldn't be able to create a data with an Uppercase as first charater",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.textWithLabel(Messages.name + " *").setText("myName");
    String text270 = "";
    for (int i = 0; i < 270; i++) {
        text270 += "a";
    }/*from  w  ww  .j  a v a 2 s . c  om*/
    bot.textWithLabel(Messages.dataDescriptionLabel).setText(text270);
    assertFalse("We shouldn't be able to put more than 255 characters",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    String text255 = "";
    for (int i = 0; i < 254; i++) {
        text255 += "b";
    }
    bot.textWithLabel(Messages.dataDescriptionLabel).setText(text255);
    assertTrue("We should be able to put at least 254 characters",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.button(IDialogConstants.CANCEL_LABEL).click();
}

From source file:org.bonitasoft.studio.tests.processzoo.examples.TestWebPurchase.java

License:Open Source License

private void createSalesReviewForm(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..."));
    bot.button(IDialogConstants.FINISH_LABEL).click();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).show();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).setFocus();
    bot.tree().select("customerPhone1");
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "General");
    bot.comboBoxWithLabel("Field type").setSelection("Text");
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).show();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).setFocus();
    bot.tree().select("customerEmail1");
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "General");
    bot.comboBoxWithLabel("Field type").setSelection("Text");
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).show();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).setFocus();
    bot.tree().select("customerName1");
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "General");
    bot.comboBoxWithLabel("Field type").setSelection("Text");
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).show();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).setFocus();
    bot.tree().select("products1");
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "Options");
    bot.checkBox(2).select();/* w ww .jav a  2 s  .  co  m*/
}

From source file:org.bonitasoft.studio.tests.processzoo.examples.TestWebPurchase.java

License:Open Source License

private void createMoreInfoForm(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..."));
    bot.button(IDialogConstants.FINISH_LABEL).click();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).show();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).setFocus();
    bot.tree().select("customerPhone1");
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "General");
    bot.comboBoxWithLabel("Field type").setSelection("Text");
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).show();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).setFocus();
    bot.tree().select("customerEmail1");
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "General");
    bot.comboBoxWithLabel("Field type").setSelection("Text");
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).show();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).setFocus();
    bot.tree().select("customerName1");
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "General");
    bot.comboBoxWithLabel("Field type").setSelection("Text");
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).show();
    bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW).setFocus();
    bot.tree().select("products1");
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_FORM_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "Options");
    bot.checkBox(2).select();/* w w w.  j  av a2s. co m*/
}

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();/*  w ww .j  av a2s . 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.bonitasoft.studio.tests.processzoo.examples.TestWebPurchase.java

License:Open Source License

private void configureProcess(SWTBotGefEditor gmfEditor) {
    IGraphicalEditPart part = (IGraphicalEditPart) gmfEditor.mainEditPart().part();
    MainProcess model = (MainProcess) part.resolveSemanticElement();
    Pool pool = (Pool) model.getElements().get(0);
    String processLabel = pool.getName() + " (" + pool.getVersion() + ")";
    if (testingBosSp()) {
        bot.toolbarDropDownButton("Configure").click();
    } else {// w  w w  . j a v  a2  s.c om
        bot.toolbarButton("Configure").click();
    }
    bot.waitUntil(Conditions.shellIsActive("Local configuration for " + processLabel));
    bot.table().getTableItem("Actor mapping").select();
    bot.tree().getTreeItem("Actor1 -- Not mapped").select();
    bot.button("Groups...").click();
    bot.table().getTableItem(1).check();
    bot.sleep(1000);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    bot.button(IDialogConstants.FINISH_LABEL).click();
}