eclipse-windowbuilder / windowbuilder

Eclipse Windowbuilder
https://projects.eclipse.org/projects/tools.windowbuilder
Eclipse Public License 1.0
77 stars 31 forks source link

WindowBuilder crashing because of PojoObservables #783

Open erwinwolff opened 1 month ago

erwinwolff commented 1 month ago

Hi

I am getting an error with windowbuilder. This line sticks out.

line: 172 org.eclipse.core.databinding.beans.PojoObservables cannot be resolved to a type

Is it a setting that I can set to make WindowBuilder not use this class?

Version: updated WindowBuilder Current of Eclipse

Full stack trace:

line: 167 IObservableValue is a raw type. References to generic type IObservableValue should be parameterized line: 168 IObservableValue is a raw type. References to generic type IObservableValue should be parameterized line: 169 Type safety: Unchecked invocation bindValue(IObservableValue, IObservableValue, null, null) of the generic method bindValue(IObservableValue, IObservableValue, UpdateValueStrategy<? super T,? extends M>, UpdateValueStrategy<? super M,? extends T>) of type DataBindingContext line: 169 Type safety: The expression of type IObservableValue needs unchecked conversion to conform to IObservableValue line: 169 Type safety: The expression of type IObservableValue needs unchecked conversion to conform to IObservableValue line: 171 ObservableListContentProvider is a raw type. References to generic type ObservableListContentProvider should be parameterized line: 171 ObservableListContentProvider is a raw type. References to generic type ObservableListContentProvider should be parameterized line: 172 IObservableMap is a raw type. References to generic type IObservableMap<K,V> should be parameterized line: 172 org.eclipse.core.databinding.beans.PojoObservables cannot be resolved to a type line: 176 IObservableList is a raw type. References to generic type IObservableList should be parameterized line: 180 IValueProperty is a raw type. References to generic type IValueProperty<S,T> should be parameterized line: 181 IBeanValueProperty is a raw type. References to generic type IBeanValueProperty<S,T> should be parameterized line: 182 Type safety: Unchecked invocation create(TableViewer, DataBindingContext, CellEditor, IValueProperty, IBeanValueProperty) of the generic method create(ColumnViewer, DataBindingContext, CellEditor, IValueProperty<? super CellEditor,T>, IValueProperty<E,M>) of type ObservableValueEditingSupport line: 182 Type safety: The expression of type IValueProperty needs unchecked conversion to conform to IValueProperty<? super CellEditor,Object> line: 182 Type safety: The expression of type IBeanValueProperty needs unchecked conversion to conform to IValueProperty<Object,Object>

ptziegler commented 1 month ago

Is this caused by the code that is generated by WindowBuilder? How would I reproduce this problem?

erwinwolff commented 1 month ago

Yes it is an error generated by WindowBuilder generated code.

steps to reproduce

Add a JFace Table and TableViewer. Go to bindings and add a binding for Input of the TableViewer Then fill in the list like this: image

The old PojoObservables class will appear in the generated code

erwinwolff commented 1 month ago

POM.xml deps:

org.eclipse.platform org.eclipse.swt.cocoa.macosx.x86_64 3.125.0
    <dependency>
        <groupId>redis.clients</groupId>
        <artifactId>jedis</artifactId>
        <version>${jedis-version}</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.platform</groupId>
        <artifactId>org.eclipse.jface</artifactId>
        <version>3.33.0</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.platform</groupId>
        <artifactId>org.eclipse.core.databinding</artifactId>
        <version>1.13.200</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.platform</groupId>
        <artifactId>org.eclipse.core.databinding.beans</artifactId>
        <version>1.10.200</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.platform</groupId>
        <artifactId>org.eclipse.jface.databinding</artifactId>
        <version>1.15.200</version>
    </dependency>
ptziegler commented 1 month ago

Thanks. I've tried it out and the same issue shows up with the nightly build.

Is it a setting that I can set to make WindowBuilder not use this class?

The short version: No

The migration to the new Observable API is still not completed (as shown in https://github.com/eclipse-windowbuilder/windowbuilder/issues/492). I've created https://github.com/eclipse-windowbuilder/windowbuilder/pull/784, which should handle this specific case. But in general, the Eclipse databinding support is barely holding together.

erwinwolff commented 1 month ago

Thank you very much

ptziegler commented 1 month ago

Fixed via #784 . @erwinwolff Can you try out the upcoming nightly build and check if there is any edge-case I have missed?

erwinwolff commented 1 month ago

Yes

erwinwolff commented 1 month ago

I am getting the error "line: 173 The method observeMaps(IObservableSet, Class, String[]) is undefined for the type PojoProperties"

I am also not convinced that I am using the nightly version of WindowBuilder. How do I explicitly enable the nightly?

ptziegler commented 1 month ago

I am getting the error "line: 173 The method observeMaps(IObservableSet, Class, String[]) is undefined for the type PojoProperties"

That's what I was afraid of... The databinding support is all over the place and I likely missed one or to places :/

I am also not convinced that I am using the nightly version of WindowBuilder. How do I explicitly enable the nightly?

You can always check what version is installed by looking at the timestamp of the installed features/plugins. You can check them via the main menu under Help -> About Eclipse -> Installation Details

You can install the nightly build either via the "Help -> Install New Software..." wizard, using the https://download.eclipse.org/windowbuilder/updates/nightly/latest update site, or via the Eclipse market place if you look for "WindowBuilder Nightly Nightly".