From 3f5eace0de56e0514b706a1099acceeeff122d86 Mon Sep 17 00:00:00 2001 From: Brian Vosburgh Date: Fri, 15 Jul 2016 11:42:42 -0400 Subject: add return value to BasePluggablePropertyValueModel.Adapter.engageModel() --- .../model/value/BaseCompoundPropertyValueModelAdapter.java | 13 +++++++------ .../model/value/BasePluggablePropertyValueModel.java | 8 ++++---- .../BasePropertyPluggablePropertyValueModelAdapter.java | 4 ++-- .../model/value/BufferedPropertyValueModelAdapter.java | 8 ++++---- .../value/CollectionPluggablePropertyValueModelAdapter.java | 4 ++-- .../model/value/CompositePropertyValueModelAdapter.java | 4 ++-- .../model/value/ListCompositePropertyValueModelAdapter.java | 4 ++-- .../model/value/ListPluggablePropertyValueModelAdapter.java | 4 ++-- .../value/PluggableModifiablePropertyValueModelAdapter.java | 4 ++-- .../internal/model/value/PropertyValueModelToolsTests.java | 4 ++-- 10 files changed, 29 insertions(+), 28 deletions(-) (limited to 'common') diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/BaseCompoundPropertyValueModelAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/BaseCompoundPropertyValueModelAdapter.java index 8766552312..94487a307e 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/BaseCompoundPropertyValueModelAdapter.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/BaseCompoundPropertyValueModelAdapter.java @@ -111,17 +111,18 @@ public abstract class BaseCompoundPropertyValueModelAdapter } } - public void engageModel() { - this.wrappedValueModel.addPropertyChangeListener(PropertyValueModel.VALUE, this); - this.wrappedValue = this.wrappedValueModel.getValue(); + public V engageModel() { this.trigger.addListener(this.triggerListener); + this.wrappedValueModel.addPropertyChangeListener(PropertyValueModel.VALUE, this); + return this.wrappedValue = this.wrappedValueModel.getValue(); } public void disengageModel() { + this.trigger.removeListener(this.triggerListener); this.setBuffering(false); this.bufferedValue = null; - this.trigger.removeListener(this.triggerListener); this.wrappedValue = null; this.wrappedValueModel.removePropertyChangeListener(PropertyValueModel.VALUE, this); } diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CollectionPluggablePropertyValueModelAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CollectionPluggablePropertyValueModelAdapter.java index 71e2870afb..ab84fbcf44 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CollectionPluggablePropertyValueModelAdapter.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CollectionPluggablePropertyValueModelAdapter.java @@ -85,10 +85,10 @@ public final class CollectionPluggablePropertyValueModelAdapter return this.value; } - public void engageModel() { + public V engageModel() { this.collectionModel.addCollectionChangeListener(CollectionValueModel.VALUES, this); CollectionTools.addAll(this.collection, this.collectionModel); - this.value = this.buildValue(); + return this.value = this.buildValue(); } public void disengageModel() { diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositePropertyValueModelAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositePropertyValueModelAdapter.java index d37ce05cbc..e54aabccea 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositePropertyValueModelAdapter.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositePropertyValueModelAdapter.java @@ -112,10 +112,10 @@ public final class CompositePropertyValueModelAdapter return this.value; } - public void engageModel() { + public V engageModel() { this.collectionModel.addCollectionChangeListener(CollectionValueModel.VALUES, this); this.addComponentPVMs(this.collectionModel); - this.value = this.buildValue(); + return this.value = this.buildValue(); } public void disengageModel() { diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ListCompositePropertyValueModelAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ListCompositePropertyValueModelAdapter.java index f73480694f..7f17c43d79 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ListCompositePropertyValueModelAdapter.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ListCompositePropertyValueModelAdapter.java @@ -108,10 +108,10 @@ public final class ListCompositePropertyValueModelAdapter return this.value; } - public void engageModel() { + public V engageModel() { this.listModel.addListChangeListener(ListValueModel.LIST_VALUES, this); this.addComponentPVMs(0, this.listModel); - this.value = this.buildValue(); + return this.value = this.buildValue(); } public void disengageModel() { diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ListPluggablePropertyValueModelAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ListPluggablePropertyValueModelAdapter.java index 5cc917eb2f..5aded2744b 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ListPluggablePropertyValueModelAdapter.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/ListPluggablePropertyValueModelAdapter.java @@ -89,10 +89,10 @@ public final class ListPluggablePropertyValueModelAdapter return this.value; } - public void engageModel() { + public V engageModel() { this.listModel.addListChangeListener(ListValueModel.LIST_VALUES, this); ListTools.addAll(this.list, 0, this.listModel); - this.value = this.buildValue(); + return this.value = this.buildValue(); } public void disengageModel() { diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/PluggableModifiablePropertyValueModelAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/PluggableModifiablePropertyValueModelAdapter.java index 98436a995a..eac83e2bf9 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/PluggableModifiablePropertyValueModelAdapter.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/PluggableModifiablePropertyValueModelAdapter.java @@ -52,8 +52,8 @@ public class PluggableModifiablePropertyValueModelAdapter this.closure.execute(value); } - public void engageModel() { - this.adapter.engageModel(); + public V engageModel() { + return this.adapter.engageModel(); } public void disengageModel() { diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyValueModelToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyValueModelToolsTests.java index ce91c5575e..57db49690c 100644 --- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyValueModelToolsTests.java +++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyValueModelToolsTests.java @@ -1168,10 +1168,10 @@ public class PropertyValueModelToolsTests this.value = null; } - public void engageModel() { + public String engageModel() { this.stringModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.stringListener); String v = this.stringModel.getValue(); - this.value = v.substring(v.length() / 2); + return this.value = v.substring(v.length() / 2); } public String getValue() { -- cgit v1.2.3