Issue
I've been trying to setup GEF5 on Eclipse 4.25 with Open JDK 17 and Open Java FX 17. I was successful to some extent however when I tried to use GEF's creation policy (org.eclipse.gef.mvc.fx.policies.CreationPolicy) to draw a visual, there was an exception and I could not draw the visual on the canvas.
The Exception was
java.lang.NullPointerException: Cannot invoke "org.eclipse.gef.mvc.fx.parts.IContentPart.getRoot()" because "part" is null at org.eclipse.gef.mvc.fx.policies.CreationPolicy.createFocusOperation(CreationPolicy.java:217) at org.eclipse.gef.mvc.fx.policies.CreationPolicy.create(CreationPolicy.java:152) at org.eclipse.gef.mvc.fx.policies.CreationPolicy.create(CreationPolicy.java:201)
I debugged the issue and found out some things mentioned below
The issue is that in the CreationPolicy.create method , we add a Content Child to a Parent ContentPolicy, (Line num : 119) which, in short , adds a child Content Part to an ObservableListWrapperEx of the parent through the setAll Operation.
The following piece of code then triggers an event
helper.fireValueChangedEvent( new ListListenerHelperEx.AtomicChange<>(this, previousContents, ElementarySubChange.replaced( previousContents, delegate(), 0, size())));
which the JavaFX17 should respond to an then the Actual Content Part is retrieved from the Content Factory.
But in JavaFX 17 -->
javafx.collections.ObservableListBase --> void javafx.collections.ObservableListBase.fireChange(Change<? extends E> change method, the listenerHelper is null for this list and hence the event is then ignored.
However, I was able to run it successfully on OpenJDK 11 and Open JavaFx 11. The event and the response to the event was as expected here.
I'm not sure what could've gone wrong with Open JDK 17 and Open JavaFx 17
Did I do something wrong in the setup?
I'm using GEF 5 on both my setups and e(fx)clipe 3.7.0 with eclipse 4.14 and OpenJDK 11 and e(fx)clipse 3.9.0 with eclipse 4.25 and Open JDK 17.
Any help would be appreciated.
Thanks and Regards, Rishabh
Solution
Just an update here. I was successfully able to setup GEF5 with Open JavaFX 17 and OpenJDK17,
All I had to do was revert my GEF5 installation to the one specified here : https://download.eclipse.org/tools/gef/updates/releases/5.0.0_gef-master_4403/ Looks like there is a bug in GEF5 when installed directly from Eclipse 4.25's update site.
Answered By - Rishabh Sharma
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.