]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/ProcessDetailsDisplayHandler.java
cdc28812b33e561b6cf6702e2060b15f18df3c16
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.ui / src / org / argeo / slc / client / ui / commands / ProcessDetailsDisplayHandler.java
1 package org.argeo.slc.client.ui.commands;
2
3 import org.argeo.slc.client.ui.views.ProcessDetailView;
4 import org.eclipse.core.commands.AbstractHandler;
5 import org.eclipse.core.commands.ExecutionEvent;
6 import org.eclipse.core.commands.ExecutionException;
7 import org.eclipse.ui.handlers.HandlerUtil;
8
9 /**
10 * Command handler to set visible or create a ProcessDetailView. UUID of the
11 * process is passed via command parameters.
12 *
13 * @author bsinou
14 *
15 */
16
17 public class ProcessDetailsDisplayHandler extends AbstractHandler {
18 // private static final Log log = LogFactory
19 // .getLog(ProcessDetailsDisplayHandler.class);
20
21 public Object execute(ExecutionEvent event) throws ExecutionException {
22
23 // We pass the UUID of the process we want to display via command
24 // parameters.
25 String uuid = event
26 .getParameter("org.argeo.slc.client.commands.processUuid");
27
28 // mode = 1 : VIEW_ACTIVATE, Show view mode that indicates the view
29 // should be made visible and activated. Use of this mode has the same
30 // effect as calling showView.
31 try {
32 ProcessDetailView pView = (ProcessDetailView) HandlerUtil
33 .getActiveWorkbenchWindow(event).getActivePage()
34 .showView(ProcessDetailView.ID, "UUID-" + uuid, 1);
35 pView.setUuid(uuid);
36 pView.retrieveResults();
37 } catch (Exception e) {
38 e.printStackTrace();
39 }
40
41 return null;
42 }
43 }