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.microsoft.tfs.client.common.ui.dialogs.vc.ModifyFolderMappingDialog.java

License:Open Source License

public ModifyFolderMappingDialog(final Shell parentShell, final Workspace workspace,
        final String repositoryFolder, final String localFolder) {
    super(parentShell);

    Check.notNull(workspace, "workspace"); //$NON-NLS-1$
    Check.notNull(repositoryFolder, "repositoryFolder"); //$NON-NLS-1$

    this.repositoryFolder = repositoryFolder;
    this.localFolder = localFolder;
    this.mappingReason = getMappingStatusText(workspace, repositoryFolder);

    this.setOptionIncludeDefaultButtons(false);
    addButtonDescription(IDialogConstants.OK_ID, getOkButtonText(), true);
    addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.microsoft.tfs.client.common.ui.dialogs.vc.PromoteCandidateChangesDialog.java

License:Open Source License

public PromoteCandidateChangesDialog(final Shell parentShell, final TFSRepository repository,
        final ChangeItem[] candidates) {
    super(parentShell);
    this.repository = repository;
    this.candidates = candidates;

    // Disable standard OK/Cancel buttons.
    setOptionIncludeDefaultButtons(false);

    // Add back Promote/Close in their place. Order is important here, we
    // want Cancel on the right so add it last.
    addButtonDescription(IDialogConstants.OK_ID,
            Messages.getString("PromoteCandidateChangesDialog.PromoteButtonText"), //$NON-NLS-1$
            true);//  w w  w  .  j  ava2  s  .  com

    addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.microsoft.tfs.client.common.ui.dialogs.vc.PropertiesDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(final Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.microsoft.tfs.client.common.ui.dialogs.vc.RollbackItemDialog.java

License:Open Source License

public RollbackItemDialog(final Shell parentShell, final String initialItem, final TFSRepository repository,
        final VersionSpec fromVersion, final VersionSpec toVersion) {
    super(parentShell);

    this.item = initialItem;
    this.repository = repository;
    this.fromVersion = fromVersion;
    this.toVersion = toVersion;

    setOptionIncludeDefaultButtons(false);

    addButtonDescription(IDialogConstants.OK_ID, Messages.getString("RollbackItemDialog.RollbackButton"), //$NON-NLS-1$
            false);// w w  w  .  ja va  2 s  .com
    addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.microsoft.tfs.client.common.ui.dialogs.vc.ShelvesetDetailsDialog.java

License:Open Source License

public ShelvesetDetailsDialog(final Shell parentShell, final Shelveset shelveset,
        final TFSRepository repository, final boolean allowUnshelve) {
    super(parentShell);
    this.shelveset = shelveset;
    this.repository = repository;
    dateFormat = DateHelper.getDefaultDateTimeFormat();
    this.allowUnshelve = allowUnshelve;

    setOptionIncludeDefaultButtons(false);

    if (allowUnshelve) {
        addButtonDescription(IDialogConstants.OK_ID,
                Messages.getString("ShelvesetDetailsDialog.UnshelveButtonText"), //$NON-NLS-1$
                true);//from   w ww .  j  ava2  s  . c o  m
        addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    } else {
        addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CLOSE_LABEL, true);
    }
}

From source file:com.microsoft.tfs.client.common.ui.feedback.FeedbackDialog.java

License:Open Source License

public FeedbackDialog(final Shell parentShell, final boolean smile) {
    super(parentShell);
    this.smile = smile;
    setOptionResizable(true);//from ww w .  j a  va 2s .  c om

    // rename the label
    final String okLabel = smile ? Messages.getString("FeedbackDialog.OkButtonText.Smile") //$NON-NLS-1$
            : Messages.getString("FeedbackDialog.OkButtonText.Frown"); //$NON-NLS-1$

    setOptionIncludeDefaultButtons(false);
    addButtonDescription(IDialogConstants.OK_ID, okLabel, true);
    addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.microsoft.tfs.client.common.ui.teambuild.dialogs.QueueBuildDialog.java

License:Open Source License

public QueueBuildDialog(final Shell parentShell, final IBuildDefinition buildDefinition) {
    super(parentShell);

    selectedBuildDefinition = buildDefinition;
    buildServer = selectedBuildDefinition.getBuildServer();
    teamProject = selectedBuildDefinition.getTeamProject();

    final TeamBuildCache cache = TeamBuildCache.getInstance(buildServer, teamProject);

    buildDefinitions = cache.getBuildDefinitions(false);
    buildControllers = cache.getBuildControllers(false);

    defaultQueuePriorityText = buildServer.getDisplayText(QueuePriority.NORMAL);
    image = getSWTImage(SWT.ICON_INFORMATION);
    setOptionIncludeDefaultButtons(false);
    addButtonDescription(IDialogConstants.OK_ID, Messages.getString("QueueBuildDialog.QueueButtonText"), true); //$NON-NLS-1$
    addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.microsoft.tfs.client.common.ui.teambuild.dialogs.QueueBuildDialog.java

License:Open Source License

public QueueBuildDialog(final Shell parentShell, final IBuildDefinition selectedBuildDefinition,
        final IBuildServer buildServer, final String teamProjectName, final IBuildDefinition[] buildDefinitions,
        final IBuildController[] buildControllers) {
    super(parentShell);
    this.selectedBuildDefinition = selectedBuildDefinition;
    this.buildServer = buildServer;
    teamProject = teamProjectName;//from w  w w.  jav a  2  s .c om
    this.buildDefinitions = buildDefinitions;
    this.buildControllers = buildControllers;

    defaultQueuePriorityText = this.buildServer.getDisplayText(QueuePriority.NORMAL);
    image = getSWTImage(SWT.ICON_INFORMATION);
    setOptionIncludeDefaultButtons(false);
    addButtonDescription(IDialogConstants.OK_ID, Messages.getString("QueueBuildDialog.QueueButtonText"), true); //$NON-NLS-1$
    addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.mindquarry.desktop.preferences.dialog.FilteredPreferenceDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    getShell().setDefaultButton(okButton);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.mobilesorcery.sdk.importproject.MoSyncWizardProjectsImportPage.java

License:Open Source License

/**
 * The <code>WizardDataTransfer</code> implementation of this
 * <code>IOverwriteQuery</code> method asks the user whether the existing
 * resource at the given path should be overwritten.
 *
 * @param pathString/*from ww  w.ja va2s .  c  o m*/
 * @return the user's reply: one of <code>"YES"</code>, <code>"NO"</code>,
 *    <code>"ALL"</code>, or <code>"CANCEL"</code>
 */
@Override
public String queryOverwrite(String pathString) {

    Path path = new Path(pathString);

    String messageString;
    // Break the message up if there is a file name and a directory
    // and there are at least 2 segments.
    if (path.getFileExtension() == null || path.segmentCount() < 2) {
        messageString = NLS.bind(IDEWorkbenchMessages.WizardDataTransfer_existsQuestion, pathString);
    } else {
        messageString = NLS.bind(IDEWorkbenchMessages.WizardDataTransfer_overwriteNameAndPathQuestion,
                path.lastSegment(), path.removeLastSegments(1).toOSString());
    }

    final MessageDialog dialog = new MessageDialog(getContainer().getShell(), IDEWorkbenchMessages.Question,
            null, messageString, MessageDialog.QUESTION,
            new String[] { IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL,
                    IDialogConstants.NO_LABEL, IDialogConstants.NO_TO_ALL_LABEL,
                    IDialogConstants.CANCEL_LABEL },
            0) {
        @Override
        protected int getShellStyle() {
            return super.getShellStyle() | SWT.SHEET;
        }
    };
    String[] response = new String[] { YES, ALL, NO, NO_ALL, CANCEL };
    // run in syncExec because callback is from an operation,
    // which is probably not running in the UI thread.
    getControl().getDisplay().syncExec(new Runnable() {
        @Override
        public void run() {
            dialog.open();
        }
    });
    return dialog.getReturnCode() < 0 ? CANCEL : response[dialog.getReturnCode()];
}