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.properties.test.TestThrowCatchMessage.java

License:Open Source License

@Test
public void testThrowCathMessage() throws IOException {
    SWTBotTestUtil.importProcessWIthPathFromClass(bot, "DemoMessageContentCorrelation-1.0.bos", "Bonita 6.x",
            "DemoMessageContentCorrelation", this.getClass(), false);
    SWTBotEditor botEditor = bot.activeEditor();
    SWTBotGefEditor gmfEditor = bot.gefEditor(botEditor.getTitle());

    SWTBotTestUtil.selectEventOnProcess(bot, gmfEditor, catchMessageEventName);
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).setFocus();
    bot.waitUntil(Conditions.widgetIsEnabled(bot.textWithLabel(Messages.name)), 10000);
    SWTBotTestUtil.selectTabbedPropertyView(bot, sectionTitle);
    bot.button(Messages.Add).click();/*  w w  w  .j a  va 2 s . co  m*/
    bot.waitUntil(Conditions.shellIsActive(Messages.messageEventAddWizardPageTitle));
    assertFalse(IDialogConstants.FINISH_LABEL + " button should be disabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.textWithLabel(Messages.name + " *").setText(messageName);
    assertFalse(IDialogConstants.FINISH_LABEL + " button should be disabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.textWithLabel(Messages.processNameLabel + " *").setText(targetPool);
    assertFalse(IDialogConstants.FINISH_LABEL + " button should be disabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.textWithLabel(Messages.eventNameLabel + " *").setText(targetTask);
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 5000);

    bot.tabItem(Messages.correlation).activate();

    bot.checkBox(Messages.useCorrelationkeys).click();

    bot.button(Messages.AddCorrelation).click();
    bot.button(Messages.AddCorrelation).click();
    bot.button(Messages.AddCorrelation).click();
    // last line for testing empty expression

    bot.table().click(0, 0);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(correlationKey1);
    bot.table().click(0, 1);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(correlationValue1);

    // test button disabled when enter same correlation key
    bot.table().click(1, 0);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(correlationKey1);

    bot.table().click(2, 0);

    assertFalse(IDialogConstants.FINISH_LABEL + " button should be disabled",
            bot.button(IDialogConstants.FINISH_LABEL).isEnabled());

    bot.table().click(1, 0);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(correlationKey2);
    bot.table().click(1, 1);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(correlationValue2);

    bot.tabItem(Messages.addMessageContent).activate();

    bot.button(Messages.addMessageContentButton).click();
    bot.button(Messages.addMessageContentButton).click();
    bot.button(Messages.addMessageContentButton).click();
    // last line for testing empty expressions
    bot.button(Messages.addMessageContentButton).click();
    bot.table().click(0, 0);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(messageContent1);
    bot.table().click(0, 1);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(messageContent1);
    // test button disabled when enter same message content id;
    bot.table().click(1, 0);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(messageContent1);
    bot.table().click(1, 0);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(messageContent2);
    bot.table().click(1, 1);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(messageContent2);
    bot.table().click(2, 0);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(messageContent3);
    bot.table().click(2, 1);
    bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).setText(messageContent3);
    bot.table().click(2, 0);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    SWTBotTestUtil.selectTabbedPropertyView(bot, "General");
    SWTBotTestUtil.selectElementFromOverview(bot, targetPool, null, throwMessageEventName);

    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, messageContentSectionTitle);
    bot.button(Messages.autoFillMessageContent).click();
    bot.waitUntil(Conditions.widgetIsEnabled(bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT)), 5000);
    assertEquals(bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 0).getText(), messageContent1);
    assertEquals(bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 2).getText(), messageContent2);
    assertEquals(bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 4).getText(), messageContent3);
    // index for expression viewer start at index 1 because of the
    // description in the form widget section
    assertEquals(messageContent1, bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 1).getText());
    assertEquals(messageContent2, bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 3).getText());
    assertEquals(messageContent3, bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT, 5).getText());

    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).setFocus();
    SWTBotTestUtil.selectTabbedPropertyView(bot, correlationSectionTitle);
    bot.button(Messages.autoFillMessageContent).click();
    assertEquals(correlationKey1, bot.table().cell(0, 0));
    assertEquals(correlationKey2, bot.table().cell(1, 0));
}

