From 046f8788e9ebc7385aea194dcd7adce24500f849 Mon Sep 17 00:00:00 2001 From: Simon Barner <barner@fortiss.org> Date: Tue, 2 Oct 2018 13:23:36 +0200 Subject: [PATCH] IObservable*: Avoid using raw types Issue-Ref: 3539 Issue-Url: https://af3-developer.fortiss.org/issues/3539 Signed-off-by: Simon Barner <barner@fortiss.org> --- .../tooling/base/ui/databinding/.ratings | 4 ++-- ...yledTextCellDatabindingEditingSupport.java | 2 +- ...atedTextCellDatabindingEditingSupport.java | 2 +- .../tooling/kernel/ui/extension/base/.ratings | 2 +- .../extension/base/PropertySectionBase.java | 20 +++++++++---------- .../kernel/ui/internal/properties/.ratings | 4 ++-- .../properties/IdLabeledPropertySection.java | 2 +- .../NamedCommentedPropertySection.java | 2 +- .../fortiss/tooling/kernel/ui/util/.ratings | 4 ++-- .../kernel/ui/util/DataBindingUtils.java | 6 +++--- .../kernel/ui/util/ObservableUtils.java | 4 ++-- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/.ratings b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/.ratings index f3a3f4732..a6faf27f8 100644 --- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/.ratings +++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/.ratings @@ -1,5 +1,5 @@ -AbstractDecoratedStyledTextCellDatabindingEditingSupport.java 4e22c7b25b5093383d403840be2eb5ec7fcd6815 GREEN -AbstractDecoratedTextCellDatabindingEditingSupport.java 425a9af81a12de4f3c8e398c1d461dece0d686d5 GREEN +AbstractDecoratedStyledTextCellDatabindingEditingSupport.java 7db18b7973f945f087c0188f485fe3a63007d6c8 YELLOW +AbstractDecoratedTextCellDatabindingEditingSupport.java 35f02a80a8d66975eace1805247ff4e2f8129283 YELLOW AbstractStyledTextCellDatabindingEditingSupport.java 8207d7cc6e5d49f8bca0b46fe92a08df85ad9094 GREEN AbstractTextCellDatabindingEditingSupport.java 348e8377f8da4f8a4073c96cee58178635641678 GREEN FloatValidator.java 371c13a05481c3d03304e82997b523eeec8746aa GREEN diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedStyledTextCellDatabindingEditingSupport.java b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedStyledTextCellDatabindingEditingSupport.java index 4e22c7b25..7db18b797 100644 --- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedStyledTextCellDatabindingEditingSupport.java +++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedStyledTextCellDatabindingEditingSupport.java @@ -73,7 +73,7 @@ public abstract class AbstractDecoratedStyledTextCellDatabindingEditingSupport } /** Sub-classes need to provide an {@link IObservableValue} for the model. */ - protected abstract IObservableValue getModelObservableValue(Object model); + protected abstract IObservableValue<?> getModelObservableValue(Object model); /** * Sub-classes need to provide an {@link IConverter} that converts the model into its textual diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedTextCellDatabindingEditingSupport.java b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedTextCellDatabindingEditingSupport.java index 425a9af81..35f02a80a 100644 --- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedTextCellDatabindingEditingSupport.java +++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/databinding/AbstractDecoratedTextCellDatabindingEditingSupport.java @@ -69,7 +69,7 @@ public abstract class AbstractDecoratedTextCellDatabindingEditingSupport } /** Sub-classes need to provide an {@link IObservableValue} for the model. */ - protected abstract IObservableValue getModelObservableValue(Object model); + protected abstract IObservableValue<?> getModelObservableValue(Object model); /** * Sub-classes need to provide an {@link IConverter} that converts the model into its textual diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/extension/base/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/extension/base/.ratings index 89415a189..aa4c2ff6a 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/extension/base/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/extension/base/.ratings @@ -7,7 +7,7 @@ ModelEditorBindingBase.java 4c5ac569c0b6e7678fc8191096b26dfd09fdcb98 GREEN ModelElementHandlerBase.java 384727748f125c9d43f19d9c0eba4ba1be5a7a26 GREEN MultiEObjectActionBase.java 9e237d8ea640c4194e4877af4a9cfce88698e543 GREEN NamedCommentedModelElementHandlerBase.java 681b98b50b362f01abb7a36f108f4f11b9e51829 GREEN -PropertySectionBase.java adf1819527a793dac41d36ea73f6ae9d9dad301b GREEN +PropertySectionBase.java 3601ee8bd77be45ff770a5ee1c7536f100bee6b2 YELLOW TutorialStepUIAtomicBase.java cea2a158158b476de2108d2309afcf47f217b6d9 GREEN TutorialStepUIAtomicWithWhitelistBase.java a9788ae514f62d27169c737ef59fb583234b5d43 GREEN TutorialStepUICompositeBase.java 8225210eacb5b88de47d78280c5819f572f00ffa GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/extension/base/PropertySectionBase.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/extension/base/PropertySectionBase.java index adf181952..3601ee8bd 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/extension/base/PropertySectionBase.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/extension/base/PropertySectionBase.java @@ -290,7 +290,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { * Binds a positive {@link BigDecimal} value with the default number of a maximum of three * fraction digits to be used in the String representation. */ - protected void bindPositiveBigDecimalValue(Control text, IObservableValue observedValue) { + protected void bindPositiveBigDecimalValue(Control text, IObservableValue<?> observedValue) { bindBigDecimalValue(text, observedValue, NumberPositiveValidator.INSTANCE); } @@ -298,7 +298,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { * Binds a positive {@link BigDecimal} value with a user defined maximum number of fraction * digits to be used in the String representation. */ - protected void bindPositiveBigDecimalValue(Control text, IObservableValue observedValue, + protected void bindPositiveBigDecimalValue(Control text, IObservableValue<?> observedValue, int maxFractionDigits) { bindBigDecimalValue(text, observedValue, NumberPositiveValidator.INSTANCE, maxFractionDigits); @@ -308,7 +308,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { * Binds a {@link BigDecimal} value with the default number of a maximum of three fraction * digits to be used in the String representation. */ - protected void bindBigDecimalValue(Control text, IObservableValue observedValue, + protected void bindBigDecimalValue(Control text, IObservableValue<?> observedValue, IValidator numberValidator) { // TextToDoubleValidator checks format of fractional numbers and is hence also suitable for // BigDecimals @@ -320,7 +320,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { * Binds a BigDecimal value with a user defined maximum number of fraction digits to be * used in the String representation. */ - protected void bindBigDecimalValue(Control text, IObservableValue observedValue, + protected void bindBigDecimalValue(Control text, IObservableValue<?> observedValue, IValidator numberValidator, int maxFractionDigits) { NumberFormat nf = NumberFormat.getNumberInstance(); @@ -335,7 +335,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { * Binds a positive double value with the default number of a maximum of three fraction digits * to be used in the String representation. */ - protected void bindPositiveDoubleValue(Control text, IObservableValue observedValue) { + protected void bindPositiveDoubleValue(Control text, IObservableValue<?> observedValue) { bindDoubleValue(text, observedValue, NumberPositiveValidator.INSTANCE); } @@ -343,7 +343,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { * Binds a positive double value with a user defined maximum number of fraction digits to be * used in the String representation. */ - protected void bindPositiveDoubleValue(Control text, IObservableValue observedValue, + protected void bindPositiveDoubleValue(Control text, IObservableValue<?> observedValue, int maxFractionDigits) { bindDoubleValue(text, observedValue, NumberPositiveValidator.INSTANCE, maxFractionDigits); } @@ -352,7 +352,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { * Binds a double value with the default number of a maximum of three fraction digits * to be used in the String representation. */ - protected void bindDoubleValue(Control text, IObservableValue observedValue, + protected void bindDoubleValue(Control text, IObservableValue<?> observedValue, IValidator numberValidator) { performComplexTextBinding(dbc, text, observedValue, fromDouble(false), toDouble(false), TextToDoubleValidator.INSTANCE, numberValidator); @@ -362,7 +362,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { * Binds a double value with a user defined maximum number of fraction digits to be * used in the String representation. */ - protected void bindDoubleValue(Control text, IObservableValue observedValue, + protected void bindDoubleValue(Control text, IObservableValue<?> observedValue, IValidator numberValidator, int maxFractionDigits) { NumberFormat nf = NumberFormat.getNumberInstance(); @@ -372,12 +372,12 @@ public abstract class PropertySectionBase extends AbstractPropertySection { } /** Binds a positive integer value. */ - protected void bindPositiveIntegerValue(Control text, IObservableValue observedValue) { + protected void bindPositiveIntegerValue(Control text, IObservableValue<?> observedValue) { bindIntegerValue(text, observedValue, NumberPositiveValidator.INSTANCE); } /** Binds a integer value. */ - protected void bindIntegerValue(Control text, IObservableValue observedValue, + protected void bindIntegerValue(Control text, IObservableValue<?> observedValue, IValidator numberValidator) { performComplexTextBinding(dbc, text, observedValue, fromInteger(false), toInteger(false), TextToIntegerValidator.INSTANCE, numberValidator); diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/.ratings index efec58a8d..1b6796bd6 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/.ratings @@ -1,3 +1,3 @@ -IdLabeledPropertySection.java ccc7266082537290e78645bb93bdb679d3728d5a GREEN -NamedCommentedPropertySection.java a1cd598f97bfe2fb84caf53e02e87133f421b657 GREEN +IdLabeledPropertySection.java 9a419c0aa35c0ab02b38ec769cbd69cea99e66ca RED +NamedCommentedPropertySection.java 0327480eb54090508758ce1d3a97da9fde93cf0f RED PropertiesAdapterFactory.java 607f4c1cf70e41beb916dbd69160b272e68dc301 GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/IdLabeledPropertySection.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/IdLabeledPropertySection.java index ccc726608..9a419c0aa 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/IdLabeledPropertySection.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/IdLabeledPropertySection.java @@ -59,7 +59,7 @@ public class IdLabeledPropertySection extends PropertySectionBase { public void refresh() { super.refresh(); - IObservableValue modelObservable = ObservableUtils.observeValue(idLabeled, + IObservableValue<?> modelObservable = ObservableUtils.observeValue(idLabeled, FortissToolingKernelPackage.Literals.IID_LABELED__ID); dbc.bindValue(SWTObservables.observeText(idText, SWT.None), modelObservable, null, null); } diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/NamedCommentedPropertySection.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/NamedCommentedPropertySection.java index a1cd598f9..0327480eb 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/NamedCommentedPropertySection.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/properties/NamedCommentedPropertySection.java @@ -87,7 +87,7 @@ public class NamedCommentedPropertySection extends PropertySectionBase { commentText.setEnabled(false); } - IObservableValue modelObservable = ObservableUtils.observeValue(namedCommented, + IObservableValue<?> modelObservable = ObservableUtils.observeValue(namedCommented, FortissToolingKernelPackage.Literals.INAMED_ELEMENT__NAME); dbc.bindValue(SWTObservables.observeText(nameText, SWT.Modify), modelObservable, null, null); diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/.ratings index c210c4ed6..1622ddcab 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/.ratings @@ -1,11 +1,11 @@ ActionUtils.java 4553e487264e3d1f86f4767da4a7400cce4b9a5d GREEN ConstraintsUIUtils.java 69d5e08bbf768baf2790380e36f1020ef826a33e GREEN CopyPasteUtils.java bbc5cf9c9dc03ebf8dc75d42c919fe6eb60b388e GREEN -DataBindingUtils.java 7e51b4eb1b34454f8ce6484eb1412c266942dc65 GREEN +DataBindingUtils.java 4c2fc0bab9e9ea739411aa42f4a4393f1393396e RED DragAndDropUtils.java 7aab91518aa12d76533a345bf6ed0be9ac7ff0e5 GREEN EObjectSelectionUtils.java 928280b5dd3bb634debc1ac3be9f15b4e45f2683 GREEN KernelUIUtils.java 46d3279ef3523b104f89a6c526109f72d36f72f2 GREEN -ObservableUtils.java 2ffced494a86bd7e8f8eb8882aec38b06f0f2818 GREEN +ObservableUtils.java 34abfd1dfaf9c0acbb31caf1f525e7b39416c116 YELLOW PropertiesConstantUtils.java 59b1a1e4d594bb98db3aa396f2ff6474ba405920 GREEN SelectionUtils.java 3d20f87eaaee04173686ef62b09ca6971702cd00 GREEN TutorialUIServiceUtils.java 093a8a3549c6952d44ea508e66691434b17a95b5 GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java index 7e51b4eb1..4c2fc0bab 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java @@ -110,7 +110,7 @@ public final class DataBindingUtils { * @return the array of constructed bindings */ public static Binding[] performComplexTextBinding(DataBindingContext dbc, Control control, - IObservableValue modelValue, IConverter modelToTextConverter, + IObservableValue<?> modelValue, IConverter modelToTextConverter, IConverter textToModelConverter, IValidator textValidator, IValidator textPostConvertValidator) { @@ -147,7 +147,7 @@ public final class DataBindingUtils { */ public static Binding[] performComplexTextBinding(DataBindingContext dbc, Control control, - IObservableValue modelValue, IObservableValue modelValueComment, + IObservableValue<?> modelValue, IObservableValue<?> modelValueComment, IConverter modelToTextConverter, IConverter textToModelConverter, IValidator textValidator, IValidator textPostConvertValidator) { @@ -227,7 +227,7 @@ public final class DataBindingUtils { * @return the array of constructed bindings */ public static Binding[] performCellTextBinding(DataBindingContext dbc, Control control, - IObservableValue cellValue, IConverter modalToCellConverter, + IObservableValue<?> cellValue, IConverter modalToCellConverter, IConverter cellToModelConverter, IValidator validator) { Binding[] bindings = new Binding[2]; diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/ObservableUtils.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/ObservableUtils.java index 2ffced494..34abfd1df 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/ObservableUtils.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/ObservableUtils.java @@ -39,7 +39,7 @@ public class ObservableUtils { * the elements feature to be observed * @return the observable value */ - public static IObservableValue observeValue(EObject eObject, + public static IObservableValue<?> observeValue(EObject eObject, EStructuralFeature structuralFeature) { return observeValue(Realm.getDefault(), eObject, structuralFeature); } @@ -55,7 +55,7 @@ public class ObservableUtils { * the elements feature to be observed * @return the observable value */ - public static IObservableValue observeValue(Realm realm, EObject eObject, + public static IObservableValue<?> observeValue(Realm realm, EObject eObject, EStructuralFeature structuralFeature) { CCSMPre.isTrue(eObject != null, "Can not observe null value!"); return new EObjectObservableValue(realm, eObject, structuralFeature); -- GitLab