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

Bug 500984

Summary: Split IFXOnTypePolicy into IFXOnKeyPressReleasePolicy and IFXOnTypePolicy.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0.0   
Target Milestone: 5.0.0 (Oxygen) M2   
Hardware: All   
OS: All   
Whiteboard:

Description Matthias Wienand CLA 2016-09-07 08:26:43 EDT
Currently, JavaFX KeyEvent#KEY_PRESSED, KeyEvent#KEY_TYPED, and KeyEvent#KEY_RELEASED events are all processed by IFXOnTypePolicy implementations. Therefore, the processing of held down keys (and pressing/releasing in between) is mixed with the processing of typed keys (i.e. single press of a number of keys), i.e. two separate interactions are handled by the same interaction policy. In order to simplify processing of these separate interactions, the IFXOnTypePolicy should be split into IFXOnKeyPressReleasePolicy and IFXOnTypePolicy.

The IFXOnKeyPressReleasePolicy should handle keyboard interaction where keys are held down. Therefore, it should provide the pressed() and released() methods from the old IFXOnTypePolicy. Additionally, it should provide methods for the processing of the initial key press, as well as the final key release: initialPress() and finalRelease(), respectively.

The new IFXOnTypePolicy should handle the single press of a combination of keys. Therefore, it should contain the typed() method from the old IFXOnTypePolicy. However, in order to be able to process a combination of keys, a Set<KeyCode> should be passed to the callback method. The typed() callbacks should be invoked after every KEY_PRESSED event.
Comment 1 Matthias Wienand CLA 2016-09-12 05:30:12 EDT
I split the IFXOnTypePolicy into an IFXOnStrokePolicy and an IFXOnTypePolicy. The former being responsible for gesture-like keyboard interaction where keys are held down. The latter being responsible for single key presses and entering of characters. The code is published on the master branch, therefore, I resolve this ticket as fixed for 5.0.0 M2.