summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-08-05 10:30:34 (EDT)
committerCarsten Drossel2008-08-05 10:30:34 (EDT)
commit1ffe1c10459c5867fb30027b1220a36a9edeedd8 (patch)
treecb3b5029d39a94af32b6d41ae3a0ca0f7f6e4578
parent72e19f40f597c995cc4cbac94252d797a13895c9 (diff)
downloadorg.eclipse.riena-1ffe1c10459c5867fb30027b1220a36a9edeedd8.zip
org.eclipse.riena-1ffe1c10459c5867fb30027b1220a36a9edeedd8.tar.gz
org.eclipse.riena-1ffe1c10459c5867fb30027b1220a36a9edeedd8.tar.bz2
using view controller from workAreaPresentation extension point; using INavigationNodeBuilder
-rw-r--r--org.eclipse.riena.example.client/plugin.xml92
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/application/SwtExampleApplication.java88
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ComboSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/FocusableSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ListSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/MarkerSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleController.java8
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigationSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/RidgetsSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/StatuslineSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/SystemPropertiesSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TableSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TextSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeTableSubModuleController.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/NavigateNodeBuilder.java56
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/PlaygroundNodeBuilder.java89
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ComboSubModuleView.java10
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/FocusableSubModuleView.java6
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListSubModuleView.java6
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java6
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigateSubModuleView.java6
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigationSubModuleView.java9
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/RidgetsSubModuleView.java9
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/StatuslineSubModuleView.java10
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java6
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java6
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TextSubModuleView.java6
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java6
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java6
-rw-r--r--org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManager.java23
-rw-r--r--org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeView.java15
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/PresentationProviderService.java12
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/AllTests.java10
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/AllTests.java30
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManagerTest.java42
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManagerTest.xml13
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java31
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeViewTest.java70
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeViewTest.xml13
40 files changed, 533 insertions, 199 deletions
diff --git a/org.eclipse.riena.example.client/plugin.xml b/org.eclipse.riena.example.client/plugin.xml
index 2335cff..e7978a4 100644
--- a/org.eclipse.riena.example.client/plugin.xml
+++ b/org.eclipse.riena.example.client/plugin.xml
@@ -312,7 +312,23 @@
<extension
point="org.eclipse.riena.navigation.NavigationNodePresentation">
<navigationNodePresentation
- presentationId="org.eclipse.riena.example.navigation.comboAndList"
+ presentationId="org.eclipse.riena.example.playground"
+ nodeBuilder="org.eclipse.riena.example.client.navigation.model.PlaygroundNodeBuilder"
+ parentPresentationId="playground">
+ </navigationNodePresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.NavigationNodePresentation">
+ <navigationNodePresentation
+ presentationId="org.eclipse.riena.example.navigate"
+ nodeBuilder="org.eclipse.riena.example.client.navigation.model.NavigateNodeBuilder"
+ parentPresentationId="playground">
+ </navigationNodePresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.NavigationNodePresentation">
+ <navigationNodePresentation
+ presentationId="org.eclipse.riena.example.navigate.comboAndList"
nodeBuilder="org.eclipse.riena.example.client.navigation.model.ComboAndListNodeBuilder"
parentPresentationId="app1">
</navigationNodePresentation>
@@ -320,7 +336,7 @@
<extension
point="org.eclipse.riena.navigation.NavigationNodePresentation">
<navigationNodePresentation
- presentationId="org.eclipse.riena.example.navigation.tableTextAndTree"
+ presentationId="org.eclipse.riena.example.navigate.tableTextAndTree"
nodeBuilder="org.eclipse.riena.example.client.navigation.model.TableTextAndTreeNodeBuilder"
parentPresentationId="playground">
</navigationNodePresentation>
@@ -328,6 +344,45 @@
<extension
point="org.eclipse.riena.navigation.WorkAreaPresentation">
<workAreaPresentation
+ presentationId="org.eclipse.riena.example.navigation"
+ view="org.eclipse.riena.example.client.views.NavigationSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.NavigationSubModuleController">
+ </workAreaPresentation>
+ </extension> <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.buttons"
+ view="org.eclipse.riena.example.client.views.RidgetsSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.RidgetsSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.marker"
+ view="org.eclipse.riena.example.client.views.MarkerSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.MarkerSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.focusable"
+ view="org.eclipse.riena.example.client.views.FocusableSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.FocusableSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.validation"
+ view="org.eclipse.riena.example.client.views.ValidationSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.ValidationSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
presentationId="org.eclipse.riena.example.combo"
view="org.eclipse.riena.example.client.views.ComboSubModuleView"
viewController="org.eclipse.riena.example.client.controllers.ComboSubModuleController">
@@ -365,5 +420,36 @@
viewController="org.eclipse.riena.example.client.controllers.TreeSubModuleController">
</workAreaPresentation>
</extension>
-
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.treeTable"
+ view="org.eclipse.riena.example.client.views.TreeTableSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.TreeTableSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.systemProperties"
+ view="org.eclipse.riena.example.client.views.SystemPropertiesSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.SystemPropertiesSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.statusLine"
+ view="org.eclipse.riena.example.client.views.StatuslineSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.StatuslineSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.navigate.form"
+ view="org.eclipse.riena.example.client.views.NavigateSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.NavigateSubModuleController">
+ </workAreaPresentation>
+ </extension>
</plugin>
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/application/SwtExampleApplication.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/application/SwtExampleApplication.java
index 3045e8e..1f556c3 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/application/SwtExampleApplication.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/application/SwtExampleApplication.java
@@ -11,23 +11,10 @@
package org.eclipse.riena.example.client.application;
import org.eclipse.riena.core.util.StringUtils;
-import org.eclipse.riena.example.client.views.ComboSubModuleView;
import org.eclipse.riena.example.client.views.CustomerDetailSubModuleView;
-import org.eclipse.riena.example.client.views.FocusableSubModuleView;
-import org.eclipse.riena.example.client.views.ListSubModuleView;
-import org.eclipse.riena.example.client.views.MarkerSubModuleView;
-import org.eclipse.riena.example.client.views.NavigateSubModuleView;
import org.eclipse.riena.example.client.views.NavigationSubModuleView;
-import org.eclipse.riena.example.client.views.RidgetsSubModuleView;
import org.eclipse.riena.example.client.views.SharedViewDemoSubModuleView;
-import org.eclipse.riena.example.client.views.StatuslineSubModuleView;
-import org.eclipse.riena.example.client.views.SystemPropertiesSubModuleView;
-import org.eclipse.riena.example.client.views.TableSubModuleView;
-import org.eclipse.riena.example.client.views.TextSubModuleView;
-import org.eclipse.riena.example.client.views.TreeSubModuleView;
-import org.eclipse.riena.example.client.views.TreeTableSubModuleView;
import org.eclipse.riena.example.client.views.UiProcessDemoSubModuleView;
-import org.eclipse.riena.example.client.views.ValidationSubModuleView;
import org.eclipse.riena.internal.example.client.Activator;
import org.eclipse.riena.navigation.IApplicationModel;
import org.eclipse.riena.navigation.IModuleGroupNode;
@@ -188,80 +175,9 @@ public class SwtExampleApplication extends SwtApplication {
presentation.present(uiPSubModule, UiProcessDemoSubModuleView.ID);
uiProcessModule.addChild(uiPSubModule);
- // playground
- IModuleNode playgroundModule = new ModuleNode("Playground"); //$NON-NLS-1$
- moduleGroup.addChild(playgroundModule);
+ applicationModel.create(new NavigationNodeId("org.eclipse.riena.example.playground"));
- ISubModuleNode buttonsSubModule = new SubModuleNode("Buttons"); //$NON-NLS-1$
- presentation.registerView(RidgetsSubModuleView.ID, false);
- presentation.present(buttonsSubModule, RidgetsSubModuleView.ID);
- playgroundModule.addChild(buttonsSubModule);
-
- ISubModuleNode comboSubModule = new SubModuleNode("Combo"); //$NON-NLS-1$
- presentation.registerView(ComboSubModuleView.ID, false);
- presentation.present(comboSubModule, ComboSubModuleView.ID);
- playgroundModule.addChild(comboSubModule);
-
- ISubModuleNode listSubModule = new SubModuleNode("List"); //$NON-NLS-1$
- presentation.registerView(ListSubModuleView.ID, false);
- presentation.present(listSubModule, ListSubModuleView.ID);
- playgroundModule.addChild(listSubModule);
-
- ISubModuleNode textSubModule = new SubModuleNode("Text"); //$NON-NLS-1$
- presentation.registerView(TextSubModuleView.ID, false);
- presentation.present(textSubModule, TextSubModuleView.ID);
- playgroundModule.addChild(textSubModule);
-
- ISubModuleNode markerSubModule = new SubModuleNode("Marker"); //$NON-NLS-1$
- presentation.registerView(MarkerSubModuleView.ID, false);
- presentation.present(markerSubModule, MarkerSubModuleView.ID);
- playgroundModule.addChild(markerSubModule);
-
- ISubModuleNode focusableSubModule = new SubModuleNode("Focusable"); //$NON-NLS-1$
- presentation.registerView(FocusableSubModuleView.ID, false);
- presentation.present(focusableSubModule, FocusableSubModuleView.ID);
- playgroundModule.addChild(focusableSubModule);
-
- ISubModuleNode validationSubModule = new SubModuleNode("Validation"); //$NON-NLS-1$
- presentation.registerView(ValidationSubModuleView.ID, false);
- presentation.present(validationSubModule, ValidationSubModuleView.ID);
- playgroundModule.addChild(validationSubModule);
-
- ISubModuleNode treeSubModule = new SubModuleNode("Tree"); //$NON-NLS-1$
- presentation.registerView(TreeSubModuleView.ID, false);
- presentation.present(treeSubModule, TreeSubModuleView.ID);
- playgroundModule.addChild(treeSubModule);
-
- ISubModuleNode treeTableSubModule = new SubModuleNode("Tree Table"); //$NON-NLS-1$
- presentation.registerView(TreeTableSubModuleView.ID, false);
- presentation.present(treeTableSubModule, TreeTableSubModuleView.ID);
- playgroundModule.addChild(treeTableSubModule);
-
- ISubModuleNode tableSubModule = new SubModuleNode("Table");
- presentation.registerView(TableSubModuleView.ID, false);
- presentation.present(tableSubModule, TableSubModuleView.ID);
- playgroundModule.addChild(tableSubModule);
-
- ISubModuleNode systemPropertiesSubModule = new SubModuleNode("System Properties"); //$NON-NLS-1$
- presentation.registerView(SystemPropertiesSubModuleView.ID, false);
- presentation.present(systemPropertiesSubModule, SystemPropertiesSubModuleView.ID);
- playgroundModule.addChild(systemPropertiesSubModule);
-
- ISubModuleNode statusLineSubModule = new SubModuleNode("Statusline"); //$NON-NLS-1$
- presentation.registerView(StatuslineSubModuleView.ID, false);
- presentation.present(statusLineSubModule, StatuslineSubModuleView.ID);
- playgroundModule.addChild(statusLineSubModule);
-
- // navigate
- moduleGroup = new ModuleGroupNode("Navigate");
- moduleGroup.setPresentWithSingleModule(false);
- subApplication.addChild(moduleGroup);
- module = new ModuleNode("Navigate");
- module.setIcon(createIconPath(IExampleIcons.ICON_GREEN_LED));
- moduleGroup.addChild(module);
- subModule = new SubModuleNode("Navigate");
- presentation.present(subModule, NavigateSubModuleView.ID);
- module.addChild(subModule);
+ applicationModel.create(new NavigationNodeId("org.eclipse.riena.example.navigate"));
return applicationModel;
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ComboSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ComboSubModuleController.java
index 5a234af..a1b5802 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ComboSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ComboSubModuleController.java
@@ -39,6 +39,10 @@ public class ComboSubModuleController extends SubModuleController {
/** Holds editable data for a person. */
private final PersonModificationBean value;
+ public ComboSubModuleController() {
+ this(null);
+ }
+
public ComboSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
manager = new PersonManager(PersonFactory.createPersonList());
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/FocusableSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/FocusableSubModuleController.java
index c0096d8..1459b8e 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/FocusableSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/FocusableSubModuleController.java
@@ -41,6 +41,10 @@ public class FocusableSubModuleController extends SubModuleController {
private IToggleButtonRidget[] checkButtons;
private ITextFieldRidget[] textRidgets;
+ public FocusableSubModuleController() {
+ this(null);
+ }
+
public FocusableSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ListSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ListSubModuleController.java
index bd9b649..bef9a9e 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ListSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/ListSubModuleController.java
@@ -46,6 +46,10 @@ public class ListSubModuleController extends SubModuleController {
/** Holds editable data for a person. */
private final PersonModificationBean value;
+ public ListSubModuleController() {
+ this(null);
+ }
+
public ListSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
manager = new PersonManager(PersonFactory.createPersonList());
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/MarkerSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/MarkerSubModuleController.java
index 3367bcd..0b885d1 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/MarkerSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/MarkerSubModuleController.java
@@ -62,6 +62,10 @@ public class MarkerSubModuleController extends SubModuleController {
/** Manages a collection of persons. */
private final PersonManager manager;
+ public MarkerSubModuleController() {
+ this(null);
+ }
+
public MarkerSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
manager = new PersonManager(PersonFactory.createPersonList());
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleController.java
index 36692b6..24dda5e 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleController.java
@@ -16,6 +16,10 @@ import org.eclipse.riena.ui.ridgets.uibinding.IInjectAllRidgetsAtOnce;
public class NavigateSubModuleController extends SubModuleController implements IInjectAllRidgetsAtOnce {
+ public NavigateSubModuleController() {
+ this(null);
+ }
+
public NavigateSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
}
@@ -37,7 +41,7 @@ public class NavigateSubModuleController extends SubModuleController implements
* @see org.eclipse.riena.ui.ridgets.IActionListener#callback()
*/
public void callback() {
- getNavigationNode().navigate(new NavigationNodeId("org.eclipse.riena.example.navigation.comboAndList")); //$NON-NLS-1$
+ getNavigationNode().navigate(new NavigationNodeId("org.eclipse.riena.example.navigate.comboAndList")); //$NON-NLS-1$
}
}
@@ -48,7 +52,7 @@ public class NavigateSubModuleController extends SubModuleController implements
* @see org.eclipse.riena.ui.ridgets.IActionListener#callback()
*/
public void callback() {
- getNavigationNode().navigate(new NavigationNodeId("org.eclipse.riena.example.navigation.tableTextAndTree")); //$NON-NLS-1$
+ getNavigationNode().navigate(new NavigationNodeId("org.eclipse.riena.example.navigate.tableTextAndTree")); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigationSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigationSubModuleController.java
index 578c719..3608aee 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigationSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigationSubModuleController.java
@@ -35,6 +35,10 @@ public class NavigationSubModuleController extends SubModuleController {
private IActionRidget addModuleBtn;
private IActionRidget addModuleGroupBtn;
+ public NavigationSubModuleController() {
+ this(null);
+ }
+
/**
* @param navigationNode
*/
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/RidgetsSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/RidgetsSubModuleController.java
index 91c5908..54e7652 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/RidgetsSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/RidgetsSubModuleController.java
@@ -30,6 +30,10 @@ public class RidgetsSubModuleController extends SubModuleController {
private IActionRidget buttonWithImage;
private RidgetsModel model;
+ public RidgetsSubModuleController() {
+ this(null);
+ }
+
public RidgetsSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
model = new RidgetsModel();
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/StatuslineSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/StatuslineSubModuleController.java
index f136f99..5de8f28 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/StatuslineSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/StatuslineSubModuleController.java
@@ -94,6 +94,10 @@ public class StatuslineSubModuleController extends SubModuleController {
private IActionRidget showNumber;
private StatuslineModel model;
+ public StatuslineSubModuleController() {
+ this(null);
+ }
+
/**
* Creates a new instance of {@code StatuslineSubModuleController}
*
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/SystemPropertiesSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/SystemPropertiesSubModuleController.java
index 25e8c56..4bb1778 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/SystemPropertiesSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/SystemPropertiesSubModuleController.java
@@ -53,6 +53,10 @@ public class SystemPropertiesSubModuleController extends SubModuleController {
/** IActionListener for double click on the table */
private final IActionListener doubleClickListener;
+ public SystemPropertiesSubModuleController() {
+ this(null);
+ }
+
public SystemPropertiesSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
properties = new ArrayList<KeyValueBean>();
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TableSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TableSubModuleController.java
index c76d27a..09b511a 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TableSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TableSubModuleController.java
@@ -76,6 +76,10 @@ public class TableSubModuleController extends SubModuleController {
this.buttonDelete = buttonDelete;
}
+ public TableSubModuleController() {
+ this(null);
+ }
+
public TableSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TextSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TextSubModuleController.java
index befd6ba..f62514d 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TextSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TextSubModuleController.java
@@ -28,6 +28,10 @@ public class TextSubModuleController extends SubModuleController {
private ITextFieldRidget textPassword;
private ITextFieldRidget textField10;
+ public TextSubModuleController() {
+ this(null);
+ }
+
public TextSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java
index d7fc0ea..648bc27 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeSubModuleController.java
@@ -101,6 +101,10 @@ public class TreeSubModuleController extends SubModuleController {
this.buttonCollapse = buttonCollapse;
}
+ public TreeSubModuleController() {
+ this(null);
+ }
+
public TreeSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeTableSubModuleController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeTableSubModuleController.java
index 336a406..714b32d 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeTableSubModuleController.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/TreeTableSubModuleController.java
@@ -111,6 +111,10 @@ public class TreeTableSubModuleController extends SubModuleController {
this.buttonCollapse = buttonCollapse;
}
+ public TreeTableSubModuleController() {
+ this(null);
+ }
+
public TreeTableSubModuleController(ISubModuleNode navigationNode) {
super(navigationNode);
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/NavigateNodeBuilder.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/NavigateNodeBuilder.java
new file mode 100644
index 0000000..fbba766
--- /dev/null
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/NavigateNodeBuilder.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.example.client.navigation.model;
+
+import org.eclipse.riena.example.client.application.IExampleIcons;
+import org.eclipse.riena.internal.example.client.Activator;
+import org.eclipse.riena.navigation.INavigationNode;
+import org.eclipse.riena.navigation.INavigationNodeBuilder;
+import org.eclipse.riena.navigation.INavigationNodeId;
+import org.eclipse.riena.navigation.model.ModuleGroupNode;
+import org.eclipse.riena.navigation.model.ModuleNode;
+import org.eclipse.riena.navigation.model.NavigationNodeId;
+import org.eclipse.riena.navigation.model.SubModuleNode;
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ */
+public class NavigateNodeBuilder implements INavigationNodeBuilder {
+
+ /**
+ * @see org.eclipse.riena.navigation.INavigationNodeBuilder#buildNode(org.eclipse.riena.navigation.INavigationNodeId)
+ */
+ public INavigationNode<?> buildNode(INavigationNodeId INavigationNodeId) {
+ ModuleGroupNode moduleGroup = new ModuleGroupNode("Navigate");
+ moduleGroup.setPresentWithSingleModule(false);
+ ModuleNode module = new ModuleNode("Navigate");
+ module.setIcon(createIconPath(IExampleIcons.ICON_GREEN_LED));
+ moduleGroup.addChild(module);
+ SubModuleNode subModule = new SubModuleNode("Navigate");
+ subModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.navigate.form"));
+ module.addChild(subModule);
+ return moduleGroup;
+ }
+
+ protected String createIconPath(String subPath) {
+ Bundle bundle = Activator.getDefault().getBundle();
+
+ if (bundle == null) {
+ return null;
+ }
+ StringBuilder builder = new StringBuilder(bundle.getSymbolicName());
+ builder.append(":"); //$NON-NLS-1$
+ builder.append(subPath);
+ return builder.toString();
+ }
+
+}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/PlaygroundNodeBuilder.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/PlaygroundNodeBuilder.java
new file mode 100644
index 0000000..4f120de
--- /dev/null
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/PlaygroundNodeBuilder.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.example.client.navigation.model;
+
+import org.eclipse.riena.navigation.IModuleGroupNode;
+import org.eclipse.riena.navigation.IModuleNode;
+import org.eclipse.riena.navigation.INavigationNode;
+import org.eclipse.riena.navigation.INavigationNodeBuilder;
+import org.eclipse.riena.navigation.INavigationNodeId;
+import org.eclipse.riena.navigation.model.ModuleGroupNode;
+import org.eclipse.riena.navigation.model.ModuleNode;
+import org.eclipse.riena.navigation.model.NavigationNodeId;
+import org.eclipse.riena.navigation.model.SubModuleNode;
+
+/**
+ *
+ */
+public class PlaygroundNodeBuilder implements INavigationNodeBuilder {
+
+ /**
+ * @see org.eclipse.riena.navigation.INavigationNodeBuilder#buildNode(org.eclipse.riena.navigation.INavigationNodeId)
+ */
+ public INavigationNode<?> buildNode(INavigationNodeId INavigationNodeId) {
+
+ IModuleGroupNode moduleGroup = new ModuleGroupNode("Playground"); //$NON-NLS-1$
+
+ IModuleNode playgroundModule = new ModuleNode("Playground"); //$NON-NLS-1$
+ moduleGroup.addChild(playgroundModule);
+
+ SubModuleNode buttonsSubModule = new SubModuleNode("Buttons"); //$NON-NLS-1$
+ buttonsSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.buttons"));
+ playgroundModule.addChild(buttonsSubModule);
+
+ SubModuleNode comboSubModule = new SubModuleNode("Combo"); //$NON-NLS-1$
+ comboSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.combo"));
+ playgroundModule.addChild(comboSubModule);
+
+ SubModuleNode listSubModule = new SubModuleNode("List"); //$NON-NLS-1$
+ listSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.list"));
+ playgroundModule.addChild(listSubModule);
+
+ SubModuleNode textSubModule = new SubModuleNode("Text"); //$NON-NLS-1$
+ textSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.text"));
+ playgroundModule.addChild(textSubModule);
+
+ SubModuleNode markerSubModule = new SubModuleNode("Marker"); //$NON-NLS-1$
+ markerSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.marker"));
+ playgroundModule.addChild(markerSubModule);
+
+ SubModuleNode focusableSubModule = new SubModuleNode("Focusable"); //$NON-NLS-1$
+ focusableSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.focusable"));
+ playgroundModule.addChild(focusableSubModule);
+
+ SubModuleNode validationSubModule = new SubModuleNode("Validation"); //$NON-NLS-1$
+ validationSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.validation"));
+ playgroundModule.addChild(validationSubModule);
+
+ SubModuleNode treeSubModule = new SubModuleNode("Tree"); //$NON-NLS-1$
+ treeSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.tree"));
+ playgroundModule.addChild(treeSubModule);
+
+ SubModuleNode treeTableSubModule = new SubModuleNode("Tree Table"); //$NON-NLS-1$
+ treeTableSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.treeTable"));
+ playgroundModule.addChild(treeTableSubModule);
+
+ SubModuleNode tableSubModule = new SubModuleNode("Table");
+ tableSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.table"));
+ playgroundModule.addChild(tableSubModule);
+
+ SubModuleNode systemPropertiesSubModule = new SubModuleNode("System Properties"); //$NON-NLS-1$
+ systemPropertiesSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.systemProperties"));
+ playgroundModule.addChild(systemPropertiesSubModule);
+
+ SubModuleNode statusLineSubModule = new SubModuleNode("Statusline"); //$NON-NLS-1$
+ statusLineSubModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.statusLine"));
+ playgroundModule.addChild(statusLineSubModule);
+
+ return moduleGroup;
+ }
+
+}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ComboSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ComboSubModuleView.java
index 50f47ca..fd75a24 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ComboSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ComboSubModuleView.java
@@ -13,7 +13,6 @@ package org.eclipse.riena.example.client.views;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.riena.example.client.controllers.ComboSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
import org.eclipse.riena.ui.swt.lnf.LnfManager;
@@ -57,9 +56,10 @@ public class ComboSubModuleView extends SubModuleNodeView<ComboSubModuleControll
addUIControl(buttonSave, "buttonSave"); //$NON-NLS-1$
}
- @Override
- protected ComboSubModuleController createController(ISubModuleNode subModuleNode) {
- return new ComboSubModuleController(subModuleNode);
- }
+ // @Override
+ // protected ComboSubModuleController createController(ISubModuleNode
+ // subModuleNode) {
+ // return new ComboSubModuleController(subModuleNode);
+ // }
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/FocusableSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/FocusableSubModuleView.java
index fbe993e..c1488f4 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/FocusableSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/FocusableSubModuleView.java
@@ -15,7 +15,6 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.riena.example.client.controllers.FocusableSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.ridgets.IRidget;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
@@ -53,11 +52,6 @@ public class FocusableSubModuleView extends SubModuleNodeView<FocusableSubModule
fillFactory.applyTo(groupB);
}
- @Override
- protected FocusableSubModuleController createController(ISubModuleNode subModuleNode) {
- return new FocusableSubModuleController(subModuleNode);
- }
-
// helping methods
// ////////////////
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListSubModuleView.java
index c4daf66..bf8994b 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListSubModuleView.java
@@ -13,7 +13,6 @@ package org.eclipse.riena.example.client.views;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.riena.example.client.controllers.ListSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
import org.eclipse.riena.ui.swt.lnf.LnfManager;
@@ -44,11 +43,6 @@ public class ListSubModuleView extends SubModuleNodeView<ListSubModuleController
GridDataFactory.fillDefaults().applyTo(group2);
}
- @Override
- protected ListSubModuleController createController(ISubModuleNode subModuleNode) {
- return new ListSubModuleController(subModuleNode);
- }
-
// helping methods
// ////////////////
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java
index 743be8f..0e96b6e 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java
@@ -14,7 +14,6 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.riena.example.client.controllers.MarkerSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.ridgets.IMarkableRidget;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
@@ -52,11 +51,6 @@ public class MarkerSubModuleView extends SubModuleNodeView<MarkerSubModuleContro
GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(group3);
}
- @Override
- protected MarkerSubModuleController createController(ISubModuleNode subModuleNode) {
- return new MarkerSubModuleController(subModuleNode);
- }
-
// helping methods
// ////////////////
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigateSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigateSubModuleView.java
index 4100258..1074cae 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigateSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigateSubModuleView.java
@@ -13,7 +13,6 @@ package org.eclipse.riena.example.client.views;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.riena.example.client.controllers.NavigateSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.binding.DefaultSwtControlRidgetMapper;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.ridgets.uibinding.IBindingManager;
@@ -50,11 +49,6 @@ public class NavigateSubModuleView extends SubModuleNodeView<NavigateSubModuleCo
}
@Override
- protected NavigateSubModuleController createController(ISubModuleNode subModuleNode) {
- return new NavigateSubModuleController(subModuleNode);
- }
-
- @Override
protected IBindingManager createBindingManager() {
return new InjectAllAtOnceBindingManager(new SWTBindingPropertyLocator(), new DefaultSwtControlRidgetMapper());
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigationSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigationSubModuleView.java
index 470f014..81b6533 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigationSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigationSubModuleView.java
@@ -13,7 +13,6 @@ package org.eclipse.riena.example.client.views;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.riena.example.client.controllers.NavigationSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
import org.eclipse.riena.ui.swt.lnf.LnfManager;
@@ -61,12 +60,4 @@ public class NavigationSubModuleView extends SubModuleNodeView<NavigationSubModu
}
- /**
- * @see org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView#createController(org.eclipse.riena.navigation.ISubModuleNode)
- */
- @Override
- protected NavigationSubModuleController createController(ISubModuleNode subModuleNode) {
- return new NavigationSubModuleController(subModuleNode);
- }
-
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/RidgetsSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/RidgetsSubModuleView.java
index 64c8e63..949cb50 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/RidgetsSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/RidgetsSubModuleView.java
@@ -12,7 +12,6 @@ package org.eclipse.riena.example.client.views;
import org.eclipse.riena.example.client.controllers.RidgetsSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
import org.eclipse.riena.ui.swt.lnf.LnfManager;
@@ -71,12 +70,4 @@ public class RidgetsSubModuleView extends SubModuleNodeView<RidgetsSubModuleCont
}
- /**
- * @see org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView#createController(org.eclipse.riena.navigation.ISubModuleNode)
- */
- @Override
- protected RidgetsSubModuleController createController(ISubModuleNode subModuleNode) {
- return new RidgetsSubModuleController(subModuleNode);
- }
-
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/StatuslineSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/StatuslineSubModuleView.java
index f13845d..226ca21 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/StatuslineSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/StatuslineSubModuleView.java
@@ -14,7 +14,6 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.riena.example.client.controllers.StatuslineSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
import org.eclipse.riena.ui.swt.lnf.LnfManager;
@@ -54,15 +53,6 @@ public class StatuslineSubModuleView extends SubModuleNodeView<StatuslineSubModu
}
/**
- * @see org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView#createController
- * (org.eclipse.riena.navigation.ISubModuleNode)
- */
- @Override
- protected StatuslineSubModuleController createController(ISubModuleNode subModuleNode) {
- return new StatuslineSubModuleController(subModuleNode);
- }
-
- /**
* Creates the group with all the controls to regulate and show the message
* in the status line.
*
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java
index 6e5f6cf..847bbe1 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java
@@ -16,7 +16,6 @@ import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.riena.example.client.controllers.SystemPropertiesSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.ridgets.ITableRidget;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
@@ -49,11 +48,6 @@ public class SystemPropertiesSubModuleView extends SubModuleNodeView<SystemPrope
GridDataFactory.fillDefaults().grab(true, false).applyTo(group2);
}
- @Override
- protected SystemPropertiesSubModuleController createController(ISubModuleNode subModuleNode) {
- return new SystemPropertiesSubModuleController(subModuleNode);
- }
-
// helping methods
// ////////////////
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java
index 58b6075..5d4cdb9 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java
@@ -16,7 +16,6 @@ import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.riena.example.client.controllers.TableSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.ridgets.ITreeRidget;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
@@ -45,11 +44,6 @@ public class TableSubModuleView extends SubModuleNodeView<TableSubModuleControll
GridDataFactory.fillDefaults().grab(true, true).applyTo(group1);
}
- @Override
- protected TableSubModuleController createController(ISubModuleNode subModuleNode) {
- return new TableSubModuleController(subModuleNode);
- }
-
// helping methods
// ////////////////
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TextSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TextSubModuleView.java
index 7812d98..a38db93 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TextSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TextSubModuleView.java
@@ -13,7 +13,6 @@ package org.eclipse.riena.example.client.views;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.riena.example.client.controllers.TextSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.ridgets.ITextFieldRidget;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
@@ -72,9 +71,4 @@ public class TextSubModuleView extends SubModuleNodeView<TextSubModuleController
addUIControl(textField10, "textField10"); //$NON-NLS-1$
}
- @Override
- protected TextSubModuleController createController(ISubModuleNode subModuleNode) {
- return new TextSubModuleController(subModuleNode);
- }
-
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java
index 8c68f4e..e762be7 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java
@@ -14,7 +14,6 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.riena.example.client.controllers.TreeSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.ridgets.ITreeRidget;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
@@ -42,11 +41,6 @@ public class TreeSubModuleView extends SubModuleNodeView<TreeSubModuleController
GridDataFactory.fillDefaults().grab(true, true).applyTo(group1);
}
- @Override
- protected TreeSubModuleController createController(ISubModuleNode subModuleNode) {
- return new TreeSubModuleController(subModuleNode);
- }
-
// helping methods
// ////////////////
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java
index 65b8c39..673fb08 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java
@@ -16,7 +16,6 @@ import org.eclipse.jface.layout.TreeColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.riena.example.client.controllers.TreeTableSubModuleController;
import org.eclipse.riena.internal.example.client.utils.UIControlsFactory;
-import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.ui.swt.views.SubModuleNodeView;
import org.eclipse.riena.ui.ridgets.ITreeRidget;
import org.eclipse.riena.ui.swt.lnf.ILnfKeyConstants;
@@ -45,11 +44,6 @@ public class TreeTableSubModuleView extends SubModuleNodeView<TreeTableSubModule
GridDataFactory.fillDefaults().grab(true, true).applyTo(group1);
}
- @Override
- protected TreeTableSubModuleController createController(ISubModuleNode subModuleNode) {
- return new TreeTableSubModuleController(subModuleNode);
- }
-
// helping methods
// ////////////////
diff --git a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManager.java b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManager.java
index 70516b4..9282aca 100644
--- a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManager.java
+++ b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManager.java
@@ -50,18 +50,23 @@ public class SwtPresentationManager {
public SwtViewId getSwtViewId(INavigationNode<?> pNode) {
- INavigationNodeId presentationId = pNode.getPresentationId();
- if (presentationId != null) {
-
- String viewId = getPresentationDefinitionService().getViewId(presentationId);
- for (SwtViewId swtViewId : views.values()) {
- if (swtViewId.getId().equals(viewId)) {
- return swtViewId;
- }
+ SwtViewId swtViewId = views.get(pNode);
+
+ if (swtViewId == null) {
+ INavigationNodeId presentationId = pNode.getPresentationId();
+ if (presentationId != null) {
+ String viewId = getPresentationDefinitionService().getViewId(presentationId);
+ // TODO use
+ // getPresentationDefinitionService().isViewShared(
+ // presentationId
+ // )
+ // instead of creating all views shared
+ swtViewId = new SwtViewId(viewId, "shared");
+ views.put(pNode, swtViewId);
}
}
- return views.get(pNode);
+ return swtViewId;
}
private final class SubModuleObserver extends SubModuleNodeListener {
diff --git a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeView.java b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeView.java
index 8b9b994..c82ebc5 100644
--- a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeView.java
+++ b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeView.java
@@ -17,9 +17,11 @@ import java.util.Map;
import org.eclipse.riena.navigation.IApplicationModel;
import org.eclipse.riena.navigation.INavigationNode;
+import org.eclipse.riena.navigation.IPresentationProviderService;
import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.listener.NavigationTreeObserver;
import org.eclipse.riena.navigation.listener.SubModuleNodeListener;
+import org.eclipse.riena.navigation.model.PresentationProviderServiceAccessor;
import org.eclipse.riena.navigation.ui.controllers.SubModuleController;
import org.eclipse.riena.navigation.ui.swt.binding.DefaultSwtControlRidgetMapper;
import org.eclipse.riena.navigation.ui.swt.presentation.SwtPresentationManagerAccessor;
@@ -146,7 +148,11 @@ public abstract class SubModuleNodeView<C extends SubModuleController> extends V
protected abstract void basicCreatePartControl(Composite parent);
- protected abstract C createController(ISubModuleNode pSubModuleNode);
+ protected C createController(ISubModuleNode pSubModuleNode) {
+ C controller = (C) getPresentationDefinitionService().createViewController(pSubModuleNode);
+ controller.setNavigationNode(pSubModuleNode);
+ return controller;
+ }
/**
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
@@ -176,4 +182,11 @@ public abstract class SubModuleNodeView<C extends SubModuleController> extends V
}
bindingManager.injectRidgets(getController(), uiControls);
}
+
+ protected IPresentationProviderService getPresentationDefinitionService() {
+
+ // TODO: handling if no service found ???
+ return PresentationProviderServiceAccessor.current().getPresentationProviderService();
+
+ }
}
diff --git a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/PresentationProviderService.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/PresentationProviderService.java
index 426d072..3f3a6fc 100644
--- a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/PresentationProviderService.java
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/PresentationProviderService.java
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.riena.navigation.model;
+import org.eclipse.equinox.log.Logger;
import org.eclipse.riena.core.injector.Inject;
import org.eclipse.riena.internal.navigation.Activator;
+import org.eclipse.riena.navigation.ApplicationModelFailure;
import org.eclipse.riena.navigation.INavigationArgumentListener;
import org.eclipse.riena.navigation.INavigationNode;
import org.eclipse.riena.navigation.INavigationNodeBuilder;
@@ -21,8 +23,6 @@ import org.eclipse.riena.navigation.IPresentationDefinition;
import org.eclipse.riena.navigation.IPresentationProviderService;
import org.eclipse.riena.navigation.IWorkAreaPresentationDefinition;
import org.eclipse.riena.ui.ridgets.viewcontroller.IViewController;
-
-import org.eclipse.equinox.log.Logger;
import org.osgi.service.log.LogService;
/**
@@ -190,13 +190,15 @@ public class PresentationProviderService implements IPresentationProviderService
/**
* @see org.eclipse.riena.navigation.IPresentationProviderService#getViewId(org.eclipse.riena.navigation.INavigationNodeId)
*/
- public String getViewId(INavigationNodeId targetId) {
- IWorkAreaPresentationDefinition presentationDefinition = getPresentationDefinitionWA(targetId.getTypeId());
+ public String getViewId(INavigationNodeId nodeId) {
+ IWorkAreaPresentationDefinition presentationDefinition = getPresentationDefinitionWA(nodeId.getTypeId());
if (presentationDefinition != null) {
return presentationDefinition.getViewId();
+ } else {
+ throw new ApplicationModelFailure("No presentation definition found for node '" + nodeId.getTypeId()
+ + "'.");
}
- return null;
}
/*
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/AllTests.java
index 13d9acd..110955f 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/AllTests.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/AllTests.java
@@ -22,9 +22,6 @@ import org.eclipse.riena.navigation.ui.swt.lnf.renderer.ShellBorderRendererTest;
import org.eclipse.riena.navigation.ui.swt.lnf.rienadefault.EmbeddedBorderRendererTest;
import org.eclipse.riena.navigation.ui.swt.lnf.rienadefault.EmbeddedTitlebarRendererTest;
import org.eclipse.riena.navigation.ui.swt.lnf.rienadefault.RienaDefaultLnfTest;
-import org.eclipse.riena.navigation.ui.swt.presentation.SwtViewIdTest;
-import org.eclipse.riena.navigation.ui.swt.views.ApplicationViewAdvisorTest;
-import org.eclipse.riena.navigation.ui.swt.views.GrabCornerListenerWithTrackerTest;
/**
* Tests all test cases within package:
@@ -35,17 +32,18 @@ public class AllTests extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite(AllTests.class.getName());
+
+ suite.addTest(org.eclipse.riena.navigation.ui.swt.presentation.AllTests.suite());
+ suite.addTest(org.eclipse.riena.navigation.ui.swt.views.AllTests.suite());
+
suite.addTestSuite(DefaultSwtControlRidgetMapperTest.class);
suite.addTestSuite(AbstractLnfResourceTest.class);
suite.addTestSuite(LnfManagerTest.class);
suite.addTestSuite(EmbeddedBorderRendererTest.class);
suite.addTestSuite(EmbeddedTitlebarRendererTest.class);
suite.addTestSuite(RienaDefaultLnfTest.class);
- suite.addTestSuite(SwtViewIdTest.class);
suite.addTestSuite(ModuleItemTest.class);
suite.addTestSuite(ShellBorderRendererTest.class);
- suite.addTestSuite(ApplicationViewAdvisorTest.class);
- suite.addTestSuite(GrabCornerListenerWithTrackerTest.class);
return suite;
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/AllTests.java
new file mode 100644
index 0000000..d81b17c
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/AllTests.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.navigation.ui.swt.presentation;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ *
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.riena.navigation.ui.swt.presentation");
+ // $JUnit-BEGIN$
+ suite.addTestSuite(SwtViewIdTest.class);
+ suite.addTestSuite(SwtPresentationManagerTest.class);
+ // $JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManagerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManagerTest.java
new file mode 100644
index 0000000..5159824
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManagerTest.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.navigation.ui.swt.presentation;
+
+import org.eclipse.riena.navigation.model.NavigationNodeId;
+import org.eclipse.riena.navigation.model.SubModuleNode;
+import org.eclipse.riena.tests.RienaTestCase;
+
+/**
+ * Tests for the SwtPresentationManager.
+ */
+public class SwtPresentationManagerTest extends RienaTestCase {
+
+ private SwtPresentationManager swtPresentationManager;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ addPluginXml(SwtPresentationManagerTest.class, "SwtPresentationManagerTest.xml");
+
+ swtPresentationManager = new SwtPresentationManager();
+ }
+
+ public void testGetSwtViewId() throws Exception {
+
+ SubModuleNode node = new SubModuleNode();
+ node.setPresentationId(new NavigationNodeId("testId"));
+
+ SwtViewId swtViewId = swtPresentationManager.getSwtViewId(node);
+
+ assertEquals("org.eclipse.riena.navigation.ui.swt.views.TestView", swtViewId.getId());
+ assertEquals("shared", swtViewId.getSecondary());
+ }
+}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManagerTest.xml b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManagerTest.xml
new file mode 100644
index 0000000..8b2440d
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManagerTest.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="testId"
+ view="org.eclipse.riena.navigation.ui.swt.views.TestView"
+ viewController="org.eclipse.riena.navigation.ui.controllers.SubModuleController"
+ viewShared="true">
+ </workAreaPresentation>
+ </extension>
+</plugin>
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java
new file mode 100644
index 0000000..5abf4c2
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.navigation.ui.swt.views;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ *
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.riena.navigation.ui.swt.views");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(GrabCornerListenerWithTrackerTest.class);
+ suite.addTestSuite(ApplicationViewAdvisorTest.class);
+ suite.addTestSuite(SubModuleNodeViewTest.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeViewTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeViewTest.java
new file mode 100644
index 0000000..9f2c487
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeViewTest.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.navigation.ui.swt.views;
+
+import org.eclipse.riena.navigation.IApplicationModel;
+import org.eclipse.riena.navigation.ISubModuleNode;
+import org.eclipse.riena.navigation.model.ApplicationModel;
+import org.eclipse.riena.navigation.model.NavigationNodeId;
+import org.eclipse.riena.navigation.model.SubModuleNode;
+import org.eclipse.riena.navigation.ui.controllers.SubModuleController;
+import org.eclipse.riena.tests.RienaTestCase;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Tests for the SubModuleNodeView.
+ */
+public class SubModuleNodeViewTest extends RienaTestCase {
+
+ private SubModuleNodeView<SubModuleController> subModuleNodeView;
+ private SubModuleNode node;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ addPluginXml(SubModuleNodeViewTest.class, "SubModuleNodeViewTest.xml");
+
+ subModuleNodeView = new TestView();
+ node = new SubModuleNode() {
+ @Override
+ public <T> T getTypecastedAdapter(Class<T> clazz) {
+ if (clazz.equals(IApplicationModel.class)) {
+ return (T) new ApplicationModel();
+ }
+ return null;
+ }
+ };
+ node.setPresentationId(new NavigationNodeId("testId"));
+ node.setLabel("Test");
+ }
+
+ public void testCreateController() throws Exception {
+
+ subModuleNodeView.createPartControl(null);
+
+ assertTrue(subModuleNodeView.getController() instanceof SubModuleController);
+ assertEquals(node, subModuleNodeView.getController().getNavigationNode());
+ }
+
+ private class TestView extends SubModuleNodeView<SubModuleController> {
+
+ @Override
+ protected ISubModuleNode getCurrentNode() {
+ return node;
+ }
+
+ @Override
+ protected void basicCreatePartControl(Composite parent) {
+ // ignore
+ }
+ }
+
+}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeViewTest.xml b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeViewTest.xml
new file mode 100644
index 0000000..8b2440d
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleNodeViewTest.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="testId"
+ view="org.eclipse.riena.navigation.ui.swt.views.TestView"
+ viewController="org.eclipse.riena.navigation.ui.controllers.SubModuleController"
+ viewShared="true">
+ </workAreaPresentation>
+ </extension>
+</plugin>