1 package org
.argeo
.slc
.client
.ui
.actions
;
3 import org
.apache
.commons
.logging
.Log
;
4 import org
.apache
.commons
.logging
.LogFactory
;
5 import org
.argeo
.slc
.client
.ui
.views
.ResultListView
;
6 import org
.eclipse
.jface
.action
.IAction
;
7 import org
.eclipse
.jface
.viewers
.ISelection
;
8 import org
.eclipse
.ui
.IWorkbenchWindow
;
9 import org
.eclipse
.ui
.IWorkbenchWindowActionDelegate
;
12 * Our sample action implements workbench action delegate. The action proxy will
13 * be created by the workbench and shown in the UI. When the user tries to use
14 * the action, this delegate will be created and execution will be delegated to
17 * @see IWorkbenchWindowActionDelegate
19 public class RefreshAction
implements IWorkbenchWindowActionDelegate
{
20 private final static Log log
= LogFactory
.getLog(RefreshAction
.class);
21 private IWorkbenchWindow window
;
26 public RefreshAction() {
30 * The action has been activated. The argument of the method represents the
31 * 'real' action sitting in the workbench UI.
33 * @see IWorkbenchWindowActionDelegate#run
35 public void run(IAction action
) {
36 // ExecutionModulesView view = (ExecutionModulesView) window
37 // .getWorkbench().getActiveWorkbenchWindow().getActivePage()
38 // .findView(ExecutionModulesView.ID);
39 // view.getViewer().refresh();
40 // MessageDialog.openInformation(window.getShell(), "Ui", "Refreshed");
42 ResultListView view
= (ResultListView
) window
.getWorkbench()
43 .getActiveWorkbenchWindow().getActivePage().findView(
45 view
.retrieveResults();
49 * Selection in the workbench has been changed. We can change the state of
50 * the 'real' action here if we want, but this can only happen after the
51 * delegate has been created.
53 * @see IWorkbenchWindowActionDelegate#selectionChanged
55 public void selectionChanged(IAction action
, ISelection selection
) {
59 * We can use this method to dispose of any system resources we previously
62 * @see IWorkbenchWindowActionDelegate#dispose
64 public void dispose() {
68 * We will cache window object in order to be able to provide parent shell
69 * for the message dialog.
71 * @see IWorkbenchWindowActionDelegate#init
73 public void init(IWorkbenchWindow window
) {