summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-04-30 08:15:36 (EDT)
committerCarsten Drossel2009-04-30 08:15:36 (EDT)
commit4abfcedc20e3ae6738a85cdd7cb560dce579a3cd (patch)
tree93af4a675c510f5fac8bce7b78137dad9846a4a7
parenta366cda0b818febc0c04d624b6bd25e62f664a7d (diff)
downloadorg.eclipse.riena-4abfcedc20e3ae6738a85cdd7cb560dce579a3cd.zip
org.eclipse.riena-4abfcedc20e3ae6738a85cdd7cb560dce579a3cd.tar.gz
org.eclipse.riena-4abfcedc20e3ae6738a85cdd7cb560dce579a3cd.tar.bz2
applying patch for enhancement 274494: create methods in UIControlsFactory for trees and tables
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListUsingTableSubModuleView.java4
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java7
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java16
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java15
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java15
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java15
-rw-r--r--org.eclipse.riena.ui.swt/src/org/eclipse/riena/ui/swt/utils/UIControlsFactory.java36
7 files changed, 76 insertions, 32 deletions
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListUsingTableSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListUsingTableSubModuleView.java
index e8f7033..2998c32 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListUsingTableSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ListUsingTableSubModuleView.java
@@ -19,6 +19,8 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
+
/**
* Experimental view using a single column Table instead of a List. This
* improves look&feel by using the default background color for the list rather
@@ -35,7 +37,7 @@ public class ListUsingTableSubModuleView extends ListSubModuleView {
GridDataFactory.fillDefaults().grab(false, true).span(2, 1).hint(200, SWT.DEFAULT).applyTo(tableComposite);
int style = SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.NO_BACKGROUND;
- Table listPersons = new Table(tableComposite, style);
+ Table listPersons = UIControlsFactory.createTable(tableComposite, style);
listPersons.setLinesVisible(false);
TableColumn listColumn = new TableColumn(listPersons, SWT.LEFT);
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java
index 7ac0166..0f14657 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/MarkerSubModuleView.java
@@ -155,7 +155,7 @@ public class MarkerSubModuleView extends SubModuleView<MarkerSubModuleController
hFillFactory.hint(150, hHint).applyTo(listPersons);
addUIControl(listPersons, "listPersons"); //$NON-NLS-1$
- Table tablePersons = new Table(cmpReviewed, SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
+ Table tablePersons = UIControlsFactory.createTable(cmpReviewed, SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
tablePersons.setLinesVisible(true);
tablePersons.setHeaderVisible(true);
TableColumn tac1 = new TableColumn(tablePersons, SWT.NONE);
@@ -175,11 +175,12 @@ public class MarkerSubModuleView extends SubModuleView<MarkerSubModuleController
UIControlsFactory.createLabel(group, ""); //$NON-NLS-1$
Composite cmpReviewed2 = createComposite(group, 3, true);
- Tree treePersons = new Tree(cmpReviewed2, SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
+ Tree treePersons = UIControlsFactory.createTree(cmpReviewed2, SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
hFillFactory.hint(150, hHint).applyTo(treePersons);
addUIControl(treePersons, "treePersons"); //$NON-NLS-1$
- Tree treeWCols = new Tree(cmpReviewed2, SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
+ Tree treeWCols = UIControlsFactory.createTree(cmpReviewed2, SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION
+ | SWT.MULTI);
treeWCols.setLinesVisible(true);
treeWCols.setHeaderVisible(true);
TreeColumn trc1 = new TreeColumn(treeWCols, SWT.NONE);
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java
index 874207e..fdd8e6d 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/SystemPropertiesSubModuleView.java
@@ -14,12 +14,6 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.riena.example.client.controllers.SystemPropertiesSubModuleController;
-import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
-import org.eclipse.riena.ui.ridgets.ITableRidget;
-import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
-import org.eclipse.riena.ui.swt.lnf.LnfManager;
-import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -29,6 +23,13 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.riena.example.client.controllers.SystemPropertiesSubModuleController;
+import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
+import org.eclipse.riena.ui.ridgets.ITableRidget;
+import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
+import org.eclipse.riena.ui.swt.lnf.LnfManager;
+import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
+
/**
* SWT {@link ITableRidget} sample.
*/
@@ -92,7 +93,8 @@ public class SystemPropertiesSubModuleView extends SubModuleView<SystemPropertie
private Composite createTable(Group group) {
Composite tableComposite = new Composite(group, SWT.NONE);
- final Table tableProperties = new Table(tableComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
+ final Table tableProperties = UIControlsFactory.createTable(tableComposite, SWT.SINGLE | SWT.BORDER
+ | SWT.FULL_SELECTION);
tableProperties.setLinesVisible(true);
tableProperties.setHeaderVisible(true);
addUIControl(tableProperties, "tableProperties"); //$NON-NLS-1$
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java
index a2f3392..7c192be 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TableSubModuleView.java
@@ -14,12 +14,6 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.riena.example.client.controllers.TableSubModuleController;
-import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
-import org.eclipse.riena.ui.ridgets.ITableRidget;
-import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
-import org.eclipse.riena.ui.swt.lnf.LnfManager;
-import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -28,6 +22,13 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.riena.example.client.controllers.TableSubModuleController;
+import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
+import org.eclipse.riena.ui.ridgets.ITableRidget;
+import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
+import org.eclipse.riena.ui.swt.lnf.LnfManager;
+import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
+
/**
* SWT {@link ITableRidget} sample.
*/
@@ -54,7 +55,7 @@ public class TableSubModuleView extends SubModuleView<TableSubModuleController>
Composite tableComposite = new Composite(group, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(tableComposite);
- Table table = new Table(tableComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
+ Table table = UIControlsFactory.createTable(tableComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
table.setLinesVisible(true);
table.setHeaderVisible(true);
addUIControl(table, "table"); //$NON-NLS-1$
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java
index 8ee4e7f..ae97026 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeSubModuleView.java
@@ -12,12 +12,6 @@ package org.eclipse.riena.example.client.views;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.riena.example.client.controllers.TreeSubModuleController;
-import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
-import org.eclipse.riena.ui.ridgets.ITreeRidget;
-import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
-import org.eclipse.riena.ui.swt.lnf.LnfManager;
-import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -26,6 +20,13 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Tree;
+import org.eclipse.riena.example.client.controllers.TreeSubModuleController;
+import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
+import org.eclipse.riena.ui.ridgets.ITreeRidget;
+import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
+import org.eclipse.riena.ui.swt.lnf.LnfManager;
+import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
+
/**
* SWT {@link ITreeRidget} sample.
*/
@@ -49,7 +50,7 @@ public class TreeSubModuleView extends SubModuleView<TreeSubModuleController> {
Group group = UIControlsFactory.createGroup(parent, "&Tree:"); //$NON-NLS-1$
GridLayoutFactory.fillDefaults().margins(20, 20).numColumns(1).applyTo(group);
- Tree tree = new Tree(group, SWT.FULL_SELECTION | SWT.MULTI);
+ Tree tree = UIControlsFactory.createTree(group, SWT.FULL_SELECTION | SWT.MULTI);
GridDataFactory.fillDefaults().grab(true, true).applyTo(tree);
addUIControl(tree, "tree"); //$NON-NLS-1$
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java
index b434773..8963c39 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/TreeTableSubModuleView.java
@@ -14,12 +14,6 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.layout.TreeColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.riena.example.client.controllers.TreeTableSubModuleController;
-import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
-import org.eclipse.riena.ui.ridgets.ITreeRidget;
-import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
-import org.eclipse.riena.ui.swt.lnf.LnfManager;
-import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -28,6 +22,13 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.riena.example.client.controllers.TreeTableSubModuleController;
+import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
+import org.eclipse.riena.ui.ridgets.ITreeRidget;
+import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
+import org.eclipse.riena.ui.swt.lnf.LnfManager;
+import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
+
/**
* SWT {@link ITreeRidget} sample.
*/
@@ -54,7 +55,7 @@ public class TreeTableSubModuleView extends SubModuleView<TreeTableSubModuleCont
Composite treeComposite = new Composite(group, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(treeComposite);
- Tree tree = new Tree(treeComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
+ Tree tree = UIControlsFactory.createTree(treeComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
tree.setHeaderVisible(true);
addUIControl(tree, "tree"); //$NON-NLS-1$
diff --git a/org.eclipse.riena.ui.swt/src/org/eclipse/riena/ui/swt/utils/UIControlsFactory.java b/org.eclipse.riena.ui.swt/src/org/eclipse/riena/ui/swt/utils/UIControlsFactory.java
index d4d4df0..6de4beb 100644
--- a/org.eclipse.riena.ui.swt/src/org/eclipse/riena/ui/swt/utils/UIControlsFactory.java
+++ b/org.eclipse.riena.ui.swt/src/org/eclipse/riena/ui/swt/utils/UIControlsFactory.java
@@ -28,7 +28,9 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
import org.eclipse.riena.ui.swt.ChoiceComposite;
import org.eclipse.riena.ui.swt.MasterDetailsComposite;
@@ -402,6 +404,40 @@ public final class UIControlsFactory {
return result;
}
+ /**
+ * @wbp.factory.parameter.source style org.eclipse.swt.SWT.NONE
+ */
+ public static Tree createTree(Composite parent, int style) {
+ return new Tree(parent, style);
+ }
+
+ /**
+ * @wbp.factory.parameter.source style org.eclipse.swt.SWT.NONE
+ * @wbp.factory.parameter.source bindingId "myTreeId"
+ */
+ public static Tree createTree(Composite parent, int style, String bindingId) {
+ Tree tree = createTree(parent, style);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(tree, bindingId);
+ return tree;
+ }
+
+ /**
+ * @wbp.factory.parameter.source style org.eclipse.swt.SWT.NONE
+ */
+ public static Table createTable(Composite parent, int style) {
+ return new Table(parent, style);
+ }
+
+ /**
+ * @wbp.factory.parameter.source style org.eclipse.swt.SWT.NONE
+ * @wbp.factory.parameter.source bindingId "myTableId"
+ */
+ public static Table createTable(Composite parent, int style, String bindingId) {
+ Table table = createTable(parent, style);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(table, bindingId);
+ return table;
+ }
+
public static int getWidthHint(Button button) {
GC gc = new GC(button.getDisplay());
try {