From source file:org.bonitasoft.studio.repository.test.swtbot.TestExportBosArchive.java

License:Open Source License

@Test
public void testExportDiagramBOSArchive() throws Exception {
    SWTBotTestUtil.createNewDiagram(bot);

    SWTBotEditor botEditor = bot.activeEditor();
    SWTBotGefEditor gmfEditor = bot.gefEditor(botEditor.getTitle());
    List<SWTBotGefEditPart> runnableEPs = gmfEditor.editParts(new BaseMatcher<EditPart>() {

        public boolean matches(Object item) {
            return item instanceof PoolEditPart;
        }/*from w ww.  j  a  va  2s .  co  m*/

        public void describeTo(Description description) {

        }
    });
    Assert.assertFalse(runnableEPs.isEmpty());
    gmfEditor.select(runnableEPs.get(0));

    bot.saveAllEditors();

    bot.toolbarButton("Export").click();
    bot.waitUntil(Conditions.shellIsActive(Messages.ExportButtonLabel));

    final SWTBotCombo destComboBot = bot
            .comboBoxWithLabel(org.bonitasoft.studio.common.repository.Messages.destinationPath + " *");
    final String defaultPath = destComboBot.getText();
    assertTrue("Invalid default file name", defaultPath.endsWith(".bos"));
    final File destFile = new File(defaultPath);
    if (destFile.exists()) {
        destFile.delete();
    }
    try {
        SWTBotButton finishButton = bot.button(IDialogConstants.FINISH_LABEL);
        bot.waitUntil(Conditions.widgetIsEnabled(finishButton));
        finishButton.click();
        bot.waitUntil(Conditions.shellIsActive("Export result"));
        bot.button(IDialogConstants.OK_LABEL).click();
        assertTrue("Destination file doesn't exists", destFile.exists());
        assertTrue("Destination file is empty", destFile.length() > 0);
    } finally {
        destFile.delete();
    }
}

From source file:org.bonitasoft.studio.simulation.wizards.ManageResourcesWizardPage.java

License:Open Source License

/**
 * @param container//w w  w  . ja  v a  2s  .c  o m
 */
