1 package org
.argeo
.slc
.client
.ui
.commands
;
3 import java
.util
.Iterator
;
6 import org
.argeo
.slc
.client
.ui
.views
.ResultDetailView
;
7 import org
.argeo
.slc
.client
.ui
.views
.ResultListView
;
8 import org
.eclipse
.core
.commands
.AbstractHandler
;
9 import org
.eclipse
.core
.commands
.ExecutionEvent
;
10 import org
.eclipse
.core
.commands
.ExecutionException
;
11 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
14 * Command handler to set visible or create a ResultDetailView. UUID of the
15 * testResult is passed via command parameters.
21 public class ResultDetailsDisplayHandler
extends AbstractHandler
{
22 // private static final Log log = LogFactory
23 // .getLog(ResultDetailsDisplayHandler.class);
25 public final static String ID
= "org.argeo.slc.client.ui.displayResultDetails";
27 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
29 // We rather directly retrieve the corresponding view than use command
32 // We pass the UUID of the test result we want to display via command
34 // String uuid = event
35 // .getParameter("org.argeo.slc.client.commands.resultUuid");
37 // TODO : remove this.
38 // if (uuid == null || "".equals(uuid)) {
40 // } catch (PartInitException e) {
41 // // TODO Auto-generated catch block
42 // e.printStackTrace();
47 // mode = 2 : VIEW_VISIBLE, Show view mode that indicates the view
48 // should be created or made visible if already created .
49 // mode = 1 : VIEW_ACTIVATE, Show view mode that indicates the view
50 // should be made visible and activated. Use of this mode has the same
53 ResultListView rlv
= (ResultListView
) HandlerUtil
54 .getActiveWorkbenchWindow(event
).getActivePage()
55 .findView(ResultListView
.ID
);
56 List
<String
> ids
= rlv
.getSelectedResultsId();
58 ResultDetailView rView
;
59 Iterator
<String
> it
= ids
.iterator();
60 while (it
.hasNext()) {
61 String uuid
= it
.next();
62 rView
= (ResultDetailView
) HandlerUtil
63 .getActiveWorkbenchWindow(event
).getActivePage()
64 .showView(ResultDetailView
.ID
, "UUID-" + uuid
, 1);
66 rView
.retrieveResults();
68 } catch (Exception e
) {