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

Bug 495469

Summary: FXCanvasEx should forward SWT KeyEvent.doit to JavaFX KeyEvent.consumed.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF FXAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand
Version: 0.2.0   
Target Milestone: 5.0.0 (Oxygen) M2   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2016-06-04 10:04:08 EDT
As I have reported through JI-9039178, FXCanvas does not forward the consumed state of org.eclipse.swt.events.KeyEvent (doit) to the javafx.scene.input.KeyEvent (consumed)  that is forwarded to the embedded scene within FXCanvas.sendKeyEventToFX().

Because of this, a delete KeyEvent will for instance be processed both, by the DeleteActionHandler as well as the FXTypeTool/FXDeleteSelectedOnTypePolicy. The policy does not have a chance to infer whether the key event was already handled and thus has to guard itself by checking if there still is a selection. This might not be as easy for other key events/functionalities. 

We should thus investigate to compensate this within FXCanvasEx.
Comment 1 Alexander Nyßen CLA 2016-06-14 12:52:50 EDT
The related JavaFX-bug is https://bugs.openjdk.java.net/browse/JDK-8159227.
Comment 2 Alexander Nyßen CLA 2016-09-07 05:45:09 EDT
I implemented a workaround within FXCanvasEx so that the consumption state of key events is properly  forwarded to the embedded JavaFX scene.

Pushed all changes to origin master. Resolving as fixed in 5.0.0 M2.
Comment 3 Matthias Wienand CLA 2016-09-07 08:57:41 EDT
I added queues for storing the key events to account for asynchronous event forwarding from SWT to JavaFX and added code so that the DeleteActionHandler sets the event.doit=false so that the corresponding event is not processed by GEF policies.