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:com.microsoft.azuretools.azureexplorer.forms.createrediscache.CreateRedisCacheForm.java

License:Open Source License

/**
 * Create contents of the button bar.//from   www.  j  a  v a  2 s.co m
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    btnOK = getButton(IDialogConstants.OK_ID);
    btnOK.setEnabled(false);
}

From source file:com.microsoft.azuretools.core.ui.SrvPriCreationStatusDialog.java

License:Open Source License

/**
 * Create contents of the button bar.// w w  w. ja v a  2s. c om
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button button = createButton(parent, IDialogConstants.FINISH_ID, IDialogConstants.OK_LABEL, true);
    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            onOk();
        }
    });
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.microsoft.azuretools.core.ui.SrvPriSettingsDialog.java

License:Open Source License

/**
 * Create contents of the button bar./*from  www. j av  a2 s  .  c  o  m*/
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button btnOk = createButton(parent, IDialogConstants.FINISH_ID, IDialogConstants.OK_LABEL, true);
    btnOk.setEnabled(true);
    btnOk.setText("Start");
    btnOk.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            onOk();
        }
    });
    Button btnCancel = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    btnCancel.setEnabled(true);
    btnCancel.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
        }
    });
}

From source file:com.microsoft.tfs.client.common.ui.dialogs.generic.LineItemInformationDialog.java

License:Open Source License

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

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

License:Open Source License

@Override
protected void hookCustomButtonPressed(final int buttonId) {
    if (buttonId == IDialogConstants.HELP_ID) {
        final String text = Messages.getString("PolicyScopeDialog.CheckInPolicyRegexDialogText"); //$NON-NLS-1$

        final MessageDialog dialog = new MessageDialog(getShell(),
                Messages.getString("PolicyScopeDialog.CheckInPolicyRegexDialogTitle"), //$NON-NLS-1$
                null, text, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0);

        dialog.open();//www.j  a  va  2  s  .  c o  m
    }
}

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

License:Open Source License

