1 package org
.argeo
.suite
.workbench
;
7 import org
.argeo
.connect
.ui
.workbench
.AppWorkbenchService
;
8 import org
.argeo
.eclipse
.ui
.EclipseUiUtils
;
9 import org
.argeo
.suite
.workbench
.parts
.DefaultDashboardEditor
;
10 import org
.eclipse
.jface
.wizard
.Wizard
;
11 import org
.eclipse
.swt
.graphics
.Image
;
13 /** Centralize workbench services from the various base apps */
14 public class SuiteWorkbenchService
implements AppWorkbenchService
{
16 // Injected known AppWorkbenchServices: order is important, first found
17 // result will be returned by the various methods.
18 private List
<AppWorkbenchService
> knownAppWbServices
;
21 public String
getDefaultEditorId() {
22 return DefaultDashboardEditor
.ID
;
26 public String
getEntityEditorId(Node entity
) {
28 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
29 result
= appWbService
.getEntityEditorId(entity
);
30 if (EclipseUiUtils
.notEmpty(result
))
37 public String
getSearchEntityEditorId(String nodeType
) {
39 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
40 result
= appWbService
.getSearchEntityEditorId(nodeType
);
41 if (EclipseUiUtils
.notEmpty(result
))
48 public Image
getIconForType(Node entity
) {
50 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
51 result
= appWbService
.getIconForType(entity
);
59 public Wizard
getCreationWizard(Node node
) {
61 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
62 result
= appWbService
.getCreationWizard(node
);
69 /* DEPENDENCY INJECTION */
70 public void setKnownAppWbServices(List
<AppWorkbenchService
> knownAppWbServices
) {
71 this.knownAppWbServices
= knownAppWbServices
;