]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/runtime/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/ResultDetailsDisplayHandler.java
98c502f3e6789c2a92aaca4d4f549c423bae92da
[gpl/argeo-slc.git] / eclipse / plugins / runtime / org.argeo.slc.client.ui / src / main / java / org / argeo / slc / client / ui / commands / ResultDetailsDisplayHandler.java
1 package org.argeo.slc.client.ui.commands;
2
3 import org.argeo.slc.client.ui.views.ResultDetailView;
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 ResultDetailView. UUID of the
11 * testResult is passed via command parameters.
12 *
13 * @author bsinou
14 *
15 */
16
17 public class ResultDetailsDisplayHandler extends AbstractHandler {
18 // private static final Log log = LogFactory
19 // .getLog(ResultDetailsDisplayHandler.class);
20
21 public Object execute(ExecutionEvent event) throws ExecutionException {
22
23 // We pass the UUID of the test result we want to display via command
24 // parameters.
25 String uuid = event
26 .getParameter("org.argeo.slc.client.commands.resultUuid");
27
28 // mode = 2 : VIEW_VISIBLE, Show view mode that indicates the view
29 // should be created or made visible if already created .
30 // mode = 1 : VIEW_ACTIVATE, Show view mode that indicates the view
31 // should be made visible and activated. Use of this mode has the same
32 // effect as calling
33 try {
34 ResultDetailView rView = (ResultDetailView) HandlerUtil
35 .getActiveWorkbenchWindow(event).getActivePage()
36 .showView(ResultDetailView.ID, "UUID-" + uuid, 1);
37 rView.setUuid(uuid);
38 rView.retrieveResults();
39 } catch (Exception e) {
40 e.printStackTrace();
41 }
42 return null;
43 }
44 }