<div dir="ltr"><div>Hi Andy,</div><div><br></div><div>I mean this in the most respectful way possible, but my feeling is that most of the arguments presented in favor of this enhancement seem to be driven by an existing implementation, and not a "first-principles" analysis.</div><div><br></div><div>I've seen many proposals on this mailing list shot down with exactly this justification: don't simply propose to make an existing internal implementation public; instead, think of it in terms of the problem and API first. Is the (existing) InputMap idea really so good that it would emerge as the winner in an open competition of ideas? Maybe it is, but I'm not convinced.</div><div><br></div><div>In an earlier mail, you wrote the following:</div><div>> BehaviorBase (or an interface with default methods) is an important addition and a pre-requisite for effective use of the new input map (it’s already being used and is a blocker for RichTextArea, and I have one more control that needs it).</div><div><br></div><div>This puts us in a difficult situation. You're proposing a (controversial) addition to the core JavaFX API, and justify it at least in part with being a blocker for another feature that is presumably already under development. Again, this is not how feature proposals should be justified according to the guidelines of this project.</div><div>Can't you use the existing internal implementation for RichTextArea, at least for the time being? That would give us a bit more time to let the pieces settle. You've put out the first proposal, which is great! But now there's at least one other proposal, which is also a great thing.</div><div><br></div><div>Kevin has rightfully indicated time and time again that we shouldn't rush a new feature into JavaFX, especially if the community hasn't come to a clear agreement. And even if there is an agreement, new features of this magnitude usually take many months (sometimes years) to go in. Why the urgence for this particular feature? At the same time, other useful features like nested change notifications, CSS transitions, or the whole platform preferences / style themes saga sit idly by and wait for their time to shine.</div><div><br></div><div>I acknowledge that the InputMap proposal does add value to JavaFX, but it does so at the cost of a pretty large API surface (InputMap has 12 public methods, and BehaviorBase adds another 13 public methods, and that's before going into all of the FunctionTags defined on controls). My feeling is that at last some of that complexity is a result of working around limitations of JavaFX internals (method names like "addHandlerLast" also seem to suggest that).</div><div><br></div><div>In an earlier mail, I asked you for clarification what this new API enables developers to do. You suggested a customized shortcut feature as seen in Eclipse and other IDEs. John and Martin observed that an application-level key binding feature most likely wouldn't be implemented using "simple" out-of-the-box tools that JavaFX can offer. In this example, when a shortcut is changed in the IDE, the application wouldn't traverse the whole scene graph, looking for controls, and then directly manipulating their InputMap in some fashion to enable application-level shortcuts.</div><div><br></div><div>Since you hinted at RichTextArea, maybe you can talk about how the proposed InputMap is necessary for the new control, and why it can't just use the existing internal impementation like all other built-in controls.</div><div><br></div><div>You also talk about adding missing features. However, I don't see people requesting key remapping very often (either here on the mailing list, or on other channels like Reddit or StackOverflow). From my observation, these are the features requested most often:</div><div><br></div><div>1. SVG images!!!</div><div>2. I want some XYZ control.</div><div>3. By the way, how can I extend and/or modify existing controls and skins?</div><div>4. Make JavaFX look more modern.</div><div><br></div><div>That doesn't mean that key remapping shouldn't be on the list of features we want to implement, but all things considered, I question whether it really is such a forced move to get this feature in ASAP.</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 17, 2023 at 8:07 PM Andy Goryachev <<a href="mailto:andy.goryachev@oracle.com" target="_blank">andy.goryachev@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>





<div lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">Dear John:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">It looks like we have different views on the subject, so perhaps we should invite other people to weigh in.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">My goal is to move forward adding missing features without making any drastic changes, and avoid regressions as much as possible.  We also have to be mindful of the fact that
 we are dealing with constrained resources, so any major development is very likely out of question.  That’s why<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p style="margin-left:0.5in">My problem here is that by making this class public (which IMHO is not a good design) will lock us out of improving this later. 
<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">If nobody uses FX there will be no “later”.  If customers’ code breaks too often they will switch to some [unnamed] alternative.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p style="margin-left:0.5in"><span style="font-family:"Iosevka Fixed SS16""></span>Nothing Behavior related should be made public without a full design of how Behaviors should work, what their responsibilities are, how they interact with Skins (if at all, IMHO
 they shouldn't), etc.  Once a design is known and agreed upon, then we can work on step-by-step improvements by making parts public, and leaving parts hidden.<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">We kind of know what behaviors do - they handle user input, modifying the appearance or internal state of the control.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">I just want to mention again that behaviors must interact with skins - not all the behaviors, but some.  For example, TextArea “MOVE_LINE_END” needs to know how the text is
 laid out in order to determine the target caret position, this function cannot be implemented without the skin and the laid out text.  I think we need to take into account this constraint.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">Another point is that behavior is sometimes stateful, so let’s take this into account as well.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">I think BehaviorBase is just a convenient way to access the new input map (the subject of the new proposal).  If someone does not want or does not need to use the input map
 - fine, nothing in the proposed design requires them to use it.  I don’t think it should be an interface either - the methods in BehaviorBase are protected because they are offered for subclasses only, and making BB an interface will turn these public which
 isn’t right.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">I do acknowledge that the issue of ordering of calls to added handlers might be undefined/unexpected, especially after a skin change.  This is the existing condition, and we
 probably should try to solve it in a separate thread.  I think that for skins the expectation is that the handlers added by the user are orthogonal to those added by the skin/behavior, and if they are not - use event filter, or let’s talk about adding prioritization
 in a separate discussion.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">I also acknowledge that the input map proposal does not address the issue of creating alternative custom skins and extending behaviors beyond modifying the key mappings and
 some limited manipulations of handlers.  But, in my opinion, it adds substantial value to the application developers without upsetting the cart too much.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">They say “better is the enemy of good”, which is apt in our case, though I hope we can somehow agree on a solution in a reasonable time.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">Thank you<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Iosevka Fixed SS16"">-andy</span></p><div id="m_2328378864375805874m_-1376556785332257995mail-editor-reference-message-container"><div><blockquote style="margin-top:5pt;margin-bottom:5pt"><div id="m_2328378864375805874m_-1376556785332257995mail-editor-reference-message-container"><div><blockquote style="margin-top:5pt;margin-bottom:5pt"><div id="m_2328378864375805874m_-1376556785332257995mail-editor-reference-message-container"><div><blockquote style="margin-top:5pt;margin-bottom:5pt"><div id="m_2328378864375805874m_-1376556785332257995mail-editor-reference-message-container"><div><blockquote style="margin-top:5pt;margin-bottom:5pt"><div id="m_2328378864375805874m_-1376556785332257995mail-editor-reference-message-container"><div><div id="m_2328378864375805874m_-1376556785332257995mail-editor-reference-message-container"><div><div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>

</div></blockquote></div></div>