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() {
25 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
26 result
= appWbService
.getDefaultEditorId();
27 if (EclipseUiUtils
.notEmpty(result
))
30 return defaultEditorId
;
34 public String
getEntityEditorId(Node entity
) {
36 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
37 result
= appWbService
.getEntityEditorId(entity
);
38 if (EclipseUiUtils
.notEmpty(result
))
45 public String
getSearchEntityEditorId(String nodeType
) {
47 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
48 result
= appWbService
.getSearchEntityEditorId(nodeType
);
49 if (EclipseUiUtils
.notEmpty(result
))
56 public Image
getIconForType(Node entity
) {
58 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
59 result
= appWbService
.getIconForType(entity
);
67 public Wizard
getCreationWizard(Node node
) {
69 for (AppWorkbenchService appWbService
: knownAppWbServices
) {
70 result
= appWbService
.getCreationWizard(node
);
77 /* DEPENDENCY INJECTION */
78 public void setKnownAppWbServices(List
<AppWorkbenchService
> knownAppWbServices
) {
79 this.knownAppWbServices
= knownAppWbServices
;
82 public void setDefaultEditorId(String defaultEditorId
) {
83 this.defaultEditorId
= defaultEditorId
;