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.byterefinery.rmbench.dialogs.AbstractDependencyDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);
    detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
            false);//from  www.ja  va2  s .  c o m

}

From source file:com.centurylink.mdw.plugin.designer.dialogs.ActivityInstanceDialog.java

License:Apache License

protected void createButtonsForButtonBar(Composite parent) {
    if (mode.equals(Mode.VIEW)) {
        createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
        return;//  w w  w  . ja  va 2 s . co  m
    }

    if (mode.equals(Mode.RETRY)) {
        retryButton = createButton(parent, -1, "Retry", false);
        retryButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
                    public void run() {
                        statusMessage = activity.getProject().getDesignerProxy().retryActivityInstance(activity,
                                activityInstanceVO);
                    }
                });

                if (statusMessage == null || statusMessage.trim().length() == 0)
                    MessageDialog.openInformation(getShell(), "Retry Activity",
                            "Activity instance: " + activityInstanceVO.getId() + " retried");
                else
                    MessageDialog.openError(getShell(), "Retry Activity", statusMessage);

                close();
            }
        });
        if (!activity.getProcess().isUserAuthorized(UserRoleVO.PROCESS_EXECUTION))
            retryButton.setEnabled(false);
    }

    if (mode.equals(Mode.SKIP)) {
        skipButton = createButton(parent, -1, "Proceed", false);
        skipButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
                    public void run() {
                        statusMessage = activity.getProject().getDesignerProxy().skipActivityInstance(activity,
                                activityInstanceVO, completionCode);
                    }
                });

                if (statusMessage == null || statusMessage.trim().length() == 0)
                    MessageDialog.openInformation(getShell(), "Skip Activity",
                            "Activity instance: " + activityInstanceVO.getId()
                                    + " skipped with completion code: " + completionCode + ".");
                else
                    MessageDialog.openError(getShell(), "Skip Activity", statusMessage);

                close();
            }
        });
        if (!activity.getProcess().isUserAuthorized(UserRoleVO.PROCESS_EXECUTION))
            skipButton.setEnabled(false);
    }

    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);

}

From source file:com.centurylink.mdw.plugin.designer.dialogs.AttributeDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    okButton.forceFocus();//  www  .  j  a  va 2  s. co  m
}

From source file:com.centurylink.mdw.plugin.designer.dialogs.MdwMessageDialog.java

License:Apache License

public MdwMessageDialog(Shell shell, String title, String message, int level) {
    super(shell, title, null, message, MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, 0);
    this.messageLevel = level;
    this.reportMessage = level >= PluginMessages.getReportingLevel();
    this.offerSend = reportMessage;
}

From source file:com.centurylink.mdw.plugin.designer.dialogs.ProcessInstanceFilterDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    Button resetButton = createButton(parent, RESET_ID, "Reset", false);
    resetButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            resetFields();//from  w w  w  .  ja va  2 s  .  co m
        }
    });
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.centurylink.mdw.plugin.designer.dialogs.ValueDisplayDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    okButton.forceFocus();//from   w  w  w  . ja  v a 2 s.  c o m

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

From source file:com.centurylink.mdw.plugin.designer.dialogs.WorkflowElementDeleteDialog.java

License:Apache License

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

From source file:com.ceteva.mosaic.MessageDialogWithToggle.java

License:Open Source License

/**
 * Convenience method to open a simple confirm (OK/Cancel) dialog.
 *
 * @param parent the parent shell of the dialog, or <code>null</code> if none
 * @param title the dialog's title, or <code>null</code> if none
 * @param message the message//from  w  w  w .j  a  v a 2 s. c o  m
 * @param toggleMessage the message for the toggle control, or <code>null</code> 
 *   for the default message ("Don't show me this message again").
 * @param toggleState the initial state for the toggle 
 * @return the dialog, after being closed by the user, which the client can
 *       only call <code>getReturnCode()</code> or <code>getToggleState()</code>
 */
public static MessageDialogWithToggle openConfirm(Shell parent, String title, String message,
        String toggleMessage, boolean toggleState) {
    MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent, title, null, // accept the default window icon
            message, QUESTION, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0, // OK is the default
            toggleMessage, toggleState);
    dialog.open();
    return dialog;
}

From source file:com.ceteva.mosaic.MessageDialogWithToggle.java

License:Open Source License

/**
 * Convenience method to open a standard error dialog.
 *
 * @param parent the parent shell of the dialog, or <code>null</code> if none
 * @param title the dialog's title, or <code>null</code> if none
 * @param message the message// ww w  .j a v  a  2  s . c  om
 * @param toggleMessage the message for the toggle control, or <code>null</code> 
 *   for the default message ("Don't show me this message again").
 * @param toggleState the initial state for the toggle 
 * @return the dialog, after being closed by the user, which the client can
 *       only call <code>getReturnCode()</code> or <code>getToggleState()</code>
 */
public static MessageDialogWithToggle openError(Shell parent, String title, String message,
        String toggleMessage, boolean toggleState) {
    MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent, title, null, // accept the default window icon
            message, ERROR, new String[] { IDialogConstants.OK_LABEL }, 0, // ok is the default
            toggleMessage, toggleState);
    dialog.open();
    return dialog;
}

From source file:com.ceteva.mosaic.MessageDialogWithToggle.java

License:Open Source License

/**
 * Convenience method to open a standard information dialog.
 *
 * @param parent the parent shell of the dialog, or <code>null</code> if none
 * @param title the dialog's title, or <code>null</code> if none
 * @param message the message// ww w.  j av  a  2s  .c om
 * @param toggleMessage the message for the toggle control, or <code>null</code> 
 *   for the default message ("Don't show me this message again").
 * @param toggleState the initial state for the toggle 
 * @return the dialog, after being closed by the user, which the client can
 *       only call <code>getReturnCode()</code> or <code>getToggleState()</code>
 */
public static MessageDialogWithToggle openInformation(Shell parent, String title, String message,
        String toggleMessage, boolean toggleState) {
    MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent, title, null, // accept the default window icon
            message, INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0, // ok is the default 
            toggleMessage, toggleState);
    dialog.open();
    return dialog;
}