Non-Deprecated Data Binding for SWT/JFace
Asked Answered
C

1

1

I have been toying around with Eclipse plug-in development recently and when I tried to bind an SWT Text to a String in my data model using the Eclipse Bindings tab, the code it generated was relying on deprecated classes like WidgetPropertiesand PojoProperties.

Are there any newer classes I missed out on? Is there an easy way to do the data binding without having to suppress warnings?

Ciaracibber answered 15/12, 2021 at 10:40 Comment(0)
A
3

For WidgetProperties use the class in the org.eclipse.jface.databinding.swt.typed package rather than the deprecated classes in org.eclipse.jface.databinding.swt.

For PojoProperties and BeanProperties the replacement is in org.eclipse.core.databinding.beans.typed rather than org.eclipse.core.databinding.beans

ViewerProperties in org.eclipse.jface.databinding.viewer has also been replaced with a class in org.eclipse.jface.databinding.viewers.typed

The classes in the xxx.typed package have been modified to use generics.

Antiperistalsis answered 15/12, 2021 at 10:47 Comment(2)
Interesting! Well, that worked. I had discovered in the meantime that the Vogella JFace Data Binding tutorial recommends suppressing the warning, which is unsatisfying ofc. Weirdly enough they import from swt.typed right above section 1.2.: vogella.com/tutorials/EclipseDataBinding/article.html Are these new packages largely undocumented as of yet? Because search engines don't display much meaningful results when looking for org.eclipse.jface.databinding.swt.typed. In fact, this thread here is the current top result using duckduckgo.Ciaracibber
Documentation on all this is pretty sparse, I just saw these changes when they appeared a few releases ago in the "what's new" in the release notes.Antiperistalsis

© 2022 - 2024 — McMap. All rights reserved.