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

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

Introduction

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

Prototype

String CANCEL_LABEL

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

Click Source Link

Document

The label for cancel buttons.

Usage

From source file:com.siteview.mde.internal.ui.editor.schema.NewRestrictionDialog.java

License:Open Source License

public NewRestrictionDialog(Shell parent) {
    super(parent, MDEUIMessages.NewRestrictionDialog_title, null, MDEUIMessages.NewRestrictionDialog_message,
            QUESTION, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
}

From source file:com.siteview.mde.internal.ui.launcher.LauncherUtilsStatusHandler.java

License:Open Source License

/**
 * Creates a message dialog using a syncExec in case we are launching in the background.
 * Dialog will be a question dialog with Yes, No and Cancel buttons.
 * @param message Message to use in the dialog
 * @return int representing the button clicked (-1 or 2 for cancel, 0 for yes, 1 for no).
 *///from  ww w.j  a  v  a 2s.  c om
private static Integer generateDialog(final String message) {
    final int[] result = new int[1];
    getDisplay().syncExec(new Runnable() {
        public void run() {
            String title = MDEUIMessages.LauncherUtils_title;
            MessageDialog dialog = new MessageDialog(getActiveShell(), title, null, message,
                    MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL,
                            IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL },
                    0);
            result[0] = dialog.open();
        }
    });
    return new Integer(result[0]);
}

From source file:com.siteview.mde.internal.ui.launcher.PluginStatusDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    if (fShowCancelButton) {
        createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    }//  w  ww  .j a  va2 s . com
}

From source file:com.siteview.mde.internal.ui.wizards.imports.PluginImportWizard.java

License:Open Source License

public boolean performFinish() {
    page1.storeSettings();//from  ww w .  ja  va2  s.  c o  m
    ((BaseImportWizardSecondPage) page1.getNextPage()).storeSettings();
    final IMonitorModelBase[] models = getModelsToImport();
    int launchedConfiguration = getConflictingConfigurationsCount(models);
    if (launchedConfiguration > 0) {
        String message = launchedConfiguration == 1 ? MDEUIMessages.PluginImportWizard_runningConfigDesc
                : MDEUIMessages.PluginImportWizard_runningConfigsDesc;
        MessageDialog dialog = new MessageDialog(getShell(),
                MDEUIMessages.PluginImportWizard_runningConfigsTitle, null, message, MessageDialog.WARNING,
                new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
        if (dialog.open() != IDialogConstants.OK_ID)
            return false;

    }
    if (page1.getImportType() == PluginImportOperation.IMPORT_FROM_REPOSITORY) {
        if (getContainer().getCurrentPage() instanceof BaseImportWizardSecondPage) {
            // ensure to set the models to import when finished is pressed without advancing to the repository pages
            page1.configureBundleImportPages(models);
        }
    }
    // finish contributed pages
    if (!page1.finishPages()) {
        return false;
    }
    doImportOperation(page1.getImportType(), models, page2.forceAutoBuild(), launchedConfiguration > 0,
            page1.getAlternateSourceLocations(), page1.getImportDescriptions());

    return true;
}

From source file:com.softberries.klerk.gui.dialogs.AddressDialog.java

License:Open Source License

/**
 * Create contents of the button bar./*w w w. j  a v  a2s . c om*/
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);

    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    m_bindingContext = initDataBindings();
    okButton.setEnabled(getFormValid());
}

From source file:com.spextreme.jenkins.remote.ui.ConfigurationDialog.java

License:Apache License

/**
 * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
 * @param parent The parent composite./*from  ww w .jav a 2  s . c o  m*/
 */
@Override
protected void createButtonsForButtonBar(final Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, "Save", true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.symbian.smt.gui.smtwidgets.XmlFileSelectionDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);

    cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    // do this here because setting the m_text will set enablement on the ok
    // button/*from  ww  w  .  j a  v a 2s.co  m*/
    inputText.setFocus();
    if (inputValue != null) {
        inputText.setText(inputValue);
        inputText.selectAll();
    }
}

From source file:com.technophobia.substeps.editor.preferences.page.SubstepsPropertyPage.java

License:Open Source License

private ConfirmationStatus getConfirmationStatus(final IPath previousPath, final IPath newPath,
        final SubstepsFolderChangedListener folderChangeListener) {
    final MessageDialog messageDialog = new MessageDialog(getShell(), "Confirm", null,
            folderChangeListener.confirmationMessage(previousPath, newPath), MessageDialog.QUESTION_WITH_CANCEL,
            new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
                    IDialogConstants.CANCEL_LABEL },
            0);// ww  w  . jav a 2  s . c  o m
    final int status = messageDialog.open();

    return ConfirmationStatus.values()[status];
}

From source file:com.testify.ecfeed.ui.dialogs.GeneratorSetupDialog.java

License:Open Source License

/**
 * Create contents of the button bar.//from  w  w w.  j  a v a2s  .  c  o m
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    fOkButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    if (fGenerateExecutableContent) {
        for (MethodParameterNode parameter : fMethod.getMethodParameters()) {
            EImplementationStatus parameterStatus = fStatusResolver.getImplementationStatus(parameter);
            if ((parameter.getChoices().isEmpty()
                    && (parameter.isExpected() == false || JavaUtils.isUserType(parameter.getType())))
                    || parameterStatus == EImplementationStatus.NOT_IMPLEMENTED) {
                setOkButton(false);
                break;
            }
        }
    } else {
        for (MethodParameterNode parameter : fMethod.getMethodParameters()) {
            if (parameter.getChoices().isEmpty()
                    && (parameter.isExpected() == false || JavaUtils.isUserType(parameter.getType()))) {
                setOkButton(false);
                break;
            }
        }
    }

    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.testify.ecfeed.ui.wizards.NewEcFileWizard.java

License:Open Source License

public boolean performFinish() {
    IFile file = fPage.createNewFile();/*from   www . j  a v  a2s. c o m*/
    try {

        if (file.getContents().read() != -1) {
            MessageDialog dialog = new MessageDialog(getShell(), Messages.WIZARD_FILE_EXISTS_TITLE,
                    Display.getDefault().getSystemImage(SWT.ICON_QUESTION), Messages.WIZARD_FILE_EXISTS_MESSAGE,
                    MessageDialog.QUESTION_WITH_CANCEL,
                    new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL },
                    IDialogConstants.OK_ID);
            if (dialog.open() != IDialogConstants.OK_ID) {
                return false;
            }
        }

        final IPath newFileFullPath = fPage.getContainerFullPath().append(fPage.getFileName());
        String modelName = newFileFullPath.removeFileExtension().lastSegment();
        RootNode model = new RootNode(modelName != null ? modelName : Constants.DEFAULT_NEW_ECT_MODEL_NAME);
        ByteArrayOutputStream ostream = new ByteArrayOutputStream();
        new EctSerializer(ostream).serialize(model);
        ByteArrayInputStream istream = new ByteArrayInputStream(ostream.toByteArray());
        file.setContents(istream, true, true, null);

        //open new file in an ect editor
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();

        page.openEditor(new FileEditorInput(file), Constants.ECT_EDITOR_ID);
    } catch (Exception e) {
        e.printStackTrace();
    }

    return true;
}