kasemir / org.csstudio.display.builder

Update of org.csstudio.opibuilder.*
Eclipse Public License 1.0
2 stars 10 forks source link

Event filter in EditorGUI has side effect #558

Closed georgweiss closed 3 years ago

georgweiss commented 3 years ago

In EditorGUI line 403 an event filter for mouse press is added such that the "layout" Node requests focus. This has a peculiar side effect that I unfortunately have not been able to understand. The observed behavior is associated with the built-in word selection capabilities of the JavaFX TextField, i.e. a double click may select a portion of the string in the TextField if the string contains separators (space or special characters). To reproduce: 1) Enter a string like $(A):whatever in the PV name field. 2) Place cursor to the right of the last character, or inside the "whatever" substring. 3) Double click primary mouse button => The $ character is marked/selected, see screen shot. The expected behavior would be for the TextField to mark "whatever". This is the case if the multiline editor is opened and the procedure is repeated.

If in EditorGUI the event filter is set on editor_scene instead, I get the expected behavior. This change is simple, but I'd like @kasemir to comment on potential consequences.

Screenshot 2020-11-02 at 10 50 48

kasemir commented 3 years ago

I think you are referring to the display builder in Phoebus, while this issue is in the repo for the Eclipse-based CS-Studio. If moving the filter to a different node helps, no problem. Best would be to completely avoid the need for this filter. It was added to allow a "natural" copy/paste of widgets between two editors: Ctrl-C in source editor, click into target editor, Ctrl-V. So that's what I would check after changes to see if it still "works".

georgweiss commented 3 years ago

You're right @kasemir , don't know how I managed to create the issue in this project.