summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-07-28 08:49:11 (EDT)
committerCarsten Drossel2008-07-28 08:49:11 (EDT)
commitd2eebc7a0699b458dd866aca68cfc91dd80b0a79 (patch)
tree9ffa3cf09964ec2999dc88054a19f69c168b41cf
parentd8d1297950ad47acd437e683b6fa07322b61e169 (diff)
downloadorg.eclipse.riena-d2eebc7a0699b458dd866aca68cfc91dd80b0a79.zip
org.eclipse.riena-d2eebc7a0699b458dd866aca68cfc91dd80b0a79.tar.gz
org.eclipse.riena-d2eebc7a0699b458dd866aca68cfc91dd80b0a79.tar.bz2
extended navigation concept - merging results from branch
-rw-r--r--org.eclipse.riena.example.client/plugin.xml23
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/application/SwtExampleApplication.java18
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleViewController.java48
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open2NavigationNodeBuilder.java47
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open3NavigationNodeBuilder.java53
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigateSubModuleView.java61
-rw-r--r--org.eclipse.riena.navigation/schema/org.eclipse.riena.navigation.NavigationNodePresentation.exsd4
7 files changed, 250 insertions, 4 deletions
diff --git a/org.eclipse.riena.example.client/plugin.xml b/org.eclipse.riena.example.client/plugin.xml
index 0715765..a62ecce 100644
--- a/org.eclipse.riena.example.client/plugin.xml
+++ b/org.eclipse.riena.example.client/plugin.xml
@@ -123,6 +123,12 @@
id="org.eclipse.riena.example.client.views.StatuslineSubModuleView"
name="org.eclipse.riena.example.client.views.StatuslineSubModuleView">
</view>
+ <view
+ allowMultiple="true"
+ class="org.eclipse.riena.example.client.views.NavigateSubModuleView"
+ id="org.eclipse.riena.example.client.views.NavigateSubModuleView"
+ name="org.eclipse.riena.example.client.views.NavigateSubModuleView">
+ </view>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
@@ -303,4 +309,21 @@
</renderer>
</extension>
+ <extension
+ point="org.eclipse.riena.navigation.NavigationNodePresentation">
+ <navigationNodePresentation
+ presentationId="open2"
+ nodeBuilder="org.eclipse.riena.example.client.navigation.model.Open2NavigationNodeBuilder"
+ parentPresentationId="app1">
+ </navigationNodePresentation>
+ </extension>
+ <extension
+ point="org.eclipse.riena.navigation.NavigationNodePresentation">
+ <navigationNodePresentation
+ presentationId="open3"
+ nodeBuilder="org.eclipse.riena.example.client.navigation.model.Open3NavigationNodeBuilder"
+ parentPresentationId="playground">
+ </navigationNodePresentation>
+ </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 6e358f8..028c207 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
@@ -15,6 +15,7 @@ import org.eclipse.riena.example.client.views.ComboView;
import org.eclipse.riena.example.client.views.FocusableView;
import org.eclipse.riena.example.client.views.ListView;
import org.eclipse.riena.example.client.views.MarkerView;
+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.SharedViewDemoView;
@@ -30,11 +31,11 @@ import org.eclipse.riena.internal.example.client.Activator;
import org.eclipse.riena.navigation.IApplicationModel;
import org.eclipse.riena.navigation.IModuleGroupNode;
import org.eclipse.riena.navigation.IModuleNode;
-import org.eclipse.riena.navigation.ISubApplication;
import org.eclipse.riena.navigation.ISubModuleNode;
import org.eclipse.riena.navigation.model.ApplicationModel;
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.SubApplication;
import org.eclipse.riena.navigation.model.SubModuleNode;
import org.eclipse.riena.navigation.ui.controllers.ApplicationViewController;
@@ -88,7 +89,7 @@ public class SwtExampleApplication extends SwtApplication {
@Override
protected IApplicationModel createModel() {
- ISubApplication subApplication = null;
+ SubApplication subApplication = null;
IModuleGroupNode moduleGroup = null;
IModuleNode module = null;
ISubModuleNode subModule = null;
@@ -99,6 +100,7 @@ public class SwtExampleApplication extends SwtApplication {
applicationModel.setIcon(createIconPath(IExampleIcons.ICON_APPLICATION));
// sub application 1
subApplication = new SubApplication("Navigation"); //$NON-NLS-1$
+ subApplication.setPresentationId(new NavigationNodeId("app1")); //$NON-NLS-1$
subApplication.setIcon(createIconPath(IExampleIcons.ICON_APPLICATION));
presentation.present(subApplication, "subapplication.1"); //$NON-NLS-1$
applicationModel.addChild(subApplication);
@@ -149,6 +151,7 @@ public class SwtExampleApplication extends SwtApplication {
// Playground
subApplication = new SubApplication("Playground"); //$NON-NLS-1$
+ subApplication.setPresentationId(new NavigationNodeId("playground")); //$NON-NLS-1$
subApplication.setIcon(createIconPath(IExampleIcons.ICON_SAMPLE));
presentation.present(subApplication, "subapplication.2"); //$NON-NLS-1$
applicationModel.addChild(subApplication);
@@ -248,6 +251,17 @@ public class SwtExampleApplication extends SwtApplication {
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);
+
return applicationModel;
}
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleViewController.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleViewController.java
new file mode 100644
index 0000000..819eb94
--- /dev/null
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleViewController.java
@@ -0,0 +1,48 @@
+/****************************************************************
+ * *
+ * Copyright (c) 2004-2008 compeople AG *
+ * All rights reserved. The use of this program and the *
+ * accompanying materials are subject to license terms. *
+ * *
+ ****************************************************************/
+package org.eclipse.riena.example.client.controllers;
+
+import org.eclipse.riena.navigation.ISubModuleNode;
+import org.eclipse.riena.navigation.model.NavigationNodeId;
+import org.eclipse.riena.navigation.ui.controllers.SubModuleNodeViewController;
+import org.eclipse.riena.ui.ridgets.IActionListener;
+import org.eclipse.riena.ui.ridgets.IActionRidget;
+import org.eclipse.riena.ui.ridgets.ITextFieldRidget;
+import org.eclipse.riena.ui.ridgets.uibinding.IInjectAllRidgetsAtOnce;
+
+public class NavigateSubModuleViewController extends SubModuleNodeViewController implements IInjectAllRidgetsAtOnce {
+
+ private ITextFieldRidget target;
+
+ public NavigateSubModuleViewController(ISubModuleNode navigationNode) {
+ super(navigationNode);
+ }
+
+ public void configureRidgets() {
+
+ target = (ITextFieldRidget) getRidget("target");
+
+ IActionRidget navigate = (IActionRidget) getRidget("navigate");
+ navigate.setText("Go");
+ navigate.addListener(new NavigateListener());
+
+ setDefaultButton(navigate);
+ }
+
+ private class NavigateListener implements IActionListener {
+
+ /**
+ * @see org.eclipse.riena.ui.ridgets.IActionListener#callback()
+ */
+ public void callback() {
+ getNavigationNode().navigate(new NavigationNodeId(target.getText()));
+ }
+
+ }
+
+}
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
new file mode 100644
index 0000000..a2318ab
--- /dev/null
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open2NavigationNodeBuilder.java
@@ -0,0 +1,47 @@
+/****************************************************************
+ * *
+ * Copyright (c) 2004-2008 compeople AG *
+ * All rights reserved. The use of this program and the *
+ * accompanying materials are subject to license terms. *
+ * *
+ ****************************************************************/
+package org.eclipse.riena.example.client.navigation.model;
+
+import org.eclipse.riena.example.client.views.FocusableView;
+import org.eclipse.riena.example.client.views.MarkerView;
+import org.eclipse.riena.navigation.IModuleGroupNode;
+import org.eclipse.riena.navigation.IModuleNode;
+import org.eclipse.riena.navigation.INavigationNodeId;
+import org.eclipse.riena.navigation.INavigationNodeBuilder;
+import org.eclipse.riena.navigation.model.ModuleGroupNode;
+import org.eclipse.riena.navigation.model.ModuleNode;
+import org.eclipse.riena.navigation.model.SubModuleNode;
+import org.eclipse.riena.navigation.ui.swt.presentation.SwtPresentationManagerAccessor;
+
+/**
+ *
+ */
+public class Open2NavigationNodeBuilder implements INavigationNodeBuilder {
+
+ /**
+ * @see org.eclipse.riena.navigation.INavigationNodeBuilder#buildNode()
+ */
+ public IModuleGroupNode buildNode(INavigationNodeId presentationId) {
+ ModuleGroupNode node = new ModuleGroupNode("New Group");
+ node.setPresentationId(presentationId);
+ IModuleNode module = new ModuleNode("New Module");
+ node.addChild(module);
+ SubModuleNode subModule = new SubModuleNode("New SubModule 1");
+ // TODO get presentation via presentationId from extension point
+ // subModule.setPresentationId("child1");
+ SwtPresentationManagerAccessor.getManager().present(subModule, FocusableView.ID);
+ module.addChild(subModule);
+ subModule = new SubModuleNode("New SubModule 2");
+ // TODO get presentation via presentationId from extension point
+ // subModule.setPresentationId("child2");
+ SwtPresentationManagerAccessor.getManager().present(subModule, MarkerView.ID);
+ module.addChild(subModule);
+ return node;
+ }
+
+}
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
new file mode 100644
index 0000000..486a462
--- /dev/null
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open3NavigationNodeBuilder.java
@@ -0,0 +1,53 @@
+/****************************************************************
+ * *
+ * Copyright (c) 2004-2008 compeople AG *
+ * All rights reserved. The use of this program and the *
+ * accompanying materials are subject to license terms. *
+ * *
+ ****************************************************************/
+package org.eclipse.riena.example.client.navigation.model;
+
+import org.eclipse.riena.example.client.views.FocusableView;
+import org.eclipse.riena.example.client.views.MarkerView;
+import org.eclipse.riena.example.client.views.TreeView;
+import org.eclipse.riena.navigation.IModuleGroupNode;
+import org.eclipse.riena.navigation.IModuleNode;
+import org.eclipse.riena.navigation.INavigationNodeId;
+import org.eclipse.riena.navigation.INavigationNodeBuilder;
+import org.eclipse.riena.navigation.model.ModuleGroupNode;
+import org.eclipse.riena.navigation.model.ModuleNode;
+import org.eclipse.riena.navigation.model.SubModuleNode;
+import org.eclipse.riena.navigation.ui.swt.presentation.SwtPresentationManagerAccessor;
+
+/**
+ *
+ */
+public class Open3NavigationNodeBuilder implements INavigationNodeBuilder {
+
+ /**
+ * @see org.eclipse.riena.navigation.INavigationNodeBuilder#buildNode()
+ */
+ public IModuleGroupNode buildNode(INavigationNodeId presentationId) {
+ ModuleGroupNode node = new ModuleGroupNode("New Group");
+ node.setPresentationId(presentationId);
+ IModuleNode module = new ModuleNode("New Module");
+ node.addChild(module);
+ SubModuleNode subModule = new SubModuleNode("New SubModule 1");
+ // TODO get presentation via presentationId from extension point
+ // subModule.setPresentationId("child1");
+ SwtPresentationManagerAccessor.getManager().present(subModule, FocusableView.ID);
+ module.addChild(subModule);
+ subModule = new SubModuleNode("New SubModule 2");
+ // TODO get presentation via presentationId from extension point
+ // subModule.setPresentationId("child2");
+ SwtPresentationManagerAccessor.getManager().present(subModule, MarkerView.ID);
+ module.addChild(subModule);
+ subModule = new SubModuleNode("New SubModule 3");
+ // TODO get presentation via presentationId from extension point
+ // subModule.setPresentationId("child3");
+ SwtPresentationManagerAccessor.getManager().present(subModule, TreeView.ID);
+ module.addChild(subModule);
+ return node;
+ }
+
+}
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
new file mode 100644
index 0000000..24923ca
--- /dev/null
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigateSubModuleView.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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.views;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.riena.example.client.controllers.NavigateSubModuleViewController;
+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;
+import org.eclipse.riena.ui.ridgets.uibinding.InjectAllAtOnceBindingManager;
+import org.eclipse.riena.ui.swt.utils.SWTBindingPropertyLocator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * SWT {@link IComboRidget} sample.
+ */
+public class NavigateSubModuleView extends SubModuleNodeView<NavigateSubModuleViewController> {
+
+ public static final String ID = NavigateSubModuleView.class.getName();
+
+ @Override
+ protected void basicCreatePartControl(Composite parent) {
+ parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
+ parent.setLayout(new GridLayout(1, false));
+ GridDataFactory fillFactory = GridDataFactory.fillDefaults();
+
+ UIControlsFactory.createLabel(parent, "Navigate To:"); //$NON-NLS-1$
+ Text target = UIControlsFactory.createText(parent);
+ fillFactory.applyTo(target);
+ addUIControl(target, "target"); //$NON-NLS-1$
+
+ Button navigate = UIControlsFactory.createButton(parent);
+ fillFactory.applyTo(navigate);
+ addUIControl(navigate, "navigate"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected NavigateSubModuleViewController createController(ISubModuleNode subModuleNode) {
+ return new NavigateSubModuleViewController(subModuleNode);
+ }
+
+ protected IBindingManager createBindingManager() {
+ return new InjectAllAtOnceBindingManager(new SWTBindingPropertyLocator(), new DefaultSwtControlRidgetMapper());
+ }
+
+}
diff --git a/org.eclipse.riena.navigation/schema/org.eclipse.riena.navigation.NavigationNodePresentation.exsd b/org.eclipse.riena.navigation/schema/org.eclipse.riena.navigation.NavigationNodePresentation.exsd
index cc4e51a..84b744f 100644
--- a/org.eclipse.riena.navigation/schema/org.eclipse.riena.navigation.NavigationNodePresentation.exsd
+++ b/org.eclipse.riena.navigation/schema/org.eclipse.riena.navigation.NavigationNodePresentation.exsd
@@ -56,13 +56,13 @@
</documentation>
</annotation>
</attribute>
- <attribute name="nodeProvider" type="string">
+ <attribute name="nodeBuilder" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.riena.navigation.INavigationNodeProvider"/>
+ <meta.attribute kind="java" basedOn=":org.eclipse.riena.navigation.INavigationNodeBuilder"/>
</appinfo>
</annotation>
</attribute>