1 package org.argeo.connect.e4.handlers;
2
3 import javax.inject.Inject;
4 import javax.inject.Named;
5
6 import org.apache.commons.logging.Log;
7 import org.apache.commons.logging.LogFactory;
8 import org.argeo.connect.ui.SystemWorkbenchService;
9 import org.eclipse.e4.core.di.annotations.Execute;
10
11
12 public class OpenSearchEntityEditor {
13 private final static Log log = LogFactory.getLog(OpenSearchEntityEditor.class);
14
15
16
17
18 public final static String PARAM_NODE_TYPE = "nodeType";
19 public final static String PARAM_LABEL = "label";
20
21
22 @Inject
23 private SystemWorkbenchService systemWorkbenchService;
24
25 @Execute
26 public void execute(@Named(PARAM_NODE_TYPE) String entityType, @Named(PARAM_LABEL) String label) {
27
28
29
30
31 String editorId = systemWorkbenchService.getSearchEntityEditorId(entityType);
32 if (editorId == null) {
33 log.warn("No editor ID found for " + entityType);
34 return;
35 }
36 systemWorkbenchService.openSearchEntityView(entityType, label);
37
38
39
40
41
42
43
44
45
46
47 }
48
49
50
51
52
53 }