1 package org
.argeo
.suite
.workbench
;
7 import org
.argeo
.connect
.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
;
19 private String defaultEditorId
= DefaultDashboardEditor
.ID
;
22 public String
getDefaultEditorId() {
23 return defaultEditorId
;
27 public String
getEntityEditorId(Node entity
) {
29 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
30 result
= appWbService
.getEntityEditorId(entity
);
31 if (EclipseUiUtils
.notEmpty(result
))
38 public String
getSearchEntityEditorId(String nodeType
) {
40 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
41 result
= appWbService
.getSearchEntityEditorId(nodeType
);
42 if (EclipseUiUtils
.notEmpty(result
))
49 public Image
getIconForType(Node entity
) {
51 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
52 result
= appWbService
.getIconForType(entity
);
60 public Wizard
getCreationWizard(Node node
) {
62 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
63 result
= appWbService
.getCreationWizard(node
);
70 /* DEPENDENCY INJECTION */
71 public void setKnownAppWbServices(List
<AppWorkbenchService
> knownAppWbServices
) {
72 this.knownAppWbServices
= knownAppWbServices
;
75 public void setDefaultEditorId(String defaultEditorId
) {
76 this.defaultEditorId
= defaultEditorId
;