private void createButtons(Composite container) {
    Composite buttonComposite = new Composite(container, SWT.NONE);
    buttonComposite.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
    RowLayout rl_buttonComposite = new RowLayout(SWT.VERTICAL);
    rl_buttonComposite.fill = true;
    buttonComposite.setLayout(rl_buttonComposite);

    btnAdd = new Button(buttonComposite, SWT.FLAT);
    btnAdd.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            Wizard editWizard = new EditSimulationResourceWizard();
            CustomWizardDialog wizard = new CustomWizardDialog(Display.getCurrent().getActiveShell(),
                    editWizard, IDialogConstants.FINISH_LABEL);
            wizard.create();
            WindowUtil.centerDialog(wizard.getShell(), Display.getCurrent().getActiveShell());
            if (wizard.open() == IDialogConstants.OK_ID) {
                treeViewer.setInput(resourceStore.getChildren());
                if (!treeViewer.getSelection().isEmpty()) {
                    resourceComposite.changeBinding(
                            ((IStructuredSelection) treeViewer.getSelection()).getFirstElement());
                } else {
                    resourceComposite.changeBinding(null);
                }
            }
        }
    });
    btnAdd.setText(Messages.add);

    btnEdit = new Button(buttonComposite, SWT.FLAT);
    btnEdit.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (!treeViewer.getSelection().isEmpty()) {
                IRepositoryFileStore artifact = (IRepositoryFileStore) ((IStructuredSelection) treeViewer
                        .getSelection()).getFirstElement();
                Wizard editWizard = new EditSimulationResourceWizard(artifact);
                CustomWizardDialog wizard = new CustomWizardDialog(Display.getCurrent().getActiveShell(),
                        editWizard, IDialogConstants.FINISH_LABEL);
                wizard.create();
                WindowUtil.centerDialog(wizard.getShell(), Display.getCurrent().getActiveShell());
                if (wizard.open() == IDialogConstants.OK_ID) {
                    treeViewer.setInput(resourceStore.getChildren());
                    if (!treeViewer.getSelection().isEmpty()) {
                        resourceComposite.changeBinding(
                                ((IStructuredSelection) treeViewer.getSelection()).getFirstElement());
                    } else {
                        resourceComposite.changeBinding(null);
                    }
                }
            }
        }
    });
    btnEdit.setText(Messages.edit);

    btnRemove = new Button(buttonComposite, SWT.FLAT);
    btnRemove.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (!treeViewer.getSelection().isEmpty()) {
                if (MessageDialog.openQuestion(Display.getDefault().getActiveShell(),
                        Messages.deleteQuestionTitle, Messages.deleteQuestionMessage)) {
                    IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
                    for (Iterator<?> iterator = selection.iterator(); iterator.hasNext();) {
                        Object item = (Object) iterator.next();
                        if (item instanceof IRepositoryFileStore) {
                            IRepositoryFileStore artifact = (IRepositoryFileStore) item;
                            artifact.delete();
                        }
                    }
                    treeViewer.setInput(resourceStore.getChildren());
                }
            }
        }
    });
    btnRemove.setText(Messages.remove);
}

From source file:org.bonitasoft.studio.swtbot.framework.diagram.general.contract.BotContractConstraintRow.java

License:Open Source License

public BotContractConstraintRow setExpression(final String expression) {
    constraintTable.setFocus();//from   www  .  j a v  a  2  s.  co  m
    constraintTable.click(row, EXPRESSION_COLUMN);
    bot.button("...").click();
    bot.waitUntilWidgetAppears(Conditions.widgetIsEnabled(bot.styledText()));
    bot.styledText().setText(expression);
    bot.button(IDialogConstants.FINISH_LABEL).click();
    return this;
}

From source file:org.bonitasoft.studio.test.swtbot.util.SWTBotTestUtil.java

License:Open Source License

/**
 * Create a new Form and save it//  w  w  w .  j  a  v  a2  s.  com
 * @param bot
 * @param gmfEditor
 * @param nameOfStepOnwhichCreateTheForm
 * @return
 */
