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.aptana.js.debug.ui.internal.LaunchConfigurationsHelper.java

License:Open Source License

public static String showBrowserNotFoundDialog(final boolean download) {
    final String[] path = new String[] { null };
    UIUtils.getDisplay().syncExec(new Runnable() {
        public void run() {
            MessageDialogWithToggle md = new MessageDialogWithToggle(UIUtils.getActiveShell(),
                    Messages.Startup_Notification, null, Messages.Startup_StudioRequiresFirefox,
                    MessageDialog.INFORMATION,
                    new String[] { StringUtil.ellipsify(CoreStrings.BROWSE),
                            download ? Messages.Startup_Download : Messages.Startup_CheckAgain,
                            IDialogConstants.CANCEL_LABEL },
                    0, Messages.Startup_DontAskAgain, false);
            md.setPrefKey(com.aptana.js.debug.ui.internal.IJSDebugUIConstants.PREF_SKIP_FIREFOX_CHECK);
            md.setPrefStore(JSDebugUIPlugin.getDefault().getPreferenceStore());

            int returnCode = md.open();
            switch (returnCode) {
            case IDialogConstants.INTERNAL_ID:
                FileDialog fileDialog = new FileDialog(
                        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN);
                if (Platform.OS_WIN32.equals(Platform.getOS())) {
                    fileDialog.setFilterExtensions(new String[] { "*.exe" }); //$NON-NLS-1$
                    fileDialog.setFilterNames(new String[] { Messages.Startup_ExecutableFiles });
                }//from   w w w. j ava 2s.c  o  m
                path[0] = fileDialog.open();
                break;
            case IDialogConstants.INTERNAL_ID + 1:
                if (download) {
                    WorkbenchBrowserUtil.launchExternalBrowser("http://www.getfirefox.com"); //$NON-NLS-1$
                }
                path[0] = StringUtil.EMPTY;
                break;
            default:
            }
        }
    });
    return path[0];
}

From source file:com.aptana.js.debug.ui.internal.LaunchDebuggerPromptStatusHandler.java

License:Open Source License

/**
 * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
 *///from ww w . ja v a  2 s. c om
public Object handleStatus(IStatus status, Object source) throws CoreException {
    Shell shell = UIUtils.getActiveShell();
    String title = Messages.LaunchDebuggerPromptStatusHandler_Title;
    String message = Messages.LaunchDebuggerPromptStatusHandler_DebuggerSessionIsActive;

    MessageDialog dlg = new MessageDialog(shell, title, null, message, MessageDialog.INFORMATION, new String[] {
            Messages.LaunchDebuggerPromptStatusHandler_CloseActiveSession, IDialogConstants.CANCEL_LABEL }, 1);
    return Boolean.valueOf(dlg.open() == Window.OK);
}

From source file:com.aptana.radrails.cloud.internal.EndpointDialog.java

License:Open Source License

/**
 * Create contents of the button bar//from w  w w . j  a  v  a 2  s  .  com
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    getButton(IDialogConstants.OK_ID).setText(Messages.EndpointDialog_LBL_Deploy_button);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.aptana.terminal.internal.TerminalCloseHelper.java

License:Open Source License

public static boolean canCloseTerminal(IShellProvider shellProvider, LocalTerminalConnector terminalConnector) {
    List<String> processes = terminalConnector.getRunningProcesses();
    if (processes.size() < 2) {
        return true;
    }// w  w w  .j av  a2 s.  c  om

    int closeId = 1;
    MessageDialog dialog = new MessageDialog(shellProvider.getShell(), Messages.TerminalCloseHelper_DialogTitle,
            null, Messages.TerminalCloseHelper_DialogMessage + processes.toString(), MessageDialog.QUESTION,
            new String[] { IDialogConstants.CANCEL_LABEL, IDialogConstants.CLOSE_LABEL }, closeId);
    return dialog.open() == closeId;
}

From source file:com.aptana.ui.dialogs.HyperlinkMessageDialog.java

License:Open Source License

public static String[] getButtonLabels(int kind) {
    switch (kind) {
    case ERROR://from w w w.  j  a v  a  2  s . co m
    case INFORMATION:
    case WARNING:
        return new String[] { IDialogConstants.OK_LABEL };
    case CONFIRM:
        return new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL };
    case QUESTION:
        return new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL };
    case QUESTION_WITH_CANCEL:
        return new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
                IDialogConstants.CANCEL_LABEL };
    default:
        throw new IllegalArgumentException("Illegal value for kind in HyperlinkMessageDialog.open()"); //$NON-NLS-1$
    }
}

From source file:com.aptana.ui.dialogs.InputMessageDialog.java

License:Open Source License

public InputMessageDialog(JsonNode questionNode, String title, String description) {
    super(UIUtils.getActiveShell(), title, null, description, MessageDialog.CONFIRM,
            new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
    this.dialogMessage = questionNode.path(MESSAGE).asText();
    this.inputType = questionNode.path(TYPE).asText();
    this.values = (ArrayNode) questionNode.path(CHOICES);

    input = new ArrayList<Object>();
}

From source file:com.aptana.ui.dialogs.InputURLDialog.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);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    //do this here because setting the text will set enablement on the ok button
    loadList();/*from  w ww . j  a va2  s .  c om*/
    combo.setFocus();
    if (value != null) {
        combo.setText(value);
        setErrorMessage(null);
        if (validator.isValid(value) != null) {
            Control button = getButton(IDialogConstants.OK_ID);
            if (button != null) {
                button.setEnabled(false);
            }

        }
    }
}

From source file:com.aptana.ui.dialogs.MultipleInputMessageDialog.java

License:Open Source License

public MultipleInputMessageDialog(JsonNode questionNode, String dialogTitle, String dialogMessage) {
    super(UIUtils.getDisplay().getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.CONFIRM,
            new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
    this.questionsNode = questionNode;
    userInput = JsonNodeFactory.instance.objectNode();
}

From source file:com.archimatetool.editor.model.impl.EditorModelManager.java

License:Open Source License

/**
 * Show dialog to save modified model//from   w w  w .  j av a 2 s  . c  om
 * @param model
 * @return true if the user chose to save the model or chose not to save the model, false if cancelled
 * @throws IOException 
 */
private boolean askSaveModel(IArchimateModel model) throws IOException {
    MessageDialog dialog = new MessageDialog(Display.getCurrent().getActiveShell(),
            Messages.EditorModelManager_6, null, NLS.bind(Messages.EditorModelManager_7, model.getName()),
            MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
                    IDialogConstants.CANCEL_LABEL },
            0);

    int result = dialog.open();

    // Yes
    if (result == 0) {
        return saveModel(model);
    }
    // No
    if (result == 1) {
        return true;
    }
    // Cancel
    return false;
}

From source file:com.arm.cmsis.pack.installer.CopyExampleDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    fCopyButton = createButton(parent, IDialogConstants.OK_ID, "Copy", true); //$NON-NLS-1$
    if (fShowAttention) {
        fCopyButton.setEnabled(false);/*from www  .  j a va2 s  .c o  m*/
    }
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}