List of usage examples for org.eclipse.jface.dialogs MessageDialog NONE
int NONE
To view the source code for org.eclipse.jface.dialogs MessageDialog NONE.
Click Source Link
From source file:com.windowtester.eclipse.ui.target.NewTargetProvisionerPage.java
License:Open Source License
protected boolean queryYesNoQuestion(String message) { MessageDialog dialog = new MessageDialog(getContainer().getShell(), "Question", (Image) null, message, MessageDialog.NONE, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0); // ensure yes is the default return dialog.open() == 0; }
From source file:de.loskutov.eclipseskins.sessions.dialogs.ManageSessionsDialog.java
License:Open Source License
public static ManageSessionsDialog create(Shell parentShell) { String dialogTitle = "Manage sessions"; int dialogImageType = MessageDialog.NONE; String[] dialogButtonLabels = new String[] { "OK" }; int defaultIndex = 0; ManageSessionsDialog dialog = new ManageSessionsDialog(parentShell, dialogTitle, null, null, dialogImageType, dialogButtonLabels, defaultIndex); return dialog; }
From source file:eu.aniketos.securebpmn.util.DialogUtil.java
License:Apache License
/** * Opens a dialog window that contains an image and a message. * * @param title/*www. j av a2 s . c om*/ * The title of the message window. * @param message * The message to be displayed in the window. * @param image * The image that should be displayed in the window. * @param buttons * The labels of the Buttons the window should contain. * @param defaultButton * The index of the Button that should be selected by default. * @return The index of the Button that was pressed. */ public static int openMessageDialog(String title, String message, int image, String[] buttons, int defaultButton) { MessageDialog dialog; switch (image) { case INFO: dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.INFORMATION, buttons, defaultButton); break; case WARNING: dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.WARNING, buttons, defaultButton); break; case ERROR: dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.ERROR, buttons, defaultButton); break; default: dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.NONE, buttons, defaultButton); break; } return dialog.open(); }
From source file:eu.numberfour.n4js.ui.export.AbstractExportToSingleFileWizardPage.java
License:Open Source License
/** * Displays a Yes/No question to the user with the specified message and returns the user's response. * * @param message/*w ww. j av a 2 s . c o m*/ * the question to ask * @return <code>true</code> for Yes, and <code>false</code> for No */ private boolean queryYesNoQuestion(String message) { MessageDialog dialog = new MessageDialog(getContainer().getShell(), IDEWorkbenchMessages.Question, (Image) null, message, MessageDialog.NONE, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0) { @Override protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; return dialog.open() == 0; }
From source file:fr.inria.soctrace.tools.ocelotl.ui.views.OcelotlView.java
License:Open Source License
/** * Set the cache strategy depending on the selected policy TODO Take the * operator into account//from ww w . j a v a2 s . c o m */ public void setCachePolicy() { if (hasChanged != HasChanged.ALL) return; switch (ocelotlParameters.getOcelotlSettings().getCachePolicy()) { case CACHEPOLICY_FAST: ocelotlParameters.getDataCache().setBuildingStrategy(DatacacheStrategy.DATACACHE_PROPORTIONAL); break; case CACHEPOLICY_SLOW: ocelotlParameters.getDataCache().setBuildingStrategy(DatacacheStrategy.DATACACHE_DATABASE); break; case CACHEPOLICY_ASK: String[] dialogButtonLabels = { "Precise", "Fast", "Automatic" }; MessageDialog choosePolicy = new MessageDialog(getSite().getShell(), "Choose a cache policy", null, "Please choose one of the following methods for cache rebuilding:", MessageDialog.NONE, dialogButtonLabels, 0); int choice = choosePolicy.open(); if (choice == 0) { ocelotlParameters.getDataCache().setBuildingStrategy(DatacacheStrategy.DATACACHE_DATABASE); break; } else if (choice == 1) { ocelotlParameters.getDataCache().setBuildingStrategy(DatacacheStrategy.DATACACHE_PROPORTIONAL); break; } case CACHEPOLICY_AUTO: // TODO implement auto (decision taken when computing ratio) ocelotlParameters.getDataCache().setBuildingStrategy(DatacacheStrategy.DATACACHE_PROPORTIONAL); break; default: break; } }
From source file:gov.nasa.ensemble.common.ui.LogFileDialog.java
License:Open Source License
/** * Construct a ScrollableMessageDialog/*ww w . j a v a 2 s . c o m*/ * * @param parent * @param title * @param message */ public LogFileDialog(Shell parent, String title, String message) { super(parent, title, null, message, MessageDialog.NONE, new String[] { IDialogConstants.OK_LABEL }, 0); textStyle = DEFAULT_TEXT_STYLE; setShellStyle(getShellStyle() | SWT.RESIZE); }
From source file:gov.nasa.ensemble.common.ui.operations.EnsembleFileSystemExportOperation.java
License:Open Source License
protected boolean queryYesNoQuestion(String message) { MessageDialog dialog = new MessageDialog(getShellForMessageDialog(), "Question", (Image) null, message, MessageDialog.NONE, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0) { @Override//from w w w .ja v a2s. c o m protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; // ensure yes is the default return dialog.open() == 0; }
From source file:gov.nasa.ensemble.common.ui.ScrollableMessageDialog.java
License:Open Source License
/** * Construct a ScrollableMessageDialog//from www . j ava 2 s .co m * * @param parent * @param title * @param message */ public ScrollableMessageDialog(Shell parent, String title, String message) { super(parent, title, null, message, MessageDialog.NONE, new String[] {}, 0); if (System.getProperty("os.name").toLowerCase().contains("linux")) setShellStyle(getShellStyle() | SWT.RESIZE); else setShellStyle((getShellStyle() ^ SWT.APPLICATION_MODAL) | SWT.ON_TOP | SWT.RESIZE); }
From source file:gov.nasa.ensemble.common.ui.wizard.AbstractEnsembleProjectExportWizardPage.java
License:Open Source License
/** * This override is provided to provide an appropriate shell vs the standard * approach of just using the container. *///from w w w .j a va 2s . co m @Override protected boolean queryYesNoQuestion(String message) { MessageDialog dialog = new MessageDialog(getShellForMessageDialog(), IDEWorkbenchMessages.Question, (Image) null, message, MessageDialog.NONE, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0) { @Override protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; // ensure yes is the default return dialog.open() == 0; }
From source file:gov.nasa.ensemble.core.plan.editor.lifecycle.WizardPlanExportPage.java
License:Open Source License
/** * Displays a Yes/No question to the user with the specified message and returns * the user's response.//from ww w . ja v a2 s. c om * * @param message the question to ask * @return <code>true</code> for Yes, and <code>false</code> for No */ protected boolean queryYesNoQuestion(String message) { MessageDialog dialog = new MessageDialog(getContainer().getShell(), "Question", (Image) null, message, MessageDialog.NONE, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0); // ensure yes is the default return dialog.open() == 0; }