DataBinding Help [message #1827999] |
Thu, 28 May 2020 16:26  |
Eclipse User |
|
|
|
We have code that was created in Eclipse Galileo. I need to upgrade the Eclipse to the latest version. I run into an issue that the interface IObservableValue changed definition to IObservableValue<T>
I'm looking for new example how the EMF databinding should be defined but can't find any information
My code is simple:
public boolean doDataBinding(EditingDomain domain, EObject input) {
binding = new EMFDataBindingContext();
IWidgetValueProperty<Text, String> prop = WidgetProperties.text(SWT.Modify);
IEMFValueProperty value = EMFEditProperties.value(domain, fldFeature);
IObservableValue<?> ob = value.observe(input);
binding.bindValue(prop.observeDelayed(FIELD_INPUT_DELAY, txtControl), ob);
return false;
}
The warning I get on the code "value.observe(input)" is:
Type safety: The method observe(Object) belongs to the raw type IValueProperty. References to generic type IValueProperty<S,T> should be parameterized
How do I do that???
Where can I find sample code that will help me do databinding for all types of widgets?
Thanks
Yigal
|
|
|
|
Re: DataBinding Help [message #1828009 is a reply to message #1828006] |
Fri, 29 May 2020 02:45  |
Eclipse User |
|
|
|
Hi
Presumably your code works, so Java is 'happy' with the partial type information. The easiest approach is to add e.g. @SuppressWarnings("rawtypes") perhaps to individual declarations, perhaps to methods / classes / projects.
If some parameters are already defined then you need to go along with them, otherwise <?> or <Object> will probably do.
Ultimately genetics enable you to write safer code so its best to use them rather than fight them. As Ed Merks writes, helper methods can help.I have a variety of XXXUtil classes for such purposes.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.16297 seconds