1 package org
.argeo
.suite
.workbench
;
7 import org
.argeo
.connect
.workbench
.AppWorkbenchService
;
8 import org
.argeo
.connect
.workbench
.SystemWorkbenchService
;
9 import org
.argeo
.eclipse
.ui
.EclipseUiUtils
;
10 import org
.argeo
.suite
.workbench
.parts
.DefaultDashboardEditor
;
11 import org
.eclipse
.jface
.wizard
.Wizard
;
12 import org
.eclipse
.swt
.graphics
.Image
;
14 /** Centralise workbench services from the various base apps */
15 public class DefaultSuiteWorkbenchService
implements SystemWorkbenchService
{
17 // Injected known AppWorkbenchServices: order is important, first found
18 // result will be returned by the various methods.
19 private List
<AppWorkbenchService
> knownAppWbServices
;
20 private String defaultEditorId
= DefaultDashboardEditor
.ID
;
23 public String
getDefaultEditorId() {
24 return defaultEditorId
;
28 public String
getEntityEditorId(Node entity
) {
30 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
31 result
= appWbService
.getEntityEditorId(entity
);
32 if (EclipseUiUtils
.notEmpty(result
))
39 public String
getSearchEntityEditorId(String nodeType
) {
41 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
42 result
= appWbService
.getSearchEntityEditorId(nodeType
);
43 if (EclipseUiUtils
.notEmpty(result
))
50 public Image
getIconForType(Node entity
) {
52 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
53 result
= appWbService
.getIconForType(entity
);
61 public Wizard
getCreationWizard(Node node
) {
63 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
64 result
= appWbService
.getCreationWizard(node
);
71 /* DEPENDENCY INJECTION */
72 public void setKnownAppWbServices(List
<AppWorkbenchService
> knownAppWbServices
) {
73 this.knownAppWbServices
= knownAppWbServices
;
76 public void setDefaultEditorId(String defaultEditorId
) {
77 this.defaultEditorId
= defaultEditorId
;