1 package $packageName$; 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 setId(ICommandIds.CMD_OPEN_MESSAGE); 17 setActionDefinitionId(ICommandIds.CMD_OPEN_MESSAGE); 19 setImageDescriptor($pluginClass$.getImageDescriptor("/icons/sample3.gif")); 20 } 21 22 public void run() { 23 MessageDialog.openInformation(window.getShell(), "Open", "Open Message Dialog!"); 24 } 25 } | Popular Tags |