Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-08-31 16:41:20 +0000
committerBrian Vosburgh2017-05-18 22:38:59 +0000
commit9ac21e8d9a185446580b22113f76bf3213bf9e87 (patch)
tree5ea3148034b03b460ac73b5f215e0148ee792a10
parentd345943564dbdbf3bc4a71ec35f936b48a834584 (diff)
downloadwebtools.dali-9ac21e8d9a185446580b22113f76bf3213bf9e87.tar.gz
webtools.dali-9ac21e8d9a185446580b22113f76bf3213bf9e87.tar.xz
webtools.dali-9ac21e8d9a185446580b22113f76bf3213bf9e87.zip
aspect adapters 2016-08-31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaCacheable2_0.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConvert.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConvert.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertCombo.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerClassChooser.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMappingComposite2_0.java37
15 files changed, 209 insertions, 245 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaCacheable2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaCacheable2_0.java
index edfed894be..7377a6a428 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaCacheable2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaCacheable2_0.java
@@ -27,6 +27,7 @@ public class GenericJavaCacheable2_0
{
protected Boolean specifiedCacheable;
protected boolean defaultCacheable;
+ protected boolean cacheable;
public GenericJavaCacheable2_0(JavaCacheableReference2_0 parent) {
@@ -47,12 +48,22 @@ public class GenericJavaCacheable2_0
public void update(IProgressMonitor monitor) {
super.update(monitor);
this.setDefaultCacheable(this.buildDefaultCacheable());
+ this.setCacheable(this.buildCacheable());
}
// ********** cacheable **********
public boolean isCacheable() {
+ return this.cacheable;
+ }
+
+ protected void setCacheable(boolean cacheable) {
+ boolean old = this.cacheable;
+ this.firePropertyChanged(CACHEABLE_PROPERTY, old, this.cacheable = cacheable);
+ }
+
+ protected boolean buildCacheable() {
return (this.specifiedCacheable != null) ? this.specifiedCacheable.booleanValue() : this.defaultCacheable;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.java
index 03331ba8b5..91255e72b2 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.java
@@ -25,6 +25,7 @@ public class GenericOrmCacheable2_0
{
protected Boolean specifiedCacheable;
protected boolean defaultCacheable;
+ protected boolean cacheable;
public GenericOrmCacheable2_0(OrmCacheableReference2_0 parent) {
@@ -45,12 +46,22 @@ public class GenericOrmCacheable2_0
public void update(IProgressMonitor monitor) {
super.update(monitor);
this.setDefaultCacheable(this.buildDefaultCacheable());
+ this.setCacheable(this.buildCacheable());
}
// ********** cacheable **********
public boolean isCacheable() {
+ return this.cacheable;
+ }
+
+ protected void setCacheable(boolean cacheable) {
+ boolean old = this.cacheable;
+ this.firePropertyChanged(CACHEABLE_PROPERTY, old, this.cacheable = cacheable);
+ }
+
+ protected boolean buildCacheable() {
return (this.specifiedCacheable != null) ? this.specifiedCacheable.booleanValue() : this.defaultCacheable;
}
@@ -75,8 +86,7 @@ public class GenericOrmCacheable2_0
protected void setDefaultCacheable(boolean cacheable) {
boolean old = this.defaultCacheable;
- this.defaultCacheable = cacheable;
- this.firePropertyChanged(DEFAULT_CACHEABLE_PROPERTY, old, cacheable);
+ this.firePropertyChanged(DEFAULT_CACHEABLE_PROPERTY, old, this.defaultCacheable = cacheable);
}
protected boolean buildDefaultCacheable() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java
index 44c2923f00..635e742652 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java
@@ -33,6 +33,7 @@ public interface EclipseLinkConvert
EclipseLinkPersistenceUnit getPersistenceUnit();
String getConverterName();
+ String CONVERTER_NAME_PROPERTY = "converterName"; //$NON-NLS-1$
String getSpecifiedConverterName();
void setSpecifiedConverterName(String converterName);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java
index b119c08877..1fddaacf4b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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.
@@ -27,6 +27,7 @@ public interface EclipseLinkCustomizer
extends JpaContextModel
{
String getCustomizerClass();
+ String CUSTOMIZER_CLASS_PROPERTY = "customizerClass"; //$NON-NLS-1$
String getSpecifiedCustomizerClass();
void setSpecifiedCustomizerClass(String customizerClass);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConvert.java
index 5fbcdf040b..ceea9c077f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConvert.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConvert.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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.
@@ -34,6 +34,7 @@ public class EclipseLinkJavaConvert
private String specifiedConverterName;
private String defaultConverterName;
+ private String converterName;
public EclipseLinkJavaConvert(Converter.ParentAdapter<JavaAttributeMapping> parentAdapter, ConvertAnnotation convertAnnotation) {
@@ -58,12 +59,22 @@ public class EclipseLinkJavaConvert
public void update(IProgressMonitor monitor) {
super.update(monitor);
this.setDefaultConverterName(this.buildDefaultConverterName());
+ this.setConverterName(this.buildConverterName());
}
// ********** converter name **********
public String getConverterName() {
+ return this.converterName;
+ }
+
+ protected void setConverterName(String name) {
+ String old = this.converterName;
+ this.firePropertyChanged(CONVERTER_NAME_PROPERTY, old, this.converterName = name);
+ }
+
+ protected String buildConverterName() {
return (this.specifiedConverterName != null) ? this.specifiedConverterName : this.defaultConverterName;
}
@@ -78,8 +89,7 @@ public class EclipseLinkJavaConvert
protected void setSpecifiedConverterName_(String name) {
String old = this.specifiedConverterName;
- this.specifiedConverterName = name;
- this.firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, old, this.specifiedConverterName = name);
}
public String getDefaultConverterName() {
@@ -88,8 +98,7 @@ public class EclipseLinkJavaConvert
protected void setDefaultConverterName(String name) {
String old = this.defaultConverterName;
- this.defaultConverterName = name;
- this.firePropertyChanged(DEFAULT_CONVERTER_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_CONVERTER_NAME_PROPERTY, old, this.defaultConverterName = name);
}
protected String buildDefaultConverterName() {
@@ -126,7 +135,7 @@ public class EclipseLinkJavaConvert
}
protected Iterable<String> getJavaCandidateConverterNames() {
- return new TransformationIterable<String, String>(this.getConverterNames(),
+ return new TransformationIterable<>(this.getConverterNames(),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java
index c52435453e..a58a6d3f8e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java
@@ -30,6 +30,7 @@ public class EclipseLinkJavaCustomizer
implements EclipseLinkCustomizer
{
private String specifiedCustomizerClass;
+ private String customizerClass;
private String fullyQualifiedCustomizerClass;
@@ -51,6 +52,7 @@ public class EclipseLinkJavaCustomizer
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+ this.setCustomizerClass(this.buildCustomizerClass());
this.setFullyQualifiedCustomizerClass(this.buildFullyQualifiedCustomizerClass());
}
@@ -58,6 +60,15 @@ public class EclipseLinkJavaCustomizer
// ********** customizer class **********
public String getCustomizerClass() {
+ return this.customizerClass;
+ }
+
+ protected void setCustomizerClass(String customizerClass) {
+ String old = this.customizerClass;
+ this.firePropertyChanged(CUSTOMIZER_CLASS_PROPERTY, old, this.customizerClass = customizerClass);
+ }
+
+ protected String buildCustomizerClass() {
return (this.specifiedCustomizerClass != null) ? this.specifiedCustomizerClass : null;
}
@@ -85,8 +96,7 @@ public class EclipseLinkJavaCustomizer
protected void setSpecifiedCustomizerClass_(String customizerClass) {
String old = this.specifiedCustomizerClass;
- this.specifiedCustomizerClass = customizerClass;
- this.firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
+ this.firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, old, this.specifiedCustomizerClass = customizerClass);
}
protected String buildSpecifiedCustomizerClass() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConvert.java
index 2aa6665a55..54b7e02624 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConvert.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConvert.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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.
@@ -32,6 +32,7 @@ public class EclipseLinkOrmConvert
implements EclipseLinkConvert
{
protected String specifiedConverterName;
+ private String converterName;
public EclipseLinkOrmConvert(OrmConverter.ParentAdapter parentAdapter) {
super(parentAdapter);
@@ -52,9 +53,24 @@ public class EclipseLinkOrmConvert
this.setSpecifiedConverterName_(this.getXmlConvert() != null ? this.getXmlConvert().getConvert() : null);
}
+ @Override
+ public void update(IProgressMonitor monitor) {
+ super.update(monitor);
+ this.setConverterName(this.buildConverterName());
+ }
+
// ********** converter name **********
public String getConverterName() {
+ return this.converterName;
+ }
+
+ protected void setConverterName(String name) {
+ String old = this.converterName;
+ this.firePropertyChanged(CONVERTER_NAME_PROPERTY, old, this.converterName = name);
+ }
+
+ protected String buildConverterName() {
return (this.specifiedConverterName != null) ? this.specifiedConverterName : this.getDefaultConverterName();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java
index af685dd55c..0cfcdc8df6 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java
@@ -42,6 +42,8 @@ public class EclipseLinkOrmCustomizer
{
protected String specifiedCustomizerClass;
protected String defaultCustomizerClass;
+ protected String customizerClass;
+
protected String fullyQualifiedCustomizerClass;
@@ -63,6 +65,7 @@ public class EclipseLinkOrmCustomizer
public void update(IProgressMonitor monitor) {
super.update(monitor);
this.setDefaultCustomizerClass(this.buildDefaultCustomizerClass());
+ this.setCustomizerClass(this.buildCustomizerClass());
this.setFullyQualifiedCustomizerClass(this.buildFullyQualifiedCustomizerClass());
}
@@ -70,6 +73,15 @@ public class EclipseLinkOrmCustomizer
// ********** customizer class **********
public String getCustomizerClass() {
+ return this.customizerClass;
+ }
+
+ protected void setCustomizerClass(String customizerClass) {
+ String old = this.customizerClass;
+ this.firePropertyChanged(CUSTOMIZER_CLASS_PROPERTY, old, this.customizerClass = customizerClass);
+ }
+
+ protected String buildCustomizerClass() {
return (this.specifiedCustomizerClass != null) ? this.specifiedCustomizerClass : this.defaultCustomizerClass;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java
index 5b4bf3fba8..65f6425016 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite2_0.java
@@ -11,7 +11,6 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
import org.eclipse.jpt.common.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -126,38 +125,24 @@ public abstract class EclipseLinkCachingComposite2_0<T extends EclipseLinkCachin
}
protected PropertyValueModel<Cacheable2_0> buildCacheableModel() {
- return new PropertyAspectAdapterXXXX<EclipseLinkCaching, Cacheable2_0>(getSubjectHolder()) {
- @Override
- protected Cacheable2_0 buildValue_() {
- return ((CacheableReference2_0) this.subject).getCacheable();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), m -> ((CacheableReference2_0) m).getCacheable());
}
private PropertyValueModel<Boolean> buildCacheableEnabler(PropertyValueModel<Cacheable2_0> cacheableModel) {
- return new PropertyAspectAdapterXXXX<Cacheable2_0, Boolean>(
+ return PropertyValueModelTools.booleanSubjectModelAspectAdapter(
cacheableModel,
- Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY,
- Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isCacheable());
- }
- };
+ Cacheable2_0.CACHEABLE_PROPERTY,
+ m -> m.isCacheable()
+ );
}
private ModifiablePropertyValueModel<Boolean> buildSpecifiedCacheableModel(PropertyValueModel<Cacheable2_0> cacheableModel) {
- return new PropertyAspectAdapterXXXX<Cacheable2_0, Boolean>(cacheableModel, Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedCacheable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedCacheable(value);
- }
- };
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ cacheableModel,
+ Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY,
+ m -> m.getSpecifiedCacheable(),
+ (m, value) -> m.setSpecifiedCacheable(value)
+ );
}
private PropertyValueModel<String> buildCacheableStringModel(PropertyValueModel<Cacheable2_0> cacheableModel) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java
index e16f44c6e5..fdeaf43ef0 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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.
@@ -14,7 +14,7 @@ import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
@@ -177,31 +177,21 @@ public class EclipseLinkConversionValueDialog
}
private ModifiablePropertyValueModel<String> buildDataValueHolder() {
- return new PropertyAspectAdapterXXXX<EclipseLinkConversionValueStateObject, String>(getSubjectHolder(), EclipseLinkConversionValueStateObject.DATA_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setDataValue(value);
- }
- };
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkConversionValueStateObject.DATA_VALUE_PROPERTY,
+ m -> m.getDataValue(),
+ (m, value) -> m.setDataValue(value)
+ );
}
private ModifiablePropertyValueModel<String> buildObjectValueHolder() {
- return new PropertyAspectAdapterXXXX<EclipseLinkConversionValueStateObject, String>(getSubjectHolder(), EclipseLinkConversionValueStateObject.OBJECT_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setObjectValue(value);
- }
- };
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkConversionValueStateObject.OBJECT_VALUE_PROPERTY,
+ m -> m.getObjectValue(),
+ (m, value) -> m.setObjectValue(value)
+ );
}
void selectAll() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertCombo.java
index d27807b900..7d89e95d2c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertCombo.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertCombo.java
@@ -18,8 +18,8 @@ import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapt
import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.ListValueModelTools;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SetCollectionValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel;
@@ -77,62 +77,47 @@ public class EclipseLinkConvertCombo
protected void initializeLayout(Composite container) {
this.combo = this.addEditableCombo(
container,
- buildConvertNameListHolder(),
- buildConvertNameHolder(),
- buildConverterNameTransformer(),
+ this.buildConverterNameListModel(),
+ this.buildSpecifiedConverterNameModel(),
+ this.buildConverterNameTransformer(),
(String) null
);
ComboTools.handleDefaultValue(this.combo);
}
- protected final ModifiablePropertyValueModel<String> buildConvertNameHolder() {
- return new PropertyAspectAdapterXXXX<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.SPECIFIED_CONVERTER_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getSpecifiedConverterName();
- }
-
- @Override
- protected void setValue_(String value) {
- // Convert the default value to the default converter
- if ((value != null) && (value.startsWith(DEFAULT_KEY))) {
- value = EclipseLinkConvert.DEFAULT_CONVERTER_NAME;
- }
- this.subject.setSpecifiedConverterName(value);
- }
- };
+ protected final ModifiablePropertyValueModel<String> buildSpecifiedConverterNameModel() {
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkConvert.SPECIFIED_CONVERTER_NAME_PROPERTY,
+ m -> m.getSpecifiedConverterName(),
+ (m, value) -> m.setSpecifiedConverterName(((value != null) && value.startsWith(DEFAULT_KEY)) ? EclipseLinkConvert.DEFAULT_CONVERTER_NAME : value)
+ );
}
- private ListValueModel<String> buildConvertNameListHolder() {
- java.util.List<ListValueModel<String>> list = new ArrayList<ListValueModel<String>>();
- list.add(buildDefaultNameListHolder());
- list.add(buildReservedConverterNameListHolder());
- list.add(buildSortedConverterNamesModel());
+ private ListValueModel<String> buildConverterNameListModel() {
+ java.util.List<ListValueModel<String>> list = new ArrayList<>();
+ list.add(this.buildDefaultNameListModel());
+ list.add(this.buildReservedConverterNameListModel());
+ list.add(this.buildSortedConverterNamesModel());
return CompositeListValueModel.forModels(list);
}
- protected ListValueModel<String> buildDefaultNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultNameHolder()
+ protected ListValueModel<String> buildDefaultNameListModel() {
+ return new PropertyListValueModelAdapter<>(
+ this.buildDefaultConverterNameModel()
);
}
- private ModifiablePropertyValueModel<String> buildDefaultNameHolder() {
- return new PropertyAspectAdapterXXXX<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.DEFAULT_CONVERTER_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- String name = this.subject.getDefaultConverterName();
-
- if (name == null) {
- name = DEFAULT_KEY;
- }
- else {
- name = DEFAULT_KEY + name;
- }
+ private PropertyValueModel<String> buildDefaultConverterNameModel() {
+ return PropertyValueModelTools.subjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkConvert.DEFAULT_CONVERTER_NAME_PROPERTY,
+ m -> convertDefaultConverterName(m.getDefaultConverterName())
+ );
+ }
- return name;
- }
- };
+ private static String convertDefaultConverterName(String name) {
+ return (name == null) ? DEFAULT_KEY : DEFAULT_KEY + name;
}
private Transformer<String, String> buildConverterNameTransformer() {
@@ -151,13 +136,7 @@ public class EclipseLinkConvertCombo
if (value == null) {
value = EclipseLinkConvertCombo.this.getSubject().getDefaultConverterName();
-
- if (value != null) {
- value = DEFAULT_KEY + value;
- }
- else {
- value = DEFAULT_KEY;
- }
+ value = (value == null) ? DEFAULT_KEY : DEFAULT_KEY + value;
}
if (value.startsWith(DEFAULT_KEY)) {
@@ -168,8 +147,7 @@ public class EclipseLinkConvertCombo
JptCommonUiMessages.DEFAULT_WITH_ONE_PARAM,
defaultName
);
- }
- else {
+ } else {
value = NLS.bind(
JptCommonUiMessages.DEFAULT_WITH_ONE_PARAM,
EclipseLinkConvert.NO_CONVERTER
@@ -181,16 +159,16 @@ public class EclipseLinkConvertCombo
}
}
- protected ListValueModel<String> buildReservedConverterNameListHolder() {
- return new StaticListValueModel<String>(EclipseLinkConvert.RESERVED_CONVERTER_NAMES);
+ protected ListValueModel<String> buildReservedConverterNameListModel() {
+ return new StaticListValueModel<>(EclipseLinkConvert.RESERVED_CONVERTER_NAMES);
}
protected ListValueModel<String> buildSortedConverterNamesModel() {
- return new SortedListValueModelAdapter<String>(this.buildUniqueConverterNamesModel());
+ return new SortedListValueModelAdapter<>(this.buildUniqueConverterNamesModel());
}
protected CollectionValueModel<String> buildUniqueConverterNamesModel() {
- return new SetCollectionValueModel<String>(this.buildConverterNamesModel());
+ return new SetCollectionValueModel<>(this.buildConverterNamesModel());
}
protected CollectionValueModel<String> buildConverterNamesModel() {
@@ -207,11 +185,11 @@ public class EclipseLinkConvertCombo
}
protected ListValueModel<EclipseLinkConverter> buildConvertersModel() {
- return new ItemPropertyListValueModelAdapter<EclipseLinkConverter>(this.buildConvertersModel_(), JpaNamedContextModel.NAME_PROPERTY);
+ return new ItemPropertyListValueModelAdapter<>(this.buildConvertersModel_(), JpaNamedContextModel.NAME_PROPERTY);
}
protected CollectionValueModel<EclipseLinkConverter> buildConvertersModel_() {
- return new CollectionAspectAdapter<EclipseLinkPersistenceUnit, EclipseLinkConverter>(this.buildPersistenceUnitHolder(), EclipseLinkPersistenceUnit.CONVERTERS_COLLECTION) {
+ return new CollectionAspectAdapter<EclipseLinkPersistenceUnit, EclipseLinkConverter>(this.buildPersistenceUnitModel(), EclipseLinkPersistenceUnit.CONVERTERS_COLLECTION) {
@Override
protected Iterable<EclipseLinkConverter> getIterable() {
return this.subject.getConverters();
@@ -223,12 +201,7 @@ public class EclipseLinkConvertCombo
};
}
- protected PropertyValueModel<EclipseLinkPersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapterXXXX<EclipseLinkConvert, EclipseLinkPersistenceUnit>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
+ protected PropertyValueModel<EclipseLinkPersistenceUnit> buildPersistenceUnitModel() {
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), m -> m.getPersistenceUnit());
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java
index 2383715e5e..1cff97cf34 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
@@ -132,7 +132,7 @@ public class EclipseLinkConverterDialog
}
protected ListValueModel<Class<? extends EclipseLinkConverter>> buildConverterTypeListHolder() {
- return new StaticListValueModel<Class<? extends EclipseLinkConverter>>(CONVERTER_TYPES);
+ return new StaticListValueModel<>(CONVERTER_TYPES);
}
@SuppressWarnings("unchecked")
@@ -173,31 +173,21 @@ public class EclipseLinkConverterDialog
}
private ModifiablePropertyValueModel<String> buildNameHolder() {
- return new PropertyAspectAdapterXXXX<EclipseLinkConverterStateObject, String>(getSubjectHolder(), EclipseLinkConverterStateObject.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkConverterStateObject.NAME_PROPERTY,
+ m -> m.getName(),
+ (m, value) -> m.setName(value)
+ );
}
private ModifiablePropertyValueModel<Class<? extends EclipseLinkConverter>> buildConverterTypeHolder() {
- return new PropertyAspectAdapterXXXX<EclipseLinkConverterStateObject, Class<? extends EclipseLinkConverter>>(getSubjectHolder(), EclipseLinkConverterStateObject.CONVERTER_TYPE_PROPERTY) {
- @Override
- protected Class<? extends EclipseLinkConverter> buildValue_() {
- return this.subject.getConverterType();
- }
-
- @Override
- protected void setValue_(Class<? extends EclipseLinkConverter> value) {
- this.subject.setConverterType(value);
- }
- };
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkConverterStateObject.CONVERTER_TYPE_PROPERTY,
+ m -> m.getConverterType(),
+ (m, value) -> m.setConverterType(value)
+ );
}
void selectAll() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java
index 55320d12e4..3c47b825d7 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.JpaNamedContextModel;
@@ -60,21 +60,12 @@ public class EclipseLinkCustomConverterComposite
}
protected ModifiablePropertyValueModel<String> buildNameTextModel() {
- return new PropertyAspectAdapterXXXX<EclipseLinkCustomConverter, String>(
- getSubjectHolder(), JpaNamedContextModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ JpaNamedContextModel.NAME_PROPERTY,
+ m -> m.getName(),
+ (m, value) -> m.setName((value.length() == 0) ? null : value)
+ );
}
@@ -84,22 +75,12 @@ public class EclipseLinkCustomConverterComposite
@Override
protected ModifiablePropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapterXXXX<EclipseLinkCustomConverter, String>(getSubjectHolder(), EclipseLinkConverterClassConverter.CONVERTER_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getConverterClass();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setConverterClass(value);
- }
- };
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkConverterClassConverter.CONVERTER_CLASS_PROPERTY,
+ m -> m.getConverterClass(),
+ (m, value) -> m.setConverterClass((value.length() == 0) ? null : value)
+ );
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerClassChooser.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerClassChooser.java
index 99c93ccced..4089d0fed6 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerClassChooser.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerClassChooser.java
@@ -13,11 +13,11 @@ import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jpt.common.ui.JptCommonUiMessages;
import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserComboPane;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
@@ -30,14 +30,9 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
* @version 2.3
* @since 2.1
*/
-public class EclipseLinkCustomizerClassChooser extends ClassChooserComboPane<EclipseLinkCustomizer>
+public class EclipseLinkCustomizerClassChooser
+ extends ClassChooserComboPane<EclipseLinkCustomizer>
{
- /**
- * Creates a new <code>CustomizerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
public EclipseLinkCustomizerClassChooser(Pane<?> parentPane,
PropertyValueModel<? extends EclipseLinkCustomizer> subjectHolder,
Composite parent,
@@ -79,27 +74,28 @@ public class EclipseLinkCustomizerClassChooser extends ClassChooserComboPane<Ecl
@Override
protected ModifiablePropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapterXXXX<EclipseLinkCustomizer, String>(
- getSubjectHolder(),
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
EclipseLinkCustomizer.SPECIFIED_CUSTOMIZER_CLASS_PROPERTY,
- EclipseLinkCustomizer.DEFAULT_CUSTOMIZER_CLASS_PROPERTY) {
+ m -> {
+ String className = m.getSpecifiedCustomizerClass();
+ return (className == null) ? defaultText(m) : className;
+ },
+ (m, value) -> m.setSpecifiedCustomizerClass(((value == null) || (value.length() == 0) || value.equals(defaultText(m))) ? null : value)
+ );
+ }
- @Override
- protected String buildValue_() {
- String className = this.subject.getSpecifiedCustomizerClass();
- return (className == null) ? defaultText(this.subject) : className;
- }
+ @Override
+ protected ListValueModel<String> buildClassListModel() {
+ return new PropertyListValueModelAdapter<>(this.buildClassModel());
+ }
- @Override
- protected void setValue_(String value) {
- if (value == null
- || value.length() == 0
- || value.equals(defaultText(this.subject))) {
- value = null;
- }
- this.subject.setSpecifiedCustomizerClass(value);
- }
- };
+ protected PropertyValueModel<String> buildClassModel() {
+ return PropertyValueModelTools.subjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ EclipseLinkCustomizer.DEFAULT_CUSTOMIZER_CLASS_PROPERTY,
+ m -> defaultText(m)
+ );
}
protected String defaultText(EclipseLinkCustomizer customizer) {
@@ -108,16 +104,4 @@ public class EclipseLinkCustomizerClassChooser extends ClassChooserComboPane<Ecl
JptCommonUiMessages.NONE_SELECTED
: NLS.bind(JptCommonUiMessages.DEFAULT_WITH_ONE_PARAM, defaultClassName);
}
-
- @Override
- protected ListValueModel<String> buildClassListModel() {
- return new PropertyListValueModelAdapter<>(
- new PropertyAspectAdapterXXXX<EclipseLinkCustomizer, String>(
- getSubjectHolder(), EclipseLinkCustomizer.DEFAULT_CUSTOMIZER_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return defaultText(this.subject);
- }
- });
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMappingComposite2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMappingComposite2_0.java
index 86e190e5ab..816a33c619 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMappingComposite2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMappingComposite2_0.java
@@ -11,7 +11,6 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -72,12 +71,7 @@ public abstract class EclipseLinkElementCollectionMappingComposite2_0<T extends
}
protected PropertyValueModel<EclipseLinkConverterContainer> buildConverterContainerModel() {
- return new PropertyAspectAdapterXXXX<T, EclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return this.subject.getConverterContainer();
- }
- };
+ return PropertyValueModelTools.transform(this.getSubjectHolder(), m -> m.getConverterContainer());
}
@SuppressWarnings("unused")
@@ -90,7 +84,7 @@ public abstract class EclipseLinkElementCollectionMappingComposite2_0<T extends
Button elConverterButton = addRadioButton(
container,
JptJpaEclipseLinkUiDetailsMessages.TYPE_SECTION_CONVERTED,
- buildConverterBooleanHolder(EclipseLinkConvert.class),
+ buildConverterBooleanModel(EclipseLinkConvert.class),
null);
((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
@@ -105,22 +99,19 @@ public abstract class EclipseLinkElementCollectionMappingComposite2_0<T extends
return container;
}
- protected ModifiablePropertyValueModel<Boolean> buildConverterBooleanHolder(final Class<? extends Converter> converterType) {
- return new PropertyAspectAdapterXXXX<ConvertibleMapping, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getConverterType() == converterType);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(converterType);
- }
- }
- };
+ protected ModifiablePropertyValueModel<Boolean> buildConverterBooleanModel(final Class<? extends Converter> converterType) {
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter(
+ this.getSubjectHolder(),
+ ConvertibleMapping.CONVERTER_PROPERTY,
+ m -> Boolean.valueOf(m.getConverter().getConverterType() == converterType),
+ (m, value) -> {
+ if (value.booleanValue()) {
+ m.setConverter(converterType);
+ }
+ }
+ );
}
+
protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConvertModel(PropertyValueModel<Converter> converterModel) {
return PropertyValueModelTools.transform(converterModel, EclipseLinkConvert.CONVERTER_TRANSFORMER);
}

Back to the top