summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-07-31 11:45:42 (EDT)
committerCarsten Drossel2008-07-31 11:45:42 (EDT)
commit9ca2e7b25c6708b2b359f653e28cb9c09422021d (patch)
treec47d738e693c9283e0777dc1f9e65fdf21fa4d22
parent27a04de41132b5e8410c440b1ccce902e7bb9105 (diff)
downloadorg.eclipse.riena-9ca2e7b25c6708b2b359f653e28cb9c09422021d.zip
org.eclipse.riena-9ca2e7b25c6708b2b359f653e28cb9c09422021d.tar.gz
org.eclipse.riena-9ca2e7b25c6708b2b359f653e28cb9c09422021d.tar.bz2
navigate example using workAreaPresentation extension point
-rw-r--r--org.eclipse.riena.example.client/plugin.xml40
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/ComboAndListNodeBuilder.java12
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/TableTextAndTreeNodeBuilder.java17
-rw-r--r--org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/presentation/SwtPresentationManager.java22
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IPresentationProviderService.java2
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IWorkAreaPresentationDefinition.java7
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/PresentationProviderService.java12
7 files changed, 90 insertions, 22 deletions
diff --git a/org.eclipse.riena.example.client/plugin.xml b/org.eclipse.riena.example.client/plugin.xml
index 72cc8b8..2335cff 100644
--- a/org.eclipse.riena.example.client/plugin.xml
+++ b/org.eclipse.riena.example.client/plugin.xml
@@ -325,5 +325,45 @@
parentPresentationId="playground">
</navigationNodePresentation>
</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">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.list"
+ view="org.eclipse.riena.example.client.views.ListSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.ListSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.table"
+ view="org.eclipse.riena.example.client.views.TableSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.TableSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.text"
+ view="org.eclipse.riena.example.client.views.TextSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.TextSubModuleController">
+ </workAreaPresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.WorkAreaPresentation">
+ <workAreaPresentation
+ presentationId="org.eclipse.riena.example.tree"
+ view="org.eclipse.riena.example.client.views.TreeSubModuleView"
+ viewController="org.eclipse.riena.example.client.controllers.TreeSubModuleController">
+ </workAreaPresentation>
+ </extension>
</plugin>
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/ComboAndListNodeBuilder.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/ComboAndListNodeBuilder.java
index fb26f5b..08de496 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/ComboAndListNodeBuilder.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/ComboAndListNodeBuilder.java
@@ -7,16 +7,14 @@
****************************************************************/
package org.eclipse.riena.example.client.navigation.model;
-import org.eclipse.riena.example.client.views.ComboSubModuleView;
-import org.eclipse.riena.example.client.views.ListSubModuleView;
import org.eclipse.riena.navigation.IModuleGroupNode;
import org.eclipse.riena.navigation.IModuleNode;
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.eclipse.riena.navigation.ui.swt.presentation.SwtPresentationManagerAccessor;
/**
*
@@ -32,14 +30,10 @@ public class ComboAndListNodeBuilder implements INavigationNodeBuilder {
IModuleNode module = new ModuleNode("Combo&List");
node.addChild(module);
SubModuleNode subModule = new SubModuleNode("Combo");
- // TODO get presentation via presentationId from extension point
- // subModule.setPresentationId("child1");
- SwtPresentationManagerAccessor.getManager().present(subModule, ComboSubModuleView.ID);
+ subModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.combo"));
module.addChild(subModule);
subModule = new SubModuleNode("List");
- // TODO get presentation via presentationId from extension point
- // subModule.setPresentationId("child2");
- SwtPresentationManagerAccessor.getManager().present(subModule, ListSubModuleView.ID);
+ subModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.list"));
module.addChild(subModule);
return node;
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/TableTextAndTreeNodeBuilder.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/TableTextAndTreeNodeBuilder.java
index 3209d7f..372a458 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/TableTextAndTreeNodeBuilder.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/TableTextAndTreeNodeBuilder.java
@@ -7,17 +7,14 @@
****************************************************************/
package org.eclipse.riena.example.client.navigation.model;
-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.navigation.IModuleGroupNode;
import org.eclipse.riena.navigation.IModuleNode;
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.eclipse.riena.navigation.ui.swt.presentation.SwtPresentationManagerAccessor;
/**
*
@@ -33,19 +30,13 @@ public class TableTextAndTreeNodeBuilder implements INavigationNodeBuilder {
IModuleNode module = new ModuleNode("Table,Text&Tree");
node.addChild(module);
SubModuleNode subModule = new SubModuleNode("Table");
- // TODO get presentation via presentationId from extension point
- // subModule.setPresentationId("child1");
- SwtPresentationManagerAccessor.getManager().present(subModule, TableSubModuleView.ID);
+ subModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.table"));
module.addChild(subModule);
subModule = new SubModuleNode("Text");
- // TODO get presentation via presentationId from extension point
- // subModule.setPresentationId("child2");
- SwtPresentationManagerAccessor.getManager().present(subModule, TextSubModuleView.ID);
+ subModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.text"));
module.addChild(subModule);
subModule = new SubModuleNode("Tree");
- // TODO get presentation via presentationId from extension point
- // subModule.setPresentationId("child3");
- SwtPresentationManagerAccessor.getManager().present(subModule, TreeSubModuleView.ID);
+ subModule.setPresentationId(new NavigationNodeId("org.eclipse.riena.example.tree"));
module.addChild(subModule);
return node;
}
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 fa45430..70516b4 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
@@ -16,8 +16,11 @@ import java.util.Map;
import org.eclipse.riena.navigation.IAction;
import org.eclipse.riena.navigation.INavigationNode;
+import org.eclipse.riena.navigation.INavigationNodeId;
+import org.eclipse.riena.navigation.IPresentationProviderService;
import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.listener.SubModuleNodeListener;
+import org.eclipse.riena.navigation.model.PresentationProviderServiceAccessor;
/**
* Manages the reference between the navigation nodes and the view id's
@@ -46,6 +49,18 @@ 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;
+ }
+ }
+ }
+
return views.get(pNode);
}
@@ -153,4 +168,11 @@ public class SwtPresentationManager {
}
+ 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/IPresentationProviderService.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IPresentationProviderService.java
index 045f502..0d824b2 100644
--- a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IPresentationProviderService.java
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IPresentationProviderService.java
@@ -40,6 +40,8 @@ public interface IPresentationProviderService {
Object createView(INavigationNodeId targetId);
+ String getViewId(INavigationNodeId targetId);
+
/**
* Returns the view controller for the work area presentation for the given
* navigationNodeId
diff --git a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IWorkAreaPresentationDefinition.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IWorkAreaPresentationDefinition.java
index 4d655d5..4fcc400 100644
--- a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IWorkAreaPresentationDefinition.java
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IWorkAreaPresentationDefinition.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.navigation;
+import org.eclipse.riena.core.extension.MapName;
import org.eclipse.riena.ui.ridgets.viewcontroller.IViewController;
/**
@@ -39,4 +40,10 @@ public interface IWorkAreaPresentationDefinition extends IPresentationDefinition
Object createView();
+ /**
+ * @return The view id.
+ */
+ @MapName("view")
+ String getViewId();
+
}
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 16f2586..426d072 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
@@ -187,6 +187,18 @@ public class PresentationProviderService implements IPresentationProviderService
return view;
}
+ /**
+ * @see org.eclipse.riena.navigation.IPresentationProviderService#getViewId(org.eclipse.riena.navigation.INavigationNodeId)
+ */
+ public String getViewId(INavigationNodeId targetId) {
+ IWorkAreaPresentationDefinition presentationDefinition = getPresentationDefinitionWA(targetId.getTypeId());
+
+ if (presentationDefinition != null) {
+ return presentationDefinition.getViewId();
+ }
+ return null;
+ }
+
/*
* (non-Javadoc)
*