f662e06e00607ca80fcfe727e91321d7160ee688
[taxeditor.git] / src / eu / etaxonomy / taxeditor / MessagePopupAction.java
1 package eu.etaxonomy.taxeditor;
2
3 import org.eclipse.jface.action.Action;
4 import org.eclipse.jface.dialogs.MessageDialog;
5 import org.eclipse.ui.IWorkbenchWindow;
6
7
8 public class MessagePopupAction extends Action {
9
10 private final IWorkbenchWindow window;
11
12 MessagePopupAction(String text, IWorkbenchWindow window) {
13 super(text);
14 this.window = window;
15 // The id is used to refer to the action in a menu or toolbar
16 setId(ICommandIds.CMD_OPEN_MESSAGE);
17 // Associate the action with a pre-defined command, to allow key bindings.
18 setActionDefinitionId(ICommandIds.CMD_OPEN_MESSAGE);
19 setImageDescriptor(eu.etaxonomy.taxeditor.Activator.getImageDescriptor("/icons/sample3.gif"));
20 }
21
22 public void run() {
23 MessageDialog.openInformation(window.getShell(), "Open", "Open Message Dialog!");
24 }
25 }