diff options
author | mvelten | 2013-05-15 13:35:58 +0000 |
---|---|---|
committer | mvelten | 2013-05-15 13:35:58 +0000 |
commit | 35cdf58eb23f3c32076448116945851e90f4b651 (patch) | |
tree | b709d25e53e9c8c6814b4963a573ed10b7be7c54 | |
parent | e950f85ae24af31eb3eb105d5243f5f9a37a0571 (diff) | |
download | org.eclipse.papyrus-35cdf58eb23f3c32076448116945851e90f4b651.tar.gz org.eclipse.papyrus-35cdf58eb23f3c32076448116945851e90f4b651.tar.xz org.eclipse.papyrus-35cdf58eb23f3c32076448116945851e90f4b651.zip |
408005: [Widgets] Allow subclasses of MultipeValueEditor and CompactMultipeValueEditor to use their own selector implementations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=408005
patch made by Philippe Roland
4 files changed, 93 insertions, 8 deletions
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleIntegerEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleIntegerEditor.java index d259e6ce350..d17313f03cf 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleIntegerEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleIntegerEditor.java @@ -67,7 +67,29 @@ public class CompactMultipleIntegerEditor extends CompactMultipleValueEditor { * The editor's label
*/
public CompactMultipleIntegerEditor(Composite parent, int style, boolean ordered, boolean unique, String separator, String label) {
- super(parent, style, new IntegerSelector(), ordered, unique, separator, label);
+ this(parent, style, new IntegerSelector(), ordered, unique, separator, label);
}
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * The Composite widget in which this editor will be displayed
+ * @param style
+ * The value label's style
+ * @param selector
+ * The editor's selector
+ * @param ordered
+ * True if the values should be ordered
+ * @param unique
+ * True if the values should be unique
+ * @param separator
+ * The String used to separate the different values in the value label
+ * @param label
+ * The editor's label
+ */
+ public CompactMultipleIntegerEditor(Composite parent, int style, IntegerSelector selector, boolean ordered, boolean unique, String separator, String label) {
+ super(parent, style, selector, ordered, unique, separator, label);
+ }
+
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleReferenceEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleReferenceEditor.java index ac1e11c4de7..b91211c2f1a 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleReferenceEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleReferenceEditor.java @@ -61,11 +61,30 @@ public class CompactMultipleReferenceEditor extends CompactMultipleValueEditor { * True if the multivalued property needs unique values
*/
public CompactMultipleReferenceEditor(Composite parent, int style, boolean ordered, boolean unique) {
- super(parent, style, new ReferenceSelector(unique), ordered, unique);
- this.selector = (ReferenceSelector)super.selector;
+ this(parent, style, new ReferenceSelector(unique), ordered, unique);
}
/**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * The widget in which this editor is created
+ * @param style
+ * The style for this editor's control
+ * @param selector
+ * The editor's selector
+ * @param ordered
+ * True if the multivalued property is ordered
+ * @param unique
+ * True if the multivalued property needs unique values
+ */
+ public CompactMultipleReferenceEditor(Composite parent, int style, ReferenceSelector selector, boolean ordered, boolean unique) {
+ super(parent, style, new ReferenceSelector(unique), ordered, unique);
+ this.selector = (ReferenceSelector)super.selector;
+ }
+
+ /**
* Sets the Content and Label providers for this widget.
*
* The label provider is used in each place where the values can
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleStringEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleStringEditor.java index cfb34fee10a..cbbbc8c8358 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleStringEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/CompactMultipleStringEditor.java @@ -67,7 +67,29 @@ public class CompactMultipleStringEditor extends CompactMultipleValueEditor { * The editor's label
*/
public CompactMultipleStringEditor(Composite parent, int style, boolean ordered, boolean unique, String separator, String label) {
- super(parent, style, new StringSelector(), ordered, unique, separator, label);
+ this(parent, style, new StringSelector(), ordered, unique, separator, label);
}
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * The Composite widget in which this editor will be displayed
+ * @param style
+ * The value label's style
+ * @param selector
+ * The editor's selector
+ * @param ordered
+ * True if the values should be ordered
+ * @param unique
+ * True if the values should be unique
+ * @param separator
+ * The String used to separate the different values in the value label
+ * @param label
+ * The editor's label
+ */
+ public CompactMultipleStringEditor(Composite parent, int style, StringSelector selector, boolean ordered, boolean unique, String separator, String label) {
+ super(parent, style, selector, ordered, unique, separator, label);
+ }
+
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleReferenceEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleReferenceEditor.java index 5189150c559..59a5abae535 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleReferenceEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleReferenceEditor.java @@ -44,6 +44,30 @@ public class MultipleReferenceEditor extends MultipleValueEditor { * The composite in which this editor is created
* @param style
* The style for this editor's list
+ * @param selector
+ * The editor's selector
+ * @param ordered
+ * True if the list should be ordered
+ * @param unique
+ * True if the list values should be unique
+ * @param label
+ * The label for this editor
+ */
+ public MultipleReferenceEditor(Composite parent, int style, ReferenceSelector selector, boolean ordered, boolean unique, String label) {
+ super(parent, style, selector, ordered, unique, label);
+ this.selector = (ReferenceSelector)super.selector;
+ //Default providers
+ setProviders(EmptyContentProvider.instance, new WrappedLabelProvider());
+ }
+
+ /**
+ *
+ * Constructor. uses default ReferenceSelector selector
+ *
+ * @param parent
+ * The composite in which this editor is created
+ * @param style
+ * The style for this editor's list
* @param ordered
* True if the list should be ordered
* @param unique
@@ -52,11 +76,9 @@ public class MultipleReferenceEditor extends MultipleValueEditor { * The label for this editor
*/
public MultipleReferenceEditor(Composite parent, int style, boolean ordered, boolean unique, String label) {
- super(parent, style, new ReferenceSelector(unique), ordered, unique, label);
- this.selector = (ReferenceSelector)super.selector;
- //Default providers
- setProviders(EmptyContentProvider.instance, new WrappedLabelProvider());
+ this(parent, style, new ReferenceSelector(unique), ordered, unique, label);
}
+
/**
*
|