Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gets rid of the blind usage of WorkbenchHelper.getSheet();
- Loading branch information
1 parent
dc2db7b
commit 3875937
Showing
3 changed files
with
133 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 38 additions & 12 deletions
50
ummisco.gama.ui.shared/src/ummisco/gama/ui/dialogs/Messages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,62 @@ | ||
/********************************************************************************************* | ||
/******************************************************************************************************* | ||
* | ||
* 'Messages.java, in plugin ummisco.gama.ui.shared, is part of the source code of the GAMA modeling and simulation | ||
* platform. (v. 1.8.1) | ||
* Messages.java, in ummisco.gama.ui.shared, is part of the source code of the | ||
* GAMA modeling and simulation platform (v.1.8.2). | ||
* | ||
* (c) 2007-2020 UMI 209 UMMISCO IRD/UPMC & Partners | ||
* (c) 2007-2021 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) | ||
* | ||
* Visit https://github.com/gama-platform/gama for license information and developers contact. | ||
* | ||
* | ||
**********************************************************************************************/ | ||
* Visit https://github.com/gama-platform/gama for license information and contacts. | ||
* | ||
********************************************************************************************************/ | ||
package ummisco.gama.ui.dialogs; | ||
|
||
import org.eclipse.jface.dialogs.MessageDialog; | ||
|
||
import ummisco.gama.ui.utils.WorkbenchHelper; | ||
|
||
/** | ||
* The Class Messages. | ||
*/ | ||
public class Messages { | ||
|
||
/** | ||
* Error. | ||
* | ||
* @param error the error | ||
*/ | ||
public static void error(final String error) { | ||
WorkbenchHelper.run(() -> MessageDialog.openError(WorkbenchHelper.getShell(), "Error", error)); | ||
WorkbenchHelper.run(() -> MessageDialog.openError(null, "Error", error)); | ||
} | ||
|
||
/** | ||
* Tell. | ||
* | ||
* @param error the error | ||
*/ | ||
public static void tell(final String error) { | ||
WorkbenchHelper.run(() -> MessageDialog.openInformation(WorkbenchHelper.getShell(), "Message", error)); | ||
WorkbenchHelper.run(() -> MessageDialog.openInformation(null, "Message", error)); | ||
} | ||
|
||
/** | ||
* Question. | ||
* | ||
* @param title the title | ||
* @param message the message | ||
* @return true, if successful | ||
*/ | ||
public static boolean question(final String title, final String message) { | ||
return MessageDialog.openQuestion(WorkbenchHelper.getShell(), title, message); | ||
return MessageDialog.openQuestion(null, title, message); | ||
} | ||
|
||
/** | ||
* Confirm. | ||
* | ||
* @param title the title | ||
* @param message the message | ||
* @return true, if successful | ||
*/ | ||
public static boolean confirm(final String title, final String message) { | ||
return MessageDialog.openConfirm(WorkbenchHelper.getShell(), title, message); | ||
return MessageDialog.openConfirm(null, title, message); | ||
} | ||
|
||
} |