]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/ResultDetailsDisplayHandler.java
aa434607292c559fabc5ff6fe730613501503d15
[gpl/argeo-slc.git] / eclipse / plugins / 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 // TODO : remove this.
29 // if (uuid == null || "".equals(uuid)) {
30 // try {
31 // ResultListView pbv = (ResultListView) HandlerUtil
32 // .getActiveWorkbenchWindow(event).getActivePage()
33 // .showView(ResultListView.ID);
34 // uuid = pbv.getSelectedResult()[0];
35 // } catch (PartInitException e) {
36 // // TODO Auto-generated catch block
37 // e.printStackTrace();
38 // }
39 //
40 // }
41
42 // mode = 2 : VIEW_VISIBLE, Show view mode that indicates the view
43 // should be created or made visible if already created .
44 // mode = 1 : VIEW_ACTIVATE, Show view mode that indicates the view
45 // should be made visible and activated. Use of this mode has the same
46 // effect as calling
47 try {
48 ResultDetailView rView = (ResultDetailView) HandlerUtil
49 .getActiveWorkbenchWindow(event).getActivePage()
50 .showView(ResultDetailView.ID, "UUID-" + uuid, 1);
51 rView.setUuid(uuid);
52 rView.retrieveResults();
53 } catch (Exception e) {
54 e.printStackTrace();
55 }
56 return null;
57 }
58 }