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

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

Introduction

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

Prototype

String OK_LABEL

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

Click Source Link

Document

The label for OK buttons.

Usage

From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorDefinitionTranslationsTest.java

License:Open Source License

private void createWidget(String widgetId, String widgetType, int inputIndex) throws Exception {
    bot.button("Add...").click();
    assertFalse("button ok should be disabled", bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.textWithLabel("Widget id*").setText(widgetId);
    bot.comboBoxWithLabel("Widget type").setSelection(widgetType);
    if (!widgetType.equals("Group")) {
        bot.comboBoxWithLabel("Input *").setSelection(inputIndex);
    } else {/*from ww w .  j a va 2s  . co m*/
        assertFalse("inputs combo box should be disabled for Group widget",
                bot.comboBoxWithLabel("Input *").isEnabled());
    }
    assertTrue("button ok should be enabled", bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.button(IDialogConstants.OK_LABEL).click();
}

From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionTest.java

License:Open Source License

@Test
public void testCreateExistingCategory() throws Exception {
    final String id = "test7";
    final String version = "1.0.0";
    final String categoryId = "category3";
    SWTBotActorFilterUtil.createActorFilterDefinition(bot, id, version);
    SWTBotActorFilterUtil.createNewCategory(bot, categoryId);
    bot.button("New...").click();
    bot.textWithLabel("Id").setText(categoryId);
    assertFalse("Ok button should be disabled when trying to create an existing category",
            bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.button(IDialogConstants.CANCEL_LABEL).click();
    bot.button(IDialogConstants.FINISH_LABEL).click();
}

From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionWizardPageTest.java

License:Open Source License

private void createWidget(String widgetId, String widgetType, int inputIndex) throws Exception {
    bot.button("Add...").click();
    assertFalse("button ok should be disabled", bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.textWithLabel("Widget id*").setText(widgetId);
    bot.comboBoxWithLabel("Widget type").setSelection(widgetType);
    if (!widgetType.equals("Group")) {
        bot.comboBoxWithLabel("Input *").setSelection(inputIndex);
    } else {//  w  w  w .  j  a  v a2 s.c  o  m
        assertFalse("inputs combo box should be disabled for Group widget",
                bot.comboBoxWithLabel("Input *").isEnabled());
    }
    assertTrue("button ok should be enabled", bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.OK_LABEL)), 5000);
    bot.button(IDialogConstants.OK_LABEL).click();

}

From source file:org.bonitasoft.studio.actors.tests.SWTbot.SWTBotActorFilterUtil.java

License:Open Source License

/**
 * use it when the wizard "New  definition" is active. (menu
 * development>Actors filters>New definition...)
 * /*from  w ww  .jav  a2  s  . c  om*/
 * @param bot
 * @param categoryId
 * @throws Exception
 */
public static void createNewCategory(SWTBot bot, String categoryId) throws Exception {
    bot.waitUntil(Conditions.widgetIsEnabled((bot.button("New..."))), 10000);
    bot.button("New...").click();
    Assert.assertFalse("ok button should be desabled", bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.textWithLabel("Id").setText(categoryId);
    bot.textWithLabel("Display name").setText(categoryId);
    bot.button(IDialogConstants.OK_LABEL).click();
}

From source file:org.bonitasoft.studio.actors.tests.SWTbot.SWTBotActorFilterUtil.java

License:Open Source License

/**
 * use it when the wizard "New  definition" is active. (menu
 * development>Actors filters>New definition...)
 * /*from  w w  w  .ja  va2  s.  c o m*/
 * @param bot
 * @param categoryId
 * @throws Exception
 */
public static void addCategory(SWTBot bot) {
    SWTBotShell shell = bot.activeShell();
    Assert.assertFalse("ok button should be desabled", bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.table().select(0);
    bot.button(IDialogConstants.OK_LABEL).click();

}

From source file:org.bonitasoft.studio.application.actions.SaveCommandHandler.java

License:Open Source License

/**
 * @param proc/* w  w w  . ja  v  a  2 s.  c o  m*/
 * @return
 */
protected boolean nameOrVersionChanged(MainProcess proc) {
    MainProcess originalProcess = getOldProcess(proc);
    if (originalProcess.getAuthor() == null && BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore()
            .getBoolean(BonitaPreferenceConstants.ASK_RENAME_ON_FIRST_SAVE)) {
        DiagramRepositoryStore diagramStore = (DiagramRepositoryStore) RepositoryManager.getInstance()
                .getRepositoryStore(DiagramRepositoryStore.class);
        final OpenNameAndVersionForDiagramDialog nameDialog = new OpenNameAndVersionForDiagramDialog(
                Display.getDefault().getActiveShell(), proc, diagramStore) {

            private boolean askRename = true;

            @Override
            protected void createButtonsForButtonBar(Composite parent) {
                GridData gridData = (GridData) parent.getLayoutData();
                gridData.horizontalAlignment = SWT.FILL;
                ((GridLayout) parent.getLayout()).numColumns++;
                ((GridLayout) parent.getLayout()).makeColumnsEqualWidth = false;
                final Button askAgainButton = new Button(parent, SWT.CHECK);
                askAgainButton.setText(Messages.doNotDisplayForOtherDiagrams);
                askAgainButton.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.CENTER)
                        .grab(true, false).create());
                askAgainButton.addSelectionListener(new SelectionAdapter() {

                    @Override
                    public void widgetSelected(SelectionEvent e) {
                        askRename = !askAgainButton.getSelection();
                    }
                });
                createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true)
                        .addSelectionListener(new SelectionAdapter() {
                            @Override
                            public void widgetSelected(SelectionEvent e) {
                                BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore().setValue(
                                        BonitaPreferenceConstants.ASK_RENAME_ON_FIRST_SAVE, askRename);
                            }
                        });
            }
        };
        if (nameDialog.open() == Dialog.OK) {
            EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(proc);
            final ProcessNamingTools tool = new ProcessNamingTools(domain);
            tool.changeProcessNameAndVersion(proc, nameDialog.getDiagramName(), nameDialog.getDiagramVersion());
            for (ProcessesNameVersion pnv : nameDialog.getPools()) {
                tool.changeProcessNameAndVersion(pnv.getAbstractProcess(), pnv.getNewName(),
                        pnv.getNewVersion());
            }
        }

    }
    return !(originalProcess.getName().equals(proc.getName())
            && originalProcess.getVersion().equals(proc.getVersion()));
}

From source file:org.bonitasoft.studio.application.BonitaStudioApplication.java

License:Open Source License

protected void openErrorDialog(final Display display, final String javaVersion) {
    final Shell shell = new Shell(display);
    try {/*from   w w  w.j  a v a 2s.c om*/
        final Version version = Version.parseVersion(ProductVersion.CURRENT_VERSION);
        final String uriWithProductVersion = ONLINE_DOC_REQUIREMENTS + version.getMajor() + "."
                + version.getMinor();
        final URI uri = new URI(uriWithProductVersion);
        final MessageDialogWithLink messageDialog = new MessageDialogWithLink(shell,
                Messages.incompatibleJavaVersionTitle, null,
                Messages.bind(Messages.incompatibleJavaVersionMessage,
                        org.bonitasoft.studio.common.Messages.bonitaStudioModuleName, javaVersion),
                MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, 0, uri);
        messageDialog.open();
    } catch (final URISyntaxException e) {
        BonitaStudioLog.error(e);
    } finally {
        shell.dispose();
    }
}

From source file:org.bonitasoft.studio.application.dialog.ExitDialog.java

License:Open Source License

public static ExitDialog openExitDialog(final Shell parentShell) {
    final ExitDialog exitDialog = new ExitDialog(parentShell,
            IDEWorkbenchMessages.PromptOnExitDialog_shellTitle, null, null, WARNING,
            new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0,
            IDEWorkbenchMessages.PromptOnExitDialog_choice, false);
    exitDialog.open();/*from w  w w  . ja  v  a 2  s . com*/
    return exitDialog;
}

From source file:org.bonitasoft.studio.businessobject.ui.wizard.editingsupport.QueryContentEditingSupport.java

License:Open Source License

@Override
protected CellEditor getCellEditor(final Object element) {
    return new DialogCellEditor((Composite) getViewer().getControl()) {

        @Override/*from   w  w  w .ja v  a2  s.co m*/
        protected Object openDialogBox(Control cellEditorWindow) {
            Query query = (Query) element;
            QueryWizard queryWizard = new QueryWizard((BusinessObject) businessObjectObservable.getValue(),
                    query);
            CustomWizardDialog dialog = new CustomWizardDialog(cellEditorWindow.getShell(), queryWizard,
                    IDialogConstants.OK_LABEL);
            if (dialog.open() == Dialog.OK) {
                return queryWizard.getQueryWorkingCopy();
            }
            return null;
        }
    };
}

From source file:org.bonitasoft.studio.businessobject.ui.wizard.editingsupport.ReadOnlyQueryContentEditingSupport.java

License:Open Source License

@Override
protected CellEditor getCellEditor(final Object element) {
    return new DialogCellEditor((Composite) getViewer().getControl()) {

        @Override/*  ww  w . ja v  a  2  s . c o m*/
        protected Object openDialogBox(Control cellEditorWindow) {
            Query query = (Query) element;
            QueryWizard queryWizard = new ReadOnlyQueryWizard(
                    (BusinessObject) businessObjectObservable.getValue(), query);
            CustomWizardDialog dialog = new CustomWizardDialog(cellEditorWindow.getShell(), queryWizard,
                    IDialogConstants.OK_LABEL);
            dialog.open();
            return null;
        }
    };
}