summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-07-30 11:23:24 (EDT)
committerCarsten Drossel2008-07-30 11:23:24 (EDT)
commit8020ce3d9bd0629d75082b685ace7f7e64f85dbd (patch)
tree43dedae8921a60417c0656d773a3b4539c805157
parentbb29d0561c4372107cf3f96d088f61a3a35926fe (diff)
downloadorg.eclipse.riena-8020ce3d9bd0629d75082b685ace7f7e64f85dbd.zip
org.eclipse.riena-8020ce3d9bd0629d75082b685ace7f7e64f85dbd.tar.gz
org.eclipse.riena-8020ce3d9bd0629d75082b685ace7f7e64f85dbd.tar.bz2
improved navigate example
-rw-r--r--org.eclipse.riena.example.client/plugin.xml8
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/controllers/NavigateSubModuleViewController.java28
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/ComboAndListNodeBuilder.java (renamed from org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open2NavigationNodeBuilder.java)20
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/TableTextAndTreeNodeBuilder.java (renamed from org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/navigation/model/Open3NavigationNodeBuilder.java)23
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/NavigateSubModuleView.java16
5 files changed, 51 insertions, 44 deletions
diff --git a/org.eclipse.riena.example.client/plugin.xml b/org.eclipse.riena.example.client/plugin.xml
index a62ecce..cbe4a1f 100644
--- a/org.eclipse.riena.example.client/plugin.xml
+++ b/org.eclipse.riena.example.client/plugin.xml
@@ -312,16 +312,16 @@
<extension
point="org.eclipse.riena.navigation.NavigationNodePresentation">
<navigationNodePresentation
- presentationId="open2"
- nodeBuilder="org.eclipse.riena.example.client.navigation.model.Open2NavigationNodeBuilder"
+ presentationId="org.eclipse.riena.example.navigation.comboAndList"
+ nodeBuilder="org.eclipse.riena.example.client.navigation.model.ComboAndListNodeBuilder"
parentPresentationId="app1">
</navigationNodePresentation>
</extension>
<extension
point="org.eclipse.riena.navigation.NavigationNodePresentation">
<navigationNodePresentation
- presentationId="open3"
- nodeBuilder="org.eclipse.riena.example.client.navigation.model.Open3NavigationNodeBuilder"
+ presentationId="org.eclipse.riena.example.navigation.tableTextAndTree"
+ nodeBuilder="org.eclipse.riena.example.client.navigation.model.TableTextAndTreeNodeBuilder"
parentPresentationId="playground">
</navigationNodePresentation>
</extension>
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
index 819eb94..5690e30 100644
--- 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
@@ -12,35 +12,43 @@ 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 comboAndList = (IActionRidget) getRidget("comboAndList");
+ comboAndList.setText("Combo and List (SubApplication 1)");
+ comboAndList.addListener(new ComboAndListListener());
+
+ IActionRidget tableTextAndTree = (IActionRidget) getRidget("tableTextAndTree");
+ tableTextAndTree.setText("Table, Text and Tree (SubApplication 2)");
+ tableTextAndTree.addListener(new TableTextAndTreeListener());
+ }
- IActionRidget navigate = (IActionRidget) getRidget("navigate");
- navigate.setText("Go");
- navigate.addListener(new NavigateListener());
+ private class ComboAndListListener implements IActionListener {
+
+ /**
+ * @see org.eclipse.riena.ui.ridgets.IActionListener#callback()
+ */
+ public void callback() {
+ getNavigationNode().navigate(new NavigationNodeId("org.eclipse.riena.example.navigation.comboAndList"));
+ }
- setDefaultButton(navigate);
}
- private class NavigateListener implements IActionListener {
+ private class TableTextAndTreeListener implements IActionListener {
/**
* @see org.eclipse.riena.ui.ridgets.IActionListener#callback()
*/
public void callback() {
- getNavigationNode().navigate(new NavigationNodeId(target.getText()));
+ getNavigationNode().navigate(new NavigationNodeId("org.eclipse.riena.example.navigation.tableTextAndTree"));
}
}
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/ComboAndListNodeBuilder.java
index a2318ab..d9809d8 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/ComboAndListNodeBuilder.java
@@ -7,12 +7,12 @@
****************************************************************/
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.ComboView;
+import org.eclipse.riena.example.client.views.ListView;
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.INavigationNodeId;
import org.eclipse.riena.navigation.model.ModuleGroupNode;
import org.eclipse.riena.navigation.model.ModuleNode;
import org.eclipse.riena.navigation.model.SubModuleNode;
@@ -21,25 +21,25 @@ import org.eclipse.riena.navigation.ui.swt.presentation.SwtPresentationManagerAc
/**
*
*/
-public class Open2NavigationNodeBuilder implements INavigationNodeBuilder {
+public class ComboAndListNodeBuilder implements INavigationNodeBuilder {
/**
* @see org.eclipse.riena.navigation.INavigationNodeBuilder#buildNode()
*/
public IModuleGroupNode buildNode(INavigationNodeId presentationId) {
- ModuleGroupNode node = new ModuleGroupNode("New Group");
+ ModuleGroupNode node = new ModuleGroupNode("Combo&List");
node.setPresentationId(presentationId);
- IModuleNode module = new ModuleNode("New Module");
+ IModuleNode module = new ModuleNode("Combo&List");
node.addChild(module);
- SubModuleNode subModule = new SubModuleNode("New SubModule 1");
+ SubModuleNode subModule = new SubModuleNode("Combo");
// TODO get presentation via presentationId from extension point
// subModule.setPresentationId("child1");
- SwtPresentationManagerAccessor.getManager().present(subModule, FocusableView.ID);
+ SwtPresentationManagerAccessor.getManager().present(subModule, ComboView.ID);
module.addChild(subModule);
- subModule = new SubModuleNode("New SubModule 2");
+ subModule = new SubModuleNode("List");
// TODO get presentation via presentationId from extension point
// subModule.setPresentationId("child2");
- SwtPresentationManagerAccessor.getManager().present(subModule, MarkerView.ID);
+ SwtPresentationManagerAccessor.getManager().present(subModule, ListView.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/TableTextAndTreeNodeBuilder.java
index 486a462..a0b3606 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/TableTextAndTreeNodeBuilder.java
@@ -7,13 +7,13 @@
****************************************************************/
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.TableView;
+import org.eclipse.riena.example.client.views.TextView;
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.INavigationNodeId;
import org.eclipse.riena.navigation.model.ModuleGroupNode;
import org.eclipse.riena.navigation.model.ModuleNode;
import org.eclipse.riena.navigation.model.SubModuleNode;
@@ -22,32 +22,31 @@ import org.eclipse.riena.navigation.ui.swt.presentation.SwtPresentationManagerAc
/**
*
*/
-public class Open3NavigationNodeBuilder implements INavigationNodeBuilder {
+public class TableTextAndTreeNodeBuilder implements INavigationNodeBuilder {
/**
* @see org.eclipse.riena.navigation.INavigationNodeBuilder#buildNode()
*/
public IModuleGroupNode buildNode(INavigationNodeId presentationId) {
- ModuleGroupNode node = new ModuleGroupNode("New Group");
+ ModuleGroupNode node = new ModuleGroupNode("Table,Text&Tree");
node.setPresentationId(presentationId);
- IModuleNode module = new ModuleNode("New Module");
+ IModuleNode module = new ModuleNode("Table,Text&Tree");
node.addChild(module);
- SubModuleNode subModule = new SubModuleNode("New SubModule 1");
+ SubModuleNode subModule = new SubModuleNode("Table");
// TODO get presentation via presentationId from extension point
// subModule.setPresentationId("child1");
- SwtPresentationManagerAccessor.getManager().present(subModule, FocusableView.ID);
+ SwtPresentationManagerAccessor.getManager().present(subModule, TableView.ID);
module.addChild(subModule);
- subModule = new SubModuleNode("New SubModule 2");
+ subModule = new SubModuleNode("Text");
// TODO get presentation via presentationId from extension point
// subModule.setPresentationId("child2");
- SwtPresentationManagerAccessor.getManager().present(subModule, MarkerView.ID);
+ SwtPresentationManagerAccessor.getManager().present(subModule, TextView.ID);
module.addChild(subModule);
- subModule = new SubModuleNode("New SubModule 3");
+ subModule = new SubModuleNode("Tree");
// 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
index 24923ca..2ca6d7e 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
@@ -24,7 +24,6 @@ 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.
@@ -39,14 +38,15 @@ public class NavigateSubModuleView extends SubModuleNodeView<NavigateSubModuleVi
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$
+ UIControlsFactory.createLabel(parent, "Where do you want to go today?"); //$NON-NLS-1$
- Button navigate = UIControlsFactory.createButton(parent);
- fillFactory.applyTo(navigate);
- addUIControl(navigate, "navigate"); //$NON-NLS-1$
+ Button comboAndList = UIControlsFactory.createButton(parent);
+ fillFactory.applyTo(comboAndList);
+ addUIControl(comboAndList, "comboAndList"); //$NON-NLS-1$
+
+ Button tableTextAndTree = UIControlsFactory.createButton(parent);
+ fillFactory.applyTo(tableTextAndTree);
+ addUIControl(tableTextAndTree, "tableTextAndTree"); //$NON-NLS-1$
}
@Override