On Wed, 20 Nov 2024 23:45:53 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> Andy Goryachev has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 66 commits:
>> 
>>  - Merge remote-tracking branch 'origin/master' into 8301121.RichTextArea
>>  - hide skin input map
>>  - Merge remote-tracking branch 'origin/master' into 8301121.RichTextArea
>>  - whitespace
>>  - Merge remote-tracking branch 'origin/master' into 8301121.RichTextArea
>>  - save as
>>  - removed function handler
>>  - removed add handler last
>>  - use focus traversal api
>>  - Merge remote-tracking branch 'origin/master' into 8301121.RichTextArea
>>  - ... and 56 more: https://git.openjdk.org/jfx/compare/3a8a5598...e45be7b7
>
> modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/FunctionTag.java
>  line 51:
> 
>> 49: public final class FunctionTag {
>> 50:     /** Constructs the function tag. */
>> 51:     public FunctionTag() {
> 
> Should this be more than a simple "marker" Object with identity, but no 
> state? There is no way to get the information from a particular function tag 
> instance as to what it represents, nor is there a useful "toString()" method. 
> There is also no way to get the set of available FunctionTag objects from the 
> nested <Control>.Tag class. Perhaps we could be informed by the Enum class?
> 
> If there was value in doing this, maybe it could be a record?
> 
> 
>     public final record FunctionTag(String name) { }
> 
> 
> This would be mostly useful for tooling, since most applications aren't 
> likely to need it.
> 
> It might be worth noting, even if you prefer not to make this change.

The main reason there is no name field in the FunctionTag is to simplify the 
life of custom components or internal skin developers.  There is just not 
enough value, in my opinion.

The argument about tooling is an interesting one.  At first glance, I think it 
is possible to retrieve both function tag name and the list of tags declared by 
the control using trivial reflection.

The other possibility is to forgo FunctionTag completely and just use naked 
Strings, losing some degree of type clarity.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1852809036

Reply via email to