List of usage examples for org.eclipse.jface.dialogs IDialogConstants NO_LABEL
String NO_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants NO_LABEL.
Click Source Link
From source file:com.arm.cmsis.pack.installer.OverwriteQuery.java
License:Open Source License
@Override public String queryOverwrite(String pathString) { Path path = new Path(pathString); String messageString;//from w w w . j a va 2 s. c o m //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(Messages.OverwriteQuery_ExistsQuestion, pathString); } else { messageString = NLS.bind(Messages.OverwriteQuery_OverwriteNameAndPathQuestion, path.lastSegment(), path.removeLastSegments(1).toOSString()); } final MessageDialog dialog = new MessageDialog(shell, Messages.OverwriteQuery_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. shell.getDisplay().syncExec(new Runnable() { @Override public void run() { dialog.open(); } }); return dialog.getReturnCode() < 0 ? CANCEL : response[dialog.getReturnCode()]; }
From source file:com.astra.ses.spell.gui.dialogs.PromptDialog.java
License:Open Source License
/*************************************************************************** * Create the button bar buttons./*from ww w . j a v a 2s. c o m*/ * * @param parent * The Button Bar. **************************************************************************/ protected void createButtonsForButtonBar(Composite parent) { if (m_type == OPT_OK) createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); else if (m_type == OPT_YES) createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true); else if (m_type == OPT_NO) createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false); else if (m_type == OPT_CANCEL) createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); else if (m_type == OPT_NUM || m_type == OPT_ALPHA || m_type == OPT_ANY) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); } else if (m_type == OPT_YES_NO) { createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true); createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false); } else if (m_type == OPT_OK_CANCEL) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); } }
From source file:com.bdaum.zoom.recipes.lightzone.internal.UpdateDerivedDialog.java
License:Open Source License
public UpdateDerivedDialog(Shell parentShell, File file) { super(parentShell, Constants.APPLICATION_NAME, null, NLS.bind(Messages.UpdateDerivedDialog_keeping_consistent, file), AcousticMessageDialog.WARNING, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0); }
From source file:com.bdaum.zoom.ui.dialogs.AcousticMessageDialog.java
License:Open Source License
/** * Convenience method to open a simple Yes/No question dialog. * * @param parent//from ww w . j a va 2 s .c o m * 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 * @return <code>true</code> if the user presses the OK button, * <code>false</code> otherwise */ public static boolean openQuestion(Shell parent, String title, String message) { return new AcousticMessageDialog(parent, title, null, message, QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0).open() == 0; }
From source file:com.bdaum.zoom.ui.internal.commands.OrphansCommand.java
License:Open Source License
@Override public void run() { AcousticMessageDialog includeDialog = new AcousticMessageDialog(getShell(), Messages.FindOrphansActionDelegate_search_orphans, null, Messages.FindOrphansActionDelegate_include_off_line, AcousticMessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 1);/*from ww w . j ava2 s. co m*/ final int ret = includeDialog.open(); if (ret >= 2) return; isCanceled = false; ZProgressMonitorDialog dialog = new ZProgressMonitorDialog(getShell()); IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ICore core = Core.getCore(); IVolumeManager volumeManager = core.getVolumeManager(); List<AssetImpl> set = core.getDbManager().obtainAssets(); monitor.beginTask(Messages.FindOrphansActionDelegate_scanning_catalog, set.size()); for (AssetImpl asset : set) { URI uri = volumeManager.findExistingFile(asset, false); if (uri == null) { if (ret == 0 || !volumeManager.isOffline(asset.getVolume())) result.add(asset); else { String volume = asset.getVolume(); if (volume != null && !volume.isEmpty()) volumes.add(volume); } } if (monitor.isCanceled()) { isCanceled = true; break; } monitor.worked(1); } monitor.done(); } }; if (isCanceled) return; try { String v = null; if (!volumes.isEmpty()) { String[] vols = volumes.toArray(new String[volumes.size()]); Arrays.sort(vols); StringBuffer sb = new StringBuffer(); for (String volume : vols) { if (sb.length() > 0) sb.append(", "); //$NON-NLS-1$ sb.append(volume); } v = sb.toString(); } dialog.run(true, true, runnable); if (result.isEmpty()) { String message = Messages.FindOrphansActionDelegate_no_orphans_found; if (ret == 1 && v != null) message += NLS.bind(Messages.FindOrphansActionDelegate_entries_not_checked, v); AcousticMessageDialog.openInformation(getShell(), Messages.FindOrphansActionDelegate_orphan_search, message); } else { boolean show = true; if (v != null) { String message = NLS.bind(Messages.FindOrphansActionDelegate_n_entries_found, result.size()); if (ret == 1) message += NLS.bind(Messages.FindOrphansActionDelegate_entries_not_checked, v); show = AcousticMessageDialog.openConfirm(getShell(), Messages.FindOrphansActionDelegate_orphan_search, message); } if (show) { SmartCollectionImpl collection = new SmartCollectionImpl( Messages.FindOrphansActionDelegate_orphans, true, false, true, false, null, 0, null, 0, null, Constants.INHERIT_LABEL, null, 0, null); collection.addCriterion( new CriterionImpl(ICollectionProcessor.ORPHANS, null, result, QueryField.XREF, false)); Ui.getUi().getNavigationHistory(getActiveWorkbenchWindow()) .postSelection(new StructuredSelection(collection)); } } } catch (InvocationTargetException e) { UiActivator.getDefault().logError(Messages.FindOrphansActionDelegate_error_scanning_for_orphans, e); } catch (InterruptedException e) { // nothing to do } }
From source file:com.byterefinery.rmbench.util.ModelManager.java
License:Open Source License
/** * show a 3-option dialog asking the user whether the current model should be saved * //from w w w . j a v a 2s .c o m * @return false if the dialog was cancelled, and thus the operation should not * proceed */ private boolean querySaveModel(final Shell shell) { MessageDialog dialog = new MessageDialog(shell, RMBenchMessages.ModelView_SaveDlg_Title, null, RMBenchMessages.ModelView_SaveChanged_Message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0); int result = dialog.open(); if (result == 0) { IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { doSave(shell, monitor); } }; try { new ProgressMonitorDialog(shell).run(false, true, runnable); } catch (InvocationTargetException e) { RMBenchPlugin.logError(e); } catch (InterruptedException e) { RMBenchPlugin.logError(e); } } return result != 2; }
From source file:com.centurylink.mdw.plugin.designer.editors.ProcessEditor.java
License:Apache License
private int promptToSaveOverrideAttributes() { String msg = getProcess().getName() + " has unsaved override attributes. Save changes?"; String[] buttons = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }; MessageDialog attrsSaveDialog = new MessageDialog(getSite().getShell(), "Save Attributes", null, msg, MessageDialog.QUESTION, buttons, 0); return attrsSaveDialog.open(); }
From source file:com.ceteva.mosaic.MessageDialogWithToggle.java
License:Open Source License
/** * Convenience method to open a simple Yes/No question 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 va2 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 openQuestion(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.YES_LABEL, IDialogConstants.NO_LABEL }, 0, // yes is the default toggleMessage, toggleState); dialog.open(); return dialog; }
From source file:com.conwet.wirecloud.ide.wizards.WizardProjectsImportPage.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. * * @param pathString/* ww w . j a v a 2 s . c om*/ * @return the user's reply: one of <code>"YES"</code>, <code>"NO"</code>, * <code>"ALL"</code>, or <code>"CANCEL"</code> */ 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(IDEWorkbenchMessages.WizardDataTransfer_existsQuestion, pathString); } else { messageString = NLS.bind(IDEWorkbenchMessages.WizardDataTransfer_overwriteNameAndPathQuestion, path.lastSegment(), path.removeLastSegments(1).toOSString()); } final MessageDialog dialog = new MessageDialog(getContainer().getShell(), IDEWorkbenchMessages.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) { 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() { public void run() { dialog.open(); } }); return dialog.getReturnCode() < 0 ? CANCEL : response[dialog.getReturnCode()]; }
From source file:com.drgarbage.visualgraphic.model.ControlFlowGraphDiagramFactory.java
License:Apache License
public static int openConfirm(Shell parent, String title, String message) { MessageDialog dialog = new MessageDialog(parent, title, CoreImg.aboutDrGarbageIcon_16x16.createImage(), message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.NO_TO_ALL_LABEL }, 3); /*/*from w ww . ja v a2 s. c om*/ * OK is the * default */ return dialog.open(); }