public static SWTBotEditor createFormWhenOnAProcessWithStep(SWTGefBot bot, SWTBotGefEditor gmfEditor,
        String nameOfStepOnwhichCreateTheForm) {
    SWTBotGefEditPart part = gmfEditor.getEditPart(nameOfStepOnwhichCreateTheForm);
    part.click();
    bot.viewById(VIEWS_PROPERTIES_APPLICATION).show();
    bot.viewById(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();
    SWTBotEditor activeEditor = bot.activeEditor();
    activeEditor.save();
    return activeEditor;
}

From source file:org.bonitasoft.studio.test.swtbot.util.SWTBotTestUtil.java

License:Open Source License

/**
 * add data wizard configuration (only for defined types as String Integer Boolean etc.)
 * @param bot//  w  w  w.j ava2  s.  c  om
 * @param name
 * @param type
 * @param multiplicity
 * @param defaultValue
 */
public static void addNewData(SWTBot bot, String name, String type, boolean multiplicity, String defaultValue) {
    bot.waitUntil(Conditions.shellIsActive(org.bonitasoft.studio.data.i18n.Messages.newVariable));
    bot.textWithLabel(org.bonitasoft.studio.data.i18n.Messages.name + " *").setText(name);
    bot.comboBoxWithLabel(org.bonitasoft.studio.data.i18n.Messages.datatypeLabel).setSelection(type);
    if (multiplicity) {
        bot.checkBox(org.bonitasoft.studio.data.i18n.Messages.isMultiple).select();
    }
    if (defaultValue != null) {
        bot.textWithLabel(org.bonitasoft.studio.data.i18n.Messages.defaultValueLabel).setText(defaultValue);
    }
    bot.button(IDialogConstants.FINISH_LABEL).click();
}

From source file:org.bonitasoft.studio.test.swtbot.util.SWTBotTestUtil.java

License:Open Source License

public static void addNewCustomDataInitWithScript(SWTGefBot bot, String name, String type,
        String defaultValueAsScript) {
    bot.waitUntil(Conditions.shellIsActive(org.bonitasoft.studio.data.i18n.Messages.newVariable));
    bot.textWithLabel(org.bonitasoft.studio.properties.i18n.Messages.name).setText(name);
    bot.comboBoxWithLabel(org.bonitasoft.studio.properties.i18n.Messages.datatypeLabel)
            .setSelection(org.bonitasoft.studio.common.Messages.JavaType);
    bot.button(org.bonitasoft.studio.data.i18n.Messages.browseClasses).click();
    bot.text().setText(type);//from   w w w. j a  v  a 2s.  c o m
    bot.waitUntil(Conditions.tableHasRows(bot.table(), 2));
    bot.table().select(0);
    bot.button(IDialogConstants.OK_LABEL).click();
    bot.waitUntil(Conditions.shellIsActive(org.bonitasoft.studio.data.i18n.Messages.newVariable));
    clickOnPenToEditExpression(bot, 0);
    SWTBotTestUtil.setScriptExpression(bot, "result", defaultValueAsScript, type);
    bot.button(IDialogConstants.FINISH_LABEL).click();
}

From source file:org.bonitasoft.studio.test.swtbot.util.SWTBotTestUtil.java

License:Open Source License

/**
 * add data with option wizard configuration (only for defined types as String Integer Boolean etc.)
 * @param bot/*from   www  . ja  va 2s. c  o  m*/
 * @param name
 * @param type
 * @param multiplicity
 * @param defaultValue
 */
public static void addListOfOptionData(SWTBot bot, String name, String type, Map<String, List<String>> options,
        boolean isMultiple, String defaultValue) {
    bot.waitUntil(Conditions.shellIsActive("New variable"));
    bot.textWithLabel(org.bonitasoft.studio.properties.i18n.Messages.name + " *").setText(name);
    bot.comboBoxWithLabel(org.bonitasoft.studio.properties.i18n.Messages.datatypeLabel).setSelection(type);
    bot.button("List of options...").click();
    bot.waitUntil(Conditions.shellIsActive("List of options"));
    int i = 0;
    for (String optionsName : options.keySet()) {
        bot.button("Add", 0).click();
        bot.table(0).click(i, 0);
        bot.text().setText(optionsName);
        int j = 0;
        for (String option : options.get(optionsName)) {
            bot.button("Add", 1).click();
            bot.table(1).click(j, 0);
            bot.text().setText(option);
            j++;
        }
        i++;
    }
    bot.button(IDialogConstants.OK_LABEL).click();
    if (isMultiple) {
        bot.checkBox("Is multiple").select();
    }
    if (defaultValue != null) {
        bot.textWithLabel(org.bonitasoft.studio.properties.i18n.Messages.defaultValueLabel)
                .setText(defaultValue);
        bot.sleep(1000);
    }
    bot.button(IDialogConstants.FINISH_LABEL).click();
}

From source file:org.bonitasoft.studio.test.swtbot.util.SWTBotTestUtil.java

License:Open Source License

/**
 * //w w w.j a v a 2  s  .c om
 * @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

public static void editEmailConnector(SWTGefBot bot, String emailName, String emailDescription, String from,
        String to, String subject, String message) {
    // 1st page/*w  w  w.ja  v  a  2 s. c om*/
    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();

}