summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-04-21 08:19:26 (EDT)
committerCarsten Drossel2009-04-21 08:19:26 (EDT)
commitbb914e1283d847174b4dd22337336ba511148b2b (patch)
treee7b101a2e16d3e9c4de5f6d780616fe576e77965
parent802273f072eec9355e5acedfea1769ad018c291c (diff)
downloadorg.eclipse.riena-bb914e1283d847174b4dd22337336ba511148b2b.zip
org.eclipse.riena-bb914e1283d847174b4dd22337336ba511148b2b.tar.gz
org.eclipse.riena-bb914e1283d847174b4dd22337336ba511148b2b.tar.bz2
applying patch for bug 273031
-rw-r--r--org.eclipse.riena.ui.swt/src/org/eclipse/riena/ui/swt/utils/UIControlsFactory.java177
1 files changed, 166 insertions, 11 deletions
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 25dfaa4..2500854 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
@@ -35,6 +35,8 @@ import org.eclipse.riena.ui.swt.lnf.LnfManager;
/**
* TODO [ev] docs + method docs
+ *
+ * @wbp.factory
*/
public final class UIControlsFactory {
@@ -55,16 +57,14 @@ public final class UIControlsFactory {
}
/**
- * @wbp.factory
- * @wbp.factory.parameter.source caption "Label"
+ * @wbp.factory.parameter.source caption "myLabelText"
*/
public static Label createLabel(Composite parent, String caption) {
return createLabel(parent, caption, SWT.NONE);
}
/**
- * @wbp.factory
- * @wbp.factory.parameter.source caption "Label"
+ * @wbp.factory.parameter.source caption "myLabelText"
* @wbp.factory.parameter.source style org.eclipse.swt.SWT.NONE
*/
public static Label createLabel(Composite parent, String caption, int style) {
@@ -75,14 +75,23 @@ public final class UIControlsFactory {
}
/**
- * @wbp.factory
+ * @wbp.factory.parameter.source caption "myLabelText"
+ * @wbp.factory.parameter.source style org.eclipse.swt.SWT.NONE
+ * @wbp.factory.parameter.source bindingId "myLabelId"
*/
+ public static Label createLabel(Composite parent, String caption, int style, String bindingId) {
+ Label label = new Label(parent, style);
+ label.setText(caption);
+ label.setBackground(SHARED_BG_COLOR);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(label, bindingId);
+ return label;
+ }
+
public static Text createText(Composite parent) {
return new Text(parent, SWT.SINGLE | SWT.BORDER);
}
/**
- * @wbp.factory
* @wbp.factory.parameter.source style org.eclipse.swt.SWT.BORDER
*/
public static Text createText(Composite parent, int style) {
@@ -90,8 +99,15 @@ public final class UIControlsFactory {
}
/**
- * @wbp.factory
+ * @wbp.factory.parameter.source style org.eclipse.swt.SWT.BORDER
+ * @wbp.factory.parameter.source bindingId "myTextId"
*/
+ public static Text createText(Composite parent, int style, String bindingId) {
+ Text text = new Text(parent, style | SWT.BORDER);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(text, bindingId);
+ return text;
+ }
+
public static Text createTextDate(Composite parent) {
Text result = new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.RIGHT);
result.setData(KEY_TYPE, TYPE_DATE);
@@ -99,8 +115,15 @@ public final class UIControlsFactory {
}
/**
- * @wbp.factory
+ * @wbp.factory.parameter.source bindingId "MyTextDateId"
*/
+ public static Text createTextDate(Composite parent, String bindingId) {
+ Text result = new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.RIGHT);
+ result.setData(KEY_TYPE, TYPE_DATE);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(result, bindingId);
+ return result;
+ }
+
public static Text createTextDecimal(Composite parent) {
Text result = new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.RIGHT);
result.setData(KEY_TYPE, TYPE_DECIMAL);
@@ -108,8 +131,15 @@ public final class UIControlsFactory {
}
/**
- * @wbp.factory
+ * @wbp.factory.parameter.source bindingId "myTextDecimalId"
*/
+ public static Text createTextDecimal(Composite parent, String bindingId) {
+ Text result = new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.RIGHT);
+ result.setData(KEY_TYPE, TYPE_DECIMAL);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(result, bindingId);
+ return result;
+ }
+
public static Text createTextNumeric(Composite parent) {
Text result = new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.RIGHT);
result.setData(KEY_TYPE, TYPE_NUMERIC);
@@ -117,8 +147,15 @@ public final class UIControlsFactory {
}
/**
- * @wbp.factory
+ * @wbp.factory.parameter.source bindingId "myTextNumericId"
*/
+ public static Text createTextNumeric(Composite parent, String bindingId) {
+ Text result = new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.RIGHT);
+ result.setData(KEY_TYPE, TYPE_NUMERIC);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(result, bindingId);
+ return result;
+ }
+
public static Text createTextOutput(Composite parent) {
Text text = new Text(parent, SWT.BORDER | SWT.READ_ONLY);
text.setEditable(false);
@@ -126,6 +163,17 @@ public final class UIControlsFactory {
return text;
}
+ /**
+ * @wbp.factory.parameter.source bindingId "myTextOutputId"
+ */
+ public static Text createTextOutput(Composite parent, String bindingId) {
+ Text text = new Text(parent, SWT.BORDER | SWT.READ_ONLY);
+ text.setEditable(false);
+ text.setEnabled(false);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(text, bindingId);
+ return text;
+ }
+
public static Text createTextMulti(Composite parent, boolean hScroll, boolean vScroll) {
int style = SWT.MULTI | SWT.BORDER;
if (hScroll) {
@@ -137,13 +185,44 @@ public final class UIControlsFactory {
return new Text(parent, style);
}
+ /**
+ * @wbp.factory.parameter.source bindingId "myTextMultiId"
+ */
+ public static Text createTextMulti(Composite parent, boolean hScroll, boolean vScroll, String bindingId) {
+ int style = SWT.MULTI | SWT.BORDER;
+ if (hScroll) {
+ style |= SWT.H_SCROLL;
+ }
+ if (vScroll) {
+ style |= SWT.V_SCROLL;
+ }
+ Text text = new Text(parent, style);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(text, bindingId);
+ return text;
+ }
+
public static Button createButton(Composite parent) {
return new Button(parent, SWT.PUSH);
}
+ /**
+ * @wbp.factory.parameter.source caption "myButtonText"
+ */
public static Button createButton(Composite parent, String caption) {
Button result = new Button(parent, SWT.PUSH);
result.setText(caption);
+
+ return result;
+ }
+
+ /**
+ * @wbp.factory.parameter.source caption "myButtonText"
+ * @wbp.factory.parameter.source bindingId "myButtonId"
+ */
+ public static Button createButton(Composite parent, String caption, String bindingId) {
+ Button result = new Button(parent, SWT.PUSH);
+ result.setText(caption);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(result, bindingId);
return result;
}
@@ -151,26 +230,67 @@ public final class UIControlsFactory {
return new Button(parent, SWT.TOGGLE);
}
+ /**
+ * @wbp.factory.parameter.source bindingId "myButtonToggleId"
+ */
+ public static Button createButtonToggle(Composite parent, String bindingId) {
+ Button button = new Button(parent, SWT.TOGGLE);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(button, bindingId);
+ return button;
+ }
+
public static Button createButtonCheck(Composite parent) {
Button button = new Button(parent, SWT.CHECK);
button.setBackground(SHARED_BG_COLOR);
return button;
}
+ /**
+ * @wbp.factory.parameter.source bindingId "myButtonCheckId"
+ */
+ public static Button createButtonCheck(Composite parent, String bindingId) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setBackground(SHARED_BG_COLOR);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(button, bindingId);
+ return button;
+ }
+
public static Button createButtonRadio(Composite parent) {
Button button = new Button(parent, SWT.RADIO);
button.setBackground(SHARED_BG_COLOR);
return button;
}
+ /**
+ * @wbp.factory.parameter.source bindingId "myButtonRadioId"
+ */
+ public static Button createButtonRadio(Composite parent, String bindingId) {
+ Button button = new Button(parent, SWT.RADIO);
+ button.setBackground(SHARED_BG_COLOR);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(button, bindingId);
+ return button;
+ }
+
public static Combo createCombo(Composite parent) {
return new Combo(parent, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
}
+ /**
+ * @wbp.factory.parameter.source bindingId "myComboId"
+ */
+ public static Combo createCombo(Composite parent, String bindingId) {
+ Combo combo = new Combo(parent, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(combo, bindingId);
+ return combo;
+ }
+
public static Composite createComposite(Composite parent) {
return createComposite(parent, SWT.NONE);
}
+ /**
+ * @wbp.factory.parameter.source style org.eclipse.swt.SWT.NONE
+ */
public static Composite createComposite(Composite parent, int style) {
Composite composite = new Composite(parent, style);
composite.setBackground(SHARED_BG_COLOR);
@@ -184,6 +304,18 @@ public final class UIControlsFactory {
return group;
}
+ /**
+ * @wbp.factory.parameter.source caption "myGroupText"
+ * @wbp.factory.parameter.source bindingId "myGroupId"
+ */
+ public static Group createGroup(Composite parent, String caption, String bindingId) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText(caption);
+ group.setBackground(SHARED_BG_COLOR);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(group, bindingId);
+ return group;
+ }
+
public static List createList(Composite parent, boolean hScroll, boolean vScroll) {
int style = SWT.BORDER | SWT.MULTI;
if (hScroll) {
@@ -196,12 +328,34 @@ public final class UIControlsFactory {
}
/**
- * @wbp.factory
+ * @wbp.factory.parameter.source bindingId "myListId"
*/
+ public static List createList(Composite parent, boolean hScroll, boolean vScroll, String bindingId) {
+ int style = SWT.BORDER | SWT.MULTI;
+ if (hScroll) {
+ style |= SWT.H_SCROLL;
+ }
+ if (vScroll) {
+ style |= SWT.V_SCROLL;
+ }
+ List list = new List(parent, style);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(list, bindingId);
+ return list;
+ }
+
public static MasterDetailsComposite createMasterDetails(Composite parent) {
return new MasterDetailsComposite(parent, SWT.NONE);
}
+ /**
+ * @wbp.factory.parameter.source bindingId "myMasterDetailId"
+ */
+ public static MasterDetailsComposite createMasterDetails(Composite parent, String bindingId) {
+ MasterDetailsComposite masterDetails = new MasterDetailsComposite(parent, SWT.NONE);
+ SWTBindingPropertyLocator.getInstance().setBindingProperty(masterDetails, bindingId);
+ return masterDetails;
+ }
+
public static Shell createShell(Display display) {
Assert.isNotNull(display);
Shell shell = new Shell(display);
@@ -242,4 +396,5 @@ public final class UIControlsFactory {
public static MessageBox createMessageBox(Composite parent) {
return new MessageBox(parent);
}
+
}