summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-08-21 09:25:06 (EDT)
committerCarsten Drossel2008-08-21 09:25:06 (EDT)
commit62c5240aff3f9be0fa8e2e4bc9e433fbc314bc7e (patch)
treea6238e8031b899dab671ead574f66c17e470a405
parente000e5ef1f0aedeb4f0510fd86bb07fc3649abc6 (diff)
downloadorg.eclipse.riena-62c5240aff3f9be0fa8e2e4bc9e433fbc314bc7e.zip
org.eclipse.riena-62c5240aff3f9be0fa8e2e4bc9e433fbc314bc7e.tar.gz
org.eclipse.riena-62c5240aff3f9be0fa8e2e4bc9e433fbc314bc7e.tar.bz2
undo using new findNode()-method of INavigationNode
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/PresentationProviderService.java23
1 files changed, 22 insertions, 1 deletions
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 91b4a09..b41f78c 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
@@ -67,7 +67,7 @@ public class PresentationProviderService implements IPresentationProviderService
@SuppressWarnings("unchecked")
public INavigationNode<?> provideNode(INavigationNode<?> sourceNode, INavigationNodeId targetId,
NavigationArgument argument) {
- INavigationNode<?> targetNode = getRootNode(sourceNode).findNode(targetId);
+ INavigationNode<?> targetNode = findNode(getRootNode(sourceNode), targetId);
if (targetNode == null) {
if (LOGGER.isLoggable(LogService.LOG_DEBUG)) {
LOGGER.log(LogService.LOG_DEBUG, "createNode: " + targetId);
@@ -151,6 +151,27 @@ public class PresentationProviderService implements IPresentationProviderService
}
/**
+ * @param node
+ * @param targetId
+ * @return
+ */
+ protected INavigationNode<?> findNode(INavigationNode<?> node, INavigationNodeId targetId) {
+ if (targetId == null) {
+ return null;
+ }
+ if (targetId.equals(node.getNodeId())) {
+ return node;
+ }
+ for (INavigationNode<?> child : node.getChildren()) {
+ INavigationNode<?> foundNode = findNode(child, targetId);
+ if (foundNode != null) {
+ return foundNode;
+ }
+ }
+ return null;
+ }
+
+ /**
* This is the basic SWT implementation from Riena. It returns the matching
* view id for the given navigationNodeId
*