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

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

Introduction

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

Prototype

int CANCEL_ID

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

Click Source Link

Document

Button id for a "Cancel" button (value 1).

Usage

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

License:Open Source License

@Override
protected void createButtonsForButtonBar(final Composite parent) {
    final Button getButton = createButton(parent, IDialogConstants.OK_ID,
            Messages.getString("GetDialog.GetButtonText"), true); //$NON-NLS-1$

    new ButtonValidatorBinding(getButton).bind(serverItemTable.getCheckboxValidator());
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

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);//from www . j  a v  a2  s .c  o m

    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);//from w  ww .jav a2  s  .  c o m
    addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

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

License:Open Source License

@Override
protected void hookDialogAboutToClose() {
    final int idx = encodingCombo.getSelectionIndex();

    if (idx >= 0 && encodings.length > 0 && idx < encodings.length) {
        encoding = encodings[idx];//from  w  ww . ja  v a  2 s .  c  om

        /*
         * If the user selected the dashed separator line, then we treat
         * this as a cancellation.
         */
        if (encoding == null) {
            setReturnCode(IDialogConstants.CANCEL_ID);
        }
    }
}

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);//w  w  w .  ja  va2 s .  c om
        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.dialogs.vc.UnshelveDialog.java

License:Open Source License

/**
 * @param parentShell//  www . j av  a 2 s. c om
 */
public UnshelveDialog(final Shell parentShell, final TFSRepository repository) {
    super(parentShell);

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

    this.repository = repository;

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

    /*
     * Add back Unshelve/Close in their place. Order is important here, we
     * want Close (Cancel) on the right so add it last.
     */
    addButtonDescription(IDialogConstants.OK_ID, Messages.getString("UnshelveDialog.UnshelveButtonText"), true); //$NON-NLS-1$
    addButtonDescription(IDialogConstants.CANCEL_ID, Messages.getString("UnshelveDialog.CloseButtonText"), //$NON-NLS-1$
            false);

    // Add extended buttons on the left.
    addExtendedButtonDescription(DETAILS_ID, Messages.getString("UnshelveDialog.DetailsButtonText"), false); //$NON-NLS-1$
    addExtendedButtonDescription(DELETE_ID, Messages.getString("UnshelveDialog.DeleteButtonText"), false); //$NON-NLS-1$
}

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);//  ww  w .  j  a  v a2 s.  c o m

    // 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.framework.dialog.BaseDialog.java

License:Open Source License

/**
 * Subclasses may override this method to do their own handling of dialog
 * button presses. However, it is usually easier for subclasses to override
 * hookCustomButtonPressed, okPressed, or cancelPressed.
 *//*from   ww  w  . java 2 s . com*/
@Override
protected void buttonPressed(final int buttonId) {
    if (buttonId != IDialogConstants.OK_ID && buttonId != IDialogConstants.CANCEL_ID) {
        hookCustomButtonPressed(buttonId);
    } else {
        /*
         * The super implementation handles the OK and CANCEL ids, but
         * nothing else.
         */
        super.buttonPressed(buttonId);
    }
}