summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-07-25 11:39:09 (EDT)
committerCarsten Drossel2008-07-25 11:39:09 (EDT)
commitdac03d8a3996e6f2d058c729c2656fb9338acdf4 (patch)
tree520df6a3ac346d6009a451f6d619f3b22d255065
parentb279dbb4880760e72e9112c15a1b5f44560a054b (diff)
downloadorg.eclipse.riena-dac03d8a3996e6f2d058c729c2656fb9338acdf4.zip
org.eclipse.riena-dac03d8a3996e6f2d058c729c2656fb9338acdf4.tar.gz
org.eclipse.riena-dac03d8a3996e6f2d058c729c2656fb9338acdf4.tar.bz2
added INavigationArgumentListener to be notified about 'results' of navigation
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open2NavigationNodeBuilder.java2
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open3NavigationNodeBuilder.java2
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationArgumentListener.java20
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNode.java12
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNodeProvider.java2
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationProcessor.java3
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/IPresentationProviderService.java3
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationNode.java12
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationProcessor.java17
-rw-r--r--org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/PresentationProviderService.java11
10 files changed, 68 insertions, 16 deletions
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open2NavigationNodeBuilder.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open2NavigationNodeBuilder.java
index 58f6fdd..06b5458 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open2NavigationNodeBuilder.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open2NavigationNodeBuilder.java
@@ -26,7 +26,7 @@ public class Open2NavigationNodeBuilder implements INavigationNodeProvider {
/**
* @see org.eclipse.riena.navigation.INavigationNodeProvider#buildNode()
*/
- public IModuleGroupNode buildNode(INavigationNodeId presentationId, Object... arguments) {
+ public IModuleGroupNode buildNode(INavigationNodeId presentationId) {
ModuleGroupNode node = new ModuleGroupNode("New Group");
node.setPresentationId(presentationId);
IModuleNode module = new ModuleNode("New Module");
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open3NavigationNodeBuilder.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open3NavigationNodeBuilder.java
index e8e2726..b0732af 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open3NavigationNodeBuilder.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open3NavigationNodeBuilder.java
@@ -27,7 +27,7 @@ public class Open3NavigationNodeBuilder implements INavigationNodeProvider {
/**
* @see org.eclipse.riena.navigation.INavigationNodeProvider#buildNode()
*/
- public IModuleGroupNode buildNode(INavigationNodeId presentationId, Object... arguments) {
+ public IModuleGroupNode buildNode(INavigationNodeId presentationId) {
ModuleGroupNode node = new ModuleGroupNode("New Group");
node.setPresentationId(presentationId);
IModuleNode module = new ModuleNode("New Module");
diff --git a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationArgumentListener.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationArgumentListener.java
new file mode 100644
index 0000000..526319a
--- /dev/null
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationArgumentListener.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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;
+
+/**
+ *
+ */
+public interface INavigationArgumentListener {
+
+ void valueChanged(Object argument);
+
+}
diff --git a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNode.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNode.java
index f5ee3fc..c2a2a53 100644
--- a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNode.java
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNode.java
@@ -390,9 +390,21 @@ public interface INavigationNode<C extends INavigationNode<?>> extends ITypecast
* navigates to it.
*
* @param targetId
+ * @param argument
* Refers to an extension point describing the target node.
* @see INavigationNodeProvider
*/
void navigate(INavigationNodeId targetId, Object argument);
+ /**
+ * Creates the specified navigation node (if it does not already exist) and
+ * navigates to it.
+ *
+ * @param targetId
+ * @param argument
+ * @param argumentListener
+ * @see INavigationNodeProvider
+ */
+ void navigate(INavigationNodeId targetId, Object argument, INavigationArgumentListener argumentListener);
+
}
diff --git a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNodeProvider.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNodeProvider.java
index 6b47e32..c59ca3f 100644
--- a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNodeProvider.java
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationNodeProvider.java
@@ -18,6 +18,6 @@ package org.eclipse.riena.navigation;
*/
public interface INavigationNodeProvider {
- INavigationNode<?> buildNode(INavigationNodeId INavigationNodeId, Object... arguments);
+ INavigationNode<?> buildNode(INavigationNodeId INavigationNodeId);
}
diff --git a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationProcessor.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationProcessor.java
index 1ac4791..559fdbc 100644
--- a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationProcessor.java
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/INavigationProcessor.java
@@ -25,6 +25,7 @@ public interface INavigationProcessor {
void create(INavigationNode<?> sourceNode, INavigationNodeId targetId);
- void navigate(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument);
+ void navigate(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument,
+ INavigationArgumentListener argumentListener);
}
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 dd2d8d7..d08ce0e 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
@@ -30,7 +30,8 @@ public interface IPresentationProviderService {
* @return
*/
- INavigationNode<?> createNode(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument);
+ INavigationNode<?> createNode(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument,
+ INavigationArgumentListener argumentListener);
/**
* Return an instance of a view
diff --git a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationNode.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationNode.java
index 0465f46..5d33765 100644
--- a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationNode.java
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationNode.java
@@ -21,6 +21,7 @@ import org.eclipse.riena.core.marker.IMarkable;
import org.eclipse.riena.core.marker.IMarker;
import org.eclipse.riena.core.marker.Markable;
import org.eclipse.riena.navigation.IAction;
+import org.eclipse.riena.navigation.INavigationArgumentListener;
import org.eclipse.riena.navigation.INavigationContext;
import org.eclipse.riena.navigation.INavigationNode;
import org.eclipse.riena.navigation.INavigationNodeId;
@@ -796,7 +797,16 @@ public abstract class NavigationNode<S extends INavigationNode<C>, C extends INa
* java.lang.Object)
*/
public void navigate(INavigationNodeId targetId, Object argument) {
- getNavigationProcessor().navigate(this, targetId, argument);
+ navigate(targetId, argument, null);
+ }
+
+ /**
+ * @see org.eclipse.riena.navigation.INavigationNode#navigate(org.eclipse.riena.navigation.INavigationNodeId,
+ * java.lang.Object,
+ * org.eclipse.riena.navigation.INavigationArgumentListener)
+ */
+ public void navigate(INavigationNodeId targetId, Object argument, INavigationArgumentListener argumentListener) {
+ getNavigationProcessor().navigate(this, targetId, argument, argumentListener);
}
/**
diff --git a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationProcessor.java b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationProcessor.java
index 8eaec77..f16b599 100644
--- a/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationProcessor.java
+++ b/org.eclipse.riena.navigation/src/org/eclipse/riena/navigation/model/NavigationProcessor.java
@@ -17,6 +17,7 @@ import java.util.LinkedList;
import java.util.List;
import org.eclipse.riena.navigation.IModuleNode;
+import org.eclipse.riena.navigation.INavigationArgumentListener;
import org.eclipse.riena.navigation.INavigationContext;
import org.eclipse.riena.navigation.INavigationNode;
import org.eclipse.riena.navigation.INavigationNodeId;
@@ -108,22 +109,26 @@ public class NavigationProcessor implements INavigationProcessor {
* org.eclipse.riena.navigation.INavigationNodeId)
*/
public void create(INavigationNode<?> sourceNode, INavigationNodeId targetId) {
- createTarget(sourceNode, targetId, null);
+ createTarget(sourceNode, targetId, null, null);
}
/**
* @see org.eclipse.riena.navigation.INavigationProcessor#navigate(org.eclipse.riena.navigation.INavigationNode,
- * org.eclipse.riena.navigation.INavigationNodeId, java.lang.Object)
+ * org.eclipse.riena.navigation.INavigationNodeId, java.lang.Object,
+ * org.eclipse.riena.navigation.INavigationArgumentListener)
*/
- public void navigate(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument) {
+ public void navigate(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument,
+ INavigationArgumentListener argumentListener) {
- INavigationNode<?> targetNode = createTarget(sourceNode, targetId, argument);
+ INavigationNode<?> targetNode = createTarget(sourceNode, targetId, argument, argumentListener);
targetNode.activate();
}
- private INavigationNode<?> createTarget(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument) {
- INavigationNode<?> targetNode = getPresentationDefinitionService().createNode(sourceNode, targetId, argument);
+ private INavigationNode<?> createTarget(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument,
+ INavigationArgumentListener argumentListener) {
+ INavigationNode<?> targetNode = getPresentationDefinitionService().createNode(sourceNode, targetId, argument,
+ argumentListener);
return targetNode;
}
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 f4c3b85..b12f0e7 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
@@ -12,6 +12,7 @@ package org.eclipse.riena.navigation.model;
import org.eclipse.riena.core.injector.Inject;
import org.eclipse.riena.internal.navigation.Activator;
+import org.eclipse.riena.navigation.INavigationArgumentListener;
import org.eclipse.riena.navigation.INavigationNode;
import org.eclipse.riena.navigation.INavigationNodeId;
import org.eclipse.riena.navigation.INavigationNodePresentationDefiniton;
@@ -58,19 +59,21 @@ public class PresentationProviderService implements IPresentationProviderService
/**
* @see org.eclipse.riena.navigation.IPresentationProviderService#createNode(org.eclipse.riena.navigation.INavigationNode,
- * org.eclipse.riena.navigation.INavigationNodeId, java.lang.Object)
+ * org.eclipse.riena.navigation.INavigationNodeId, java.lang.Object,
+ * org.eclipse.riena.navigation.INavigationArgumentListener)
*/
- public INavigationNode<?> createNode(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument) {
+ public INavigationNode<?> createNode(INavigationNode<?> sourceNode, INavigationNodeId targetId, Object argument,
+ INavigationArgumentListener argumentListener) {
INavigationNode<?> targetNode = findNode(getRootNode(sourceNode), targetId);
if (targetNode == null) {
INavigationNodePresentationDefiniton presentationDefinition = getPresentationDefinitionNN(targetId);
if (presentationDefinition != null) {
INavigationNodeProvider builder = presentationDefinition.createNodeProvider();
- targetNode = builder.buildNode(targetId, argument);
+ targetNode = builder.buildNode(targetId);
INavigationNode parentNode = createNode(sourceNode, new NavigationNodeId(presentationDefinition
- .getParentPresentationId()), null);
+ .getParentPresentationId()), null, null);
parentNode.addChild(targetNode);
} else {
// TODO throw some new type of failure