Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package impressoraplugin.handlers; |
| 2 | |||
| 3 | import org.eclipse.core.commands.AbstractHandler; |
||
| 4 | import org.eclipse.core.commands.ExecutionEvent; |
||
| 5 | import org.eclipse.core.commands.ExecutionException; |
||
| 6 | import org.eclipse.ui.IWorkbenchWindow; |
||
| 7 | import org.eclipse.ui.handlers.HandlerUtil; |
||
| 8 | import org.eclipse.jface.dialogs.MessageDialog; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Our sample handler extends AbstractHandler, an IHandler base class. |
||
| 12 | * @see org.eclipse.core.commands.IHandler |
||
| 13 | * @see org.eclipse.core.commands.AbstractHandler |
||
| 14 | */ |
||
| 15 | public class SampleHandler extends AbstractHandler { |
||
| 16 | |||
| 17 | @Override |
||
| 18 | public Object execute(ExecutionEvent event) throws ExecutionException { |
||
| 19 | IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); |
||
| 20 | MessageDialog.openInformation( |
||
| 21 | window.getShell(), |
||
| 22 | "Impressoraplugin", |
||
| 23 | "Hello, Eclipse world"); |
||
| 24 | return null; |
||
| 25 | } |
||
| 26 | } |