List of usage examples for org.eclipse.jface.dialogs IDialogConstants CANCEL_LABEL
String CANCEL_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants CANCEL_LABEL.
Click Source Link
From source file:com.google.dart.tools.search.internal.ui.util.ExtendedDialogWindow.java
License:Open Source License
/** * Add buttons to the dialog's button bar. Subclasses may override. * // ww w . j av a 2s . com * @param parent the button bar composite */ @Override protected void createButtonsForButtonBar(Composite parent) { fCancelButton = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:com.google.dart.tools.search2.internal.ui.SearchHistorySelectionDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OPEN_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:com.google.dart.tools.ui.actions.FormatAllAction.java
License:Open Source License
@Override public void run(IStructuredSelection selection) { CompilationUnit[] cus = getCompilationUnits(selection); if (cus.length == 0) { MessageDialog.openInformation(getShell(), ActionMessages.FormatAllAction_EmptySelection_title, ActionMessages.FormatAllAction_EmptySelection_description); return;/*from w w w . ja v a2 s . c om*/ } try { if (cus.length == 1) { DartUI.openInEditor(cus[0]); } else { int returnCode = OptionalMessageDialog.open("FormatAll", //$NON-NLS-1$ getShell(), ActionMessages.FormatAllAction_noundo_title, null, ActionMessages.FormatAllAction_noundo_message, MessageDialog.WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0); if (returnCode != OptionalMessageDialog.NOT_SHOWN && returnCode != Window.OK) { return; } } } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), ActionMessages.FormatAllAction_error_title, ActionMessages.FormatAllAction_error_message); } runOnMultiple(cus); }
From source file:com.google.dart.tools.ui.feedback.FeedbackDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { okButton = createButton(parent, IDialogConstants.OK_ID, FeedbackMessages.FeedbackDialog_OK_Button_Text, true);//from w w w . j a va 2s .co m createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); updateEnablement(); }
From source file:com.google.dart.tools.ui.internal.dialogs.MultiElementListSelectionDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, true); fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, false); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:com.google.dart.tools.ui.internal.dialogs.SortMembersMessageDialog.java
License:Open Source License
public SortMembersMessageDialog(Shell parentShell) { super(OPTIONAL_ID, parentShell, DialogsMessages.SortMembersMessageDialog_dialog_title, null, new String(), INFORMATION, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0); setShellStyle(getShellStyle() | SWT.RESIZE); fDialogSettings = DartToolsPlugin.getDefault().getDialogSettings(); boolean isSortAll = fDialogSettings.getBoolean(DIALOG_SETTINGS_SORT_ALL); fNotSortAllRadio = new SelectionButtonDialogField(SWT.RADIO); fNotSortAllRadio.setLabelText(DialogsMessages.SortMembersMessageDialog_do_not_sort_fields_label); fNotSortAllRadio.setSelection(!isSortAll); fSortAllRadio = new SelectionButtonDialogField(SWT.RADIO); fSortAllRadio.setLabelText(DialogsMessages.SortMembersMessageDialog_sort_all_label); fSortAllRadio.setSelection(isSortAll); }
From source file:com.google.gapid.views.ActivityPickerDialog.java
License:Apache License
@Override protected void createButtonsForButtonBar(Composite parent) { Button ok = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); ok.setEnabled(false);//from w ww . j a v a 2 s . c om tree.getTree().addListener(SWT.Selection, e -> ok.setEnabled(selected != null)); }
From source file:com.google.gapid.views.SettingsDialog.java
License:Apache License
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }
From source file:com.google.gdt.eclipse.designer.util.ui.ResourceSelectionDialog.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); getButton(IDialogConstants.OK_ID).setEnabled(false); }
From source file:com.google.gdt.eclipse.gph.egit.wizard.ImportProjectsWizardPage.java
License:Open Source License
/** * The <code>WizardDataTransfer</code> implementation of this * <code>IOverwriteQuery</code> method asks the user whether the existing * resource at the given path should be overwritten. * /*from www .ja v a 2s. co m*/ * @param pathString * @return the user's reply: one of <code>"YES"</code>, <code>"NO"</code>, * <code>"ALL"</code>, or <code>"CANCEL"</code> */ @Override public String queryOverwrite(String pathString) { Path path = new Path(pathString); String messageString; // Break the message up if there is a file name and a directory // and there are at least 2 segments. if (path.getFileExtension() == null || path.segmentCount() < 2) { messageString = NLS.bind("''{0}'' already exists. Would you like to overwrite it?", pathString); } else { messageString = NLS.bind("Overwrite ''{0}'' in folder ''{1}''?", path.lastSegment(), path.removeLastSegments(1).toOSString()); } final MessageDialog dialog = new MessageDialog(getContainer().getShell(), "Question", null, messageString, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.NO_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { @Override protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; String[] response = new String[] { YES, ALL, NO, NO_ALL, CANCEL }; // run in syncExec because callback is from an operation, // which is probably not running in the UI thread. getControl().getDisplay().syncExec(new Runnable() { @Override public void run() { dialog.open(); } }); return dialog.getReturnCode() < 0 ? CANCEL : response[dialog.getReturnCode()]; }