@Override
protected void createButtonsForButtonBar(final Composite parent) {
    if (closeOnlyMode) {
        addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CLOSE_LABEL, true);
    } else {//from   ww  w.  ja v  a2  s  .co m
        addButtonDescription(IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
        addButtonDescription(IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    }

    super.createButtonsForButtonBar(parent);
}

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.framework.diagnostics.ui.SupportDialog.java

License:Open Source License

public SupportDialog(final Shell parentShell, final SupportProvider supportProvider,
        final DataProviderCollection dataProviderCollection, final ClassLoader classLoader,
        final Map contextObjects) {
    super(parentShell);

    this.supportProvider = supportProvider;
    this.dataProviderCollection = dataProviderCollection;
    setOptionIncludeDefaultButtons(false);
    addButtonDescription(EXPORT_ID, Messages.getString("SupportDialog.ExportButtonText"), false); //$NON-NLS-1$
    addButtonDescription(REFRESH_ID, Messages.getString("SupportDialog.RefreshButtonText"), false); //$NON-NLS-1$
    addButtonDescription(IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
}

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

License:Open Source License

@Override
protected void hookAddToDialogArea(final Composite dialogArea) {
    final GridLayout dialogLayout = new GridLayout(2, false);
    dialogLayout.marginWidth = getHorizontalMargin();
    dialogLayout.marginHeight = getVerticalMargin();
    dialogLayout.horizontalSpacing = getHorizontalSpacing() * 2;
    dialogLayout.verticalSpacing = getVerticalSpacing();
    dialogArea.setLayout(dialogLayout);/*  w  w  w. ja  v  a  2s .  c om*/

    final Image image = getBuildDetailImage();

    if (image != null) {
        final Label imageLabel = new Label(dialogArea, SWT.NONE);
        imageLabel.setImage(image);
        GridDataBuilder.newInstance().vAlignTop().applyTo(imageLabel);
    }

    /* Create a composite for the many labels we're displaying. */
    final Composite messageComposite = new Composite(dialogArea, SWT.NONE);
    GridDataBuilder.newInstance().hSpan(image != null ? 1 : 2).hAlignFill().vAlignTop().hFill()
            .applyTo(messageComposite);

    final GridLayout messageCompositeLayout = new GridLayout(1, true);
    messageCompositeLayout.marginWidth = 0;
    messageCompositeLayout.marginHeight = 0;
    messageCompositeLayout.horizontalSpacing = getHorizontalSpacing();
    messageCompositeLayout.verticalSpacing = getVerticalSpacing();
    messageComposite.setLayout(messageCompositeLayout);

    final Label titleLabel = new Label(messageComposite, SWT.WRAP);
    titleLabel.setText(getBuildDetailTitle());
    titleLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    GridDataBuilder.newInstance().hAlignFill().vAlignTop().hFill().wHint(getMinimumMessageAreaWidth())
            .applyTo(titleLabel);

    if (buildDetail != null) {
        final Composite buildDetailComposite = createBuildDetailMessages(messageComposite);
        GridDataBuilder.newInstance().hAlignFill().vAlignTop().hFill().applyTo(buildDetailComposite);

        /*
         * Provide an informative label about their options for gated
         * checkins
         */
        final String helpMessage = getBuildHelpMessage();
        if (helpMessage != null) {
            final Label helpLabel = new Label(messageComposite, SWT.WRAP);
            helpLabel.setText(helpMessage);
            GridDataBuilder.newInstance().hAlignFill().vAlignTop().hFill().wHint(getMinimumMessageAreaWidth())
                    .applyTo(helpLabel);
        }
    }

    /* Provide some space between the button area and the message area */
    final Label spacerLabel = new Label(dialogArea, SWT.NONE);
    GridDataBuilder.newInstance().hSpan(2).applyTo(spacerLabel);

    final Button neverShowButton = new Button(dialogArea, SWT.CHECK | SWT.LEFT);
    neverShowButton
            .setText(Messages.getString("BuildStatusNotificationDialog.NeverShowNotificationToggleMessage")); //$NON-NLS-1$
    neverShowButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            neverShowToggle = neverShowButton.getSelection();
        }
    });
    GridDataBuilder.newInstance().hSpan(2).applyTo(neverShowButton);

    /*
     * Can only unshelve failed (or partially successful) builds
     */
    final boolean unshelve = (buildDetail != null && buildDetail.isBuildFinished()
            && (buildDetail.getStatus().contains(BuildStatus.FAILED)
                    || buildDetail.getStatus().contains(BuildStatus.PARTIALLY_SUCCEEDED))
            && buildDetail.getReason().contains(BuildReason.CHECK_IN_SHELVESET));

    /*
     * Can only reconcile successfully (or partially successful) builds that
     * were checked in (ie, have a non-negative changeset id)
     */
    final boolean reconcile = (buildDetail != null && buildDetail.isBuildFinished()
            && (buildDetail.getStatus().contains(BuildStatus.SUCCEEDED)
                    || buildDetail.getStatus().contains(BuildStatus.PARTIALLY_SUCCEEDED))
            && buildDetail.getReason().contains(BuildReason.CHECK_IN_SHELVESET)
            && InformationNodeConverters.getChangesetID(buildDetail.getInformation()) > 0);

    /*
     * If we're not offering reconcile or unshelve, this is simply a build
     * completion alert. In this case, only offer an okay button.
     */
    if (unshelve || reconcile) {
        if (reconcile) {
            /*
             * Reconcile should be in the OK position (the default button)
             */
            addButtonDescription(RECONCILE_BUTTON_ID,
                    Messages.getString("BuildStatusNotificationDialog.ReconcileButtonLabel"), //$NON-NLS-1$
                    true);
        }

        if (unshelve) {
            /*
             * Unshelve should be in the OK position (the default button)
             * unless there's a reconcile
             */
            addButtonDescription(UNSHELVE_BUTTON_ID,
                    Messages.getString("BuildStatusNotificationDialog.UnshelveButtonLabel"), //$NON-NLS-1$
                    (!reconcile));
        }

        /*
         * Note: all non-action buttons (ie, any buttons that are not
         * unshelve or reconcile) always return cancel id, indicating that
         * no action was performed and the build should still be considered
         * "watched".
         */
        addButtonDescription(IGNORE_BUTTON_ID,
                Messages.getString("BuildStatusNotificationDialog.IgnoreButtonLabel"), //$NON-NLS-1$
                false);
    } else {
        /*
         * Note: all non-action buttons (ie, any buttons that are not
         * unshelve or reconcile) always return cancel id, indicating that
         * no action was performed and the build should still be considered
         * "watched".
         */
        addButtonDescription(IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    }
}

From source file:com.microsoft.tfs.client.eclipse.ui.dialogs.vc.ReturnOnlineErrorDialog.java

License:Open Source License

public ReturnOnlineErrorDialog(final Shell shell) {
    super(shell);

    /* This is informative only, only provide an ok button. */
    setOptionIncludeDefaultButtons(false);
    addButtonDescription(IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
}