Public Behavior API proposal

John Hendrikx john.hendrikx at gmail.com
Fri Nov 17 10:30:44 UTC 2023


Hi Andy,

I don't think these really qualify as a good enough reason to expose an 
InputMap API by themselves.

The first comment sounds like an X/Y problem, where the user wants to 
achieve X (remove unwanted behavior) and thinks Y (exposing InputMap) is 
the solution -- certainly that is currently the only solution (hack your 
way with reflection to get at the input map), but there are other 
solutions as well to solve X aside from doing Y.  As we've already 
discussed, part of the reason why it is so hard in FX to remove unwanted 
behavior (X) is that Behavior event handling can't be overridden 
reliably.  Event filters may be an (unsatisfactory) solution that the 
user wasn't even aware of. If the user wanted to also respond to the 
events for a different purpose, then prioritized event handlers or 
having behaviors only act on unconsumed events would be a viable 
alternative.

The second comment does not give a problem statement at all, so it is 
hard to count that as an endorsement to opening up InputMap.

The third comment seems to have an entirely different problem, how to 
turn a selected text (which can no doubt consist of styled parts, 
perhaps inline images, etc) into something suitable to put on the 
clipboard (and perhaps vice versa as well). That seems like a problem 
that the Control should solve, and at most has a very thin connection 
with InputMap that such functions should be called when cut/copy/paste 
shortcuts are pressed...

Perhaps I am not seeing something here?

--John

On 16/11/2023 00:44, Andy Goryachev wrote:
>
> Dear colleagues:
>
> I wanted to share some of the feedback we received which might be 
> relevant to the input map / behavior discussion (and sorry for not 
> sending it earlier).  Email addresses in DM are redacted (though some 
> of the responses might be from this mailing list anyway).
>
> Robert REDACTED REDACTED @gmail.com
>
> Very much appreciated from my side.
>
> I can still remember hacking my way into the the InputMap of some 
> controls to change unwanted behaviour.
>
> Generally speaking: Making JavaFX more open is (for me) more important 
> than keeping it 100% backwards compatible / super stable.
>
> ...
>
> Pedro REDACTED REDACTED @gmail.com
>
> Yes Input Map would be a welcome addition.
>
> ...
>
> Buried in
>
> https://github.com/FXMisc/RichTextFX/issues/1167#issuecomment-1435450535
>
>   * There is no way in TextFlow to provide key/action mappings. This
>     becomes a complex area for rich text, for example turning a number
>     of selected Nodes into something suitable for cut/copy/paste is
>     not straight forward.
>
> -andy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20231117/145cbf40/attachment-0001.htm>


More information about the openjfx-dev mailing list