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:ummisco.gama.ui.commands.RefreshHandler.java
void checkLocationDeleted(final IProject project) throws CoreException { if (!project.exists()) { return;/*w w w . j a va 2 s . c o m*/ } final IFileInfo location = IDEResourceInfoUtils.getFileInfo(project.getLocationURI()); if (!location.exists()) { final String message = NLS.bind(IDEWorkbenchMessages.RefreshAction_locationDeletedMessage, project.getName(), location.toString()); final MessageDialog dialog = new MessageDialog(WorkbenchHelper.getShell(), IDEWorkbenchMessages.RefreshAction_dialogTitle, null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0) { @Override protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; WorkbenchHelper.run(() -> dialog.open()); // Do the deletion back in the operation thread if (dialog.getReturnCode() == 0) { // yes was chosen project.delete(true, true, null); } } }
From source file:ummisco.gama.ui.navigator.actions.RefreshAction.java
License:Open Source License
/** * Checks whether the given project's location has been deleted. If so, prompts the user with whether to delete the * project or not./*from w w w . j a v a 2s . co m*/ */ void checkLocationDeleted(final IProject project) throws CoreException { if (!project.exists()) { return; } final IFileInfo location = IDEResourceInfoUtils.getFileInfo(project.getLocationURI()); if (!location.exists()) { final String message = NLS.bind(IDEWorkbenchMessages.RefreshAction_locationDeletedMessage, project.getName(), location.toString()); final MessageDialog dialog = new MessageDialog(WorkbenchHelper.getShell(), IDEWorkbenchMessages.RefreshAction_dialogTitle, null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0) { @Override protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; WorkbenchHelper.run(() -> dialog.open()); // Do the deletion back in the operation thread if (dialog.getReturnCode() == 0) { // yes was chosen project.delete(true, true, null); } } }
From source file:zigen.plugin.db.ui.dialogs.MessageDialogWithToggle2.java
License:Open Source License
public static MessageDialogWithToggle2 open(Shell parent, String title, String message, String toggleMessage, boolean toggleState, String toggleMessage2, boolean toggleState2) { MessageDialogWithToggle2 dialog = new MessageDialogWithToggle2(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.toggleMessage2 = toggleMessage2; dialog.toggleState2 = toggleState2;// w w w .jav a 2 s. c o m dialog.open(); return dialog; }