Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-09-16 16:05:45 +0000
committerChristian W. Damus2014-09-16 22:23:42 +0000
commitd2783ef746f0ccaf3ef083f004b9784fe37ccf07 (patch)
treed9fae22c1ede18db2bdc168f137883c120883983 /plugins/infra
parent8f380f19a66c1d08f627b02d0ff53e690b8c7f57 (diff)
downloadorg.eclipse.papyrus-d2783ef746f0ccaf3ef083f004b9784fe37ccf07.tar.gz
org.eclipse.papyrus-d2783ef746f0ccaf3ef083f004b9784fe37ccf07.tar.xz
org.eclipse.papyrus-d2783ef746f0ccaf3ef083f004b9784fe37ccf07.zip
444227: Property view broken for associations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=444227 The ViewEditor must be able to repeat sections for list values, such as the multiple ends of an association. To that end, the DisplayEngine now supports proxy sections that combine the same section instance that needs to be repeated with an arbitrary discriminator that distinguishes the repeated occurrences. This allows the display engine to reuse controls for the same repetition of the same section. Also, because multiple selections are presented as observables that are dynamic proxies wrapping a MultipleObservableValue, the ViewEditor cannot rely on that class's API to access the multiple objects that were selected. The API required by the ViewEditor is factored out into an interface that the proxy then automatically implements, as usual in the delegating observables mechanism. Change-Id: I88345c23f898100bd109bab2eccfd60d4b098323
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/IMultipleObservableValue.java37
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java9
2 files changed, 39 insertions, 7 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/IMultipleObservableValue.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/IMultipleObservableValue.java
new file mode 100644
index 00000000000..b2fd4b1cfeb
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/IMultipleObservableValue.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.tools.databinding;
+
+import java.util.List;
+
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+
+
+
+/**
+ * Interface for a multiple selection of observable values.
+ */
+public interface IMultipleObservableValue extends AggregatedObservable, IObservableValue {
+
+ /**
+ * @return the list of sub-observable values
+ */
+ List<IObservableValue> getObservableValues();
+
+ /**
+ * @return the list of observed values
+ */
+ List<Object> getObservedValues();
+
+} \ No newline at end of file
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java
index c4c0ef6a7d0..faaf6b23c6f 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java
@@ -9,6 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 417409
+ * Christian W. Damus (CEA) - bug 444227
*
*****************************************************************************/
package org.eclipse.papyrus.infra.tools.databinding;
@@ -33,7 +34,7 @@ import org.eclipse.core.databinding.observable.value.ValueDiff;
* All sub-elements will be edited at the same time, with the same value.
*/
// TODO : Add listeners on sub-observables, and remove them on dispose
-public class MultipleObservableValue extends ReferenceCountedObservable.Value implements AggregatedObservable, IChangeListener {
+public class MultipleObservableValue extends ReferenceCountedObservable.Value implements IMultipleObservableValue, IChangeListener {
/**
*
@@ -107,16 +108,10 @@ public class MultipleObservableValue extends ReferenceCountedObservable.Value im
return null;
}
- /**
- * @return the list of sub-observable values
- */
public List<IObservableValue> getObservableValues() {
return observableValues;
}
- /**
- * @return the list of observed values
- */
public List<Object> getObservedValues() {
List<Object> result = new LinkedList<Object>();
for (IObservableValue value : getObservableValues()) {

Back to the top