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.redhat.ceylon.eclipse.code.preferences.CeylonBuildPathsBlock.java

License:Open Source License

public static IRemoveOldBinariesQuery getRemoveOldBinariesQuery(final Shell shell) {
    return new IRemoveOldBinariesQuery() {
        public boolean doQuery(final boolean removeFolder, final IPath oldOutputLocation)
                throws OperationCanceledException {
            final int[] res = new int[] { 1 };
            Display.getDefault().syncExec(new Runnable() {
                public void run() {
                    Shell sh = shell != null ? shell : JavaPlugin.getActiveWorkbenchShell();
                    String title = NewWizardMessages.BuildPathsBlock_RemoveBinariesDialog_title;
                    String message;
                    String pathLabel = BasicElementLabels.getPathLabel(oldOutputLocation, false);
                    if (removeFolder) {
                        message = Messages.format(
                                NewWizardMessages.BuildPathsBlock_RemoveOldOutputFolder_description, pathLabel);
                    } else {
                        message = Messages.format(
                                NewWizardMessages.BuildPathsBlock_RemoveBinariesDialog_description, pathLabel);
                    }/* w  w w.  j a  va 2  s. c  om*/
                    MessageDialog dialog = new MessageDialog(sh, title, null, message, MessageDialog.QUESTION,
                            new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
                                    IDialogConstants.CANCEL_LABEL },
                            0);
                    res[0] = dialog.open();
                }
            });
            if (res[0] == 0) {
                return true;
            } else if (res[0] == 1) {
                return false;
            }
            throw new OperationCanceledException();
        }
    };
}

From source file:com.redhat.ceylon.eclipse.code.preferences.InputDialog.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/*from  w  ww.j a v a 2  s . c  om*/
    text.setFocus();
    if (value != null) {
        text.setText(value);
        text.selectAll();
    }
}

From source file:com.redhat.ea.archimate.strategyexport.dialog.ExportDialog.java

License:Open Source License

/**
 * Create contents of the button bar./*from w w w  .j av a 2s.co  m*/
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button button_1 = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    button_1.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseUp(MouseEvent e) {
            if (_listSelection.getSelectionCount() == 0) {
                MessageDialog.openError(getParentShell(), "Missing Status Selection",
                        "Please select at least one status.");
            } else {
                close();
                _cancelled = false;
            }
        }
    });
    Button button = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    button.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseUp(MouseEvent e) {
            _cancelled = true;
            close();
        }
    });
}

From source file:com.rohanclan.snippets.core.SnipFileDialog.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
    snippetNameText.setFocus();/*from w  ww.  ja va 2s . co m*/

    if (snippetNameValue != null) {
        snippetNameText.setText(snippetNameValue);
        snippetNameText.selectAll();
    }

    if (snippetKeyComboValue != null) {
        snippetKeyComboText.setText(snippetKeyComboValue);
    }

    if (snippetDescriptionValue != null) {
        snippetDescriptionText.setText(snippetDescriptionValue);
    }

    if (snippetStartValue != null) {
        snippetStartText.setText(snippetStartValue);
    }

    if (snippetEndValue != null) {
        snippetEndText.setText(snippetEndValue);
    }
}

From source file:com.runwaysdk.manager.view.ExportDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    Button ok = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    ok.addListener(SWT.Selection, new Listener() {

        @Override//from www. jav a2  s.c  o  m
        public void handleEvent(Event e) {
            bean.validate();

            close();

            controller.exportTransactions(bean);
        }

    });

}

From source file:com.runwaysdk.manager.view.ImportDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    Button ok = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    ok.addListener(SWT.Selection, new Listener() {

        @Override/*from  www.j  a  v a 2  s  .c o  m*/
        public void handleEvent(Event e) {
            bean.validate();

            close();

            controller.importTransaction(bean);
        }
    });

}

From source file:com.safi.workshop.sqlexplorer.dialogs.FilterStructureDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {

    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.salesforce.ide.core.internal.utils.DialogUtils.java

License:Open Source License

public int retryAbortCancelMessage(String title, String message) {
    // retry is the default
    MessageDialog dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.ERROR,
            new String[] { IDialogConstants.RETRY_LABEL, IDialogConstants.ABORT_LABEL,
                    IDialogConstants.CANCEL_LABEL },
            IDialogConstants.RETRY_ID);/* ww w .j  ava  2  s  .  c o  m*/
    return dialog.open();
}

From source file:com.salesforce.ide.core.internal.utils.DialogUtils.java

License:Open Source License

public int retryOkCancelMessage(String title, String message) {
    // retry is the default
    MessageDialog dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.ERROR,
            new String[] { IDialogConstants.RETRY_LABEL, IDialogConstants.OK_LABEL,
                    IDialogConstants.CANCEL_LABEL },
            IDialogConstants.RETRY_ID);/*from  ww w .j a va2  s  .c  o  m*/
    return dialog.open();
}

From source file:com.salesforce.ide.core.internal.utils.DialogUtils.java

License:Open Source License

public int cancelMessage(String title, String message, int severity) {
    MessageDialog dialog = new MessageDialog(getShell(), title, null, message, severity,
            new String[] { IDialogConstants.CANCEL_LABEL }, IDialogConstants.CANCEL_ID);
    return dialog.open();
}