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.mobilesorcery.sdk.profiles.ui.internal.DeviceFilterDialog.java
License:Open Source License
public 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.mobilesorcery.sdk.profiles.ui.internal.SelectFilterTypeDialog.java
License:Open Source License
public void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); updateUI();//from w w w. jav a2 s.com }
From source file:com.mobilesorcery.sdk.ui.MosyncUIPlugin.java
License:Open Source License
protected void checkConfig(final IWorkbench wb) { if (!MoSyncTool.getDefault().isValid()) { wb.getDisplay().syncExec(new Runnable() { public void run() { MessageDialog dialog = new MessageDialog(wb.getModalDialogShellProvider().getShell(), "Fatal error", null, MessageFormat.format( "The environment variable MOSYNCDIR has not been properly set, or some other serious error has occurred. (Reason: {0})\n\nMoSync will not work properly. Press Ok to quit, or Cancel to continue anyway.", MoSyncTool.getDefault().validate()), MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0); if (dialog.open() == IDialogConstants.OK_ID) { wb.close();//from ww w . jav a2s. co m } } }); } }
From source file:com.mobilesorcery.sdk.ui.targetphone.internal.EditDeviceListDialog.java
License:Open Source License
@Override public void createButtonsForButtonBar(Composite parent) { Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); updateButtons();//from w ww . ja v a2 s. com }
From source file:com.motorola.studio.android.common.utilities.EclipseUtils.java
License:Apache License
/** * Show a question message using the given title and message * // ww w . jav a 2 s. c om * @param title * of the dialog * @param message * to be displayed in the dialog. */ public static int showQuestionWithCancelDialog(final String title, final String message) { class IntWrapper { public int diagReturn = 0; } final IntWrapper intWrapper = new IntWrapper(); Display.getDefault().syncExec(new Runnable() { public void run() { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow ww = workbench.getActiveWorkbenchWindow(); Shell shell = ww.getShell(); MessageDialog dialog = new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0); int diagResults = dialog.open(); switch (diagResults) { case 0: intWrapper.diagReturn = SWT.YES; break; case 1: intWrapper.diagReturn = SWT.NO; break; case 2: default: intWrapper.diagReturn = SWT.CANCEL; break; } } }); return intWrapper.diagReturn; }
From source file:com.mountainminds.eclemma.internal.ui.launching.InplaceInstrumentationHandler.java
License:Open Source License
public Object handleStatus(IStatus status, Object source) throws CoreException { ILaunchConfiguration config = (ILaunchConfiguration) source; Shell parent = EclEmmaUIPlugin.getInstance().getShell(); String title = UIMessages.InstrumentationWarning_title; String message = NLS.bind(UIMessages.InstrumentationWarning_message, config.getName()); IPreferenceStore store = EclEmmaUIPlugin.getInstance().getPreferenceStore(); if (MessageDialogWithToggle.ALWAYS .equals(store.getString(UIPreferences.PREF_ALLOW_INPLACE_INSTRUMENTATION))) { return Boolean.TRUE; }/*from ww w. j a v a 2s . com*/ MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent, title, null, message, MessageDialog.WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0, null, false); dialog.setPrefKey(UIPreferences.PREF_ALLOW_INPLACE_INSTRUMENTATION); dialog.setPrefStore(store); dialog.open(); return Boolean.valueOf(dialog.getReturnCode() == IDialogConstants.OK_ID); }
From source file:com.netxforge.screens.editing.base.dialogs.MessageDialogWithResult.java
License:Open Source License
public static String[] getButtonLabels(int kind) { String[] dialogButtonLabels;// www.j av a2s .co m switch (kind) { case ERROR: case INFORMATION: case WARNING: { dialogButtonLabels = new String[] { IDialogConstants.OK_LABEL }; break; } case CONFIRM: { dialogButtonLabels = new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }; break; } case QUESTION: { dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }; break; } case QUESTION_WITH_CANCEL: { dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }; break; } default: { throw new IllegalArgumentException("Illegal value for kind in MessageDialog.open()"); //$NON-NLS-1$ } } return dialogButtonLabels; }
From source file:com.nokia.carbide.cpp.internal.pi.button.ui.BupProfileEditDialog.java
License:Open Source License
public void cancelPressed() { if (cachedMap.haveUncommitedChanges()) { MessageDialog dialog = new MessageDialog(getShell(), Messages.getString("BupProfileEditDialog.uncommittedChanges"), //$NON-NLS-1$ null,/*from w w w.ja v a 2s .c o m*/ Messages.getString("BupProfileEditDialog.saveChanges") + profileForThisEdit.getProfileId() //$NON-NLS-1$ + "?", //$NON-NLS-1$ MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0); // default yes switch (dialog.open()) { case 0: // yes cachedMap.commitChanges(); // fall thru to no case 1: // no super.cancelPressed(); cleanUp(); case 2: // cancel default: return; } } super.cancelPressed(); cleanUp(); }
From source file:com.nokia.carbide.cpp.internal.sdk.ui.AddSBSv2ProductVariant.java
License:Open Source License
/** * Create contents of the button bar/*from ww w .ja v a 2 s. c om*/ * @param parent */ @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.nokia.carbide.cpp.uiq.components.addViewPageDialog.AddViewPageDialog.java
License:Open Source License
/** * Create contents of the button bar// w ww .j a v a2s . com * @param parent */ protected void createButtonsForButtonBar(Composite parent) { okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); if (error) { okButton.setEnabled(false); } else { okButton.setEnabled(true); } }