Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 501056

Summary: [Java9] Ensure FXCanvasEx is Java9-compatible
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF FXAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0.0   
Target Milestone: 5.0.0 (Oxygen) M3   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 499676    
Bug Blocks: 482444    

Description Alexander Nyßen CLA 2016-09-08 05:36:13 EDT
FXCanvasEx provides workarounds for the following JavaFX problems:

JDK-8088147 -> Image cursors not supported (SWTCursors) [FIXED in JavaFX9]
JDK-8160325 -> Provide public API to access FXCanvas for embedded scene [FIXED in JavaFX 9]
JDK-8161282 -> FXCanvas does not forward horizontal mouse scroll events to the embedded scene. [FIXED in JavaFX 9]
JDK-8143596 -> Forward touch gestures to FXCanvas embedded scene [PATCH PROVIDED, FIX for Java9 in review]

JDK-8159227 -> KeyEvent.doit should be forwarded to KeyEvent.consumed() (OPEN)
JDK-8161587 -> FXCanvas does not update SWT Display (OPEN)
JDK-8088862 -> Provide possibility to traverse focus out of FX scene (OPEN)

Some will be resolved in Java9 (I have provided respective patches to OpenJFX), and we need to ensure FXCanvasEx respects that properly, so that the compensation code is only active in an Java8 environment. Further, we need to ensure that the Java8-related workarounds do not cause compile/runtime problems in a Java9 JIGSAW environment.
Comment 1 Alexander Nyßen CLA 2016-09-08 05:46:06 EDT
As soon as JDK-8143596 is guaranteed to be resolved in Java9, we should fully merge SWT2FXEventConverter into FXCanvasEx (see bug #499676), ensure it behaves identically to FXCanvas in Java9, is only active in a Java8 environment, and does not conflict with JIGSAW. As its no longer needed in a Java9 environment, we should no longer offer it as own API.
Comment 2 Alexander Nyßen CLA 2016-09-21 02:34:24 EDT
Having back-ported the fix for JDK-8143596 into FXCanvasEx (see bug #499676), I ensured that TKSceneListener is accessed via reflection code only, and only in a JavaSE-1.8 environment, where the workaround for JDK-8143596 is still required.

FXCanvasEx does no longer provide compile-time dependencies on JDK internal API, and the reflection-based workarounds for JDK-8161282 and JDK-8143596 are limited to Java-8. As such, resolving this as fixed in 5.0.0 M3.