]> 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
First draft of ProcessDetail Implementation
[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.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5 import org.argeo.slc.client.ui.views.ProcessDetailView;
6 import org.eclipse.core.commands.AbstractHandler;
7 import org.eclipse.core.commands.ExecutionEvent;
8 import org.eclipse.core.commands.ExecutionException;
9 import org.eclipse.ui.handlers.HandlerUtil;
10
11 /**
12 * Command handler to set visible or create a ProcessDetailView. UUID of the
13 * process is passed via command parameters.
14 *
15 * @author bsinou
16 *
17 */
18
19 public class ProcessDetailsDisplayHandler extends AbstractHandler {
20 private static final Log log = LogFactory
21 .getLog(ProcessDetailsDisplayHandler.class);
22
23 public Object execute(ExecutionEvent event) throws ExecutionException {
24
25 // We pass the UUID of the process we want to display via command
26 // parameters.
27 String uuid = event
28 .getParameter("org.argeo.slc.client.commands.processUuid");
29
30 // mode = 2 : VIEW_VISIBLE, Show view mode that indicates the view
31 // should be created or made visible if already created .
32 try {
33 ProcessDetailView pView = (ProcessDetailView) HandlerUtil
34 .getActiveWorkbenchWindow(event).getActivePage()
35 .showView(ProcessDetailView.ID, "UUID-" + uuid, 2);
36 log.debug("Newly created pView : " + pView);
37 pView.setUuid(uuid);
38 log.debug("uuid set");
39 pView.retrieveResults();
40 } catch (Exception e) {
41 e.printStackTrace();
42 }
43
44 return null;
45 }
46 }