RFR: 8092102: Labeled: truncated property [v14]
Andy Goryachev
angorya at openjdk.org
Fri May 3 22:33:03 UTC 2024
On Fri, 3 May 2024 21:00:26 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> Adds **Labeled.textTruncated** property which indicates when the text is visually truncated (and the ellipsis string is inserted) in order to fit the available width.
>>
>> The new property is being set by the code which computes the actual text string to be displayed (and which inserts the ellipsis string) in `LabeledSkinBase.updateDisplayedText(double,double)`.
>>
>>
>> **Alternative**
>>
>> None exists as this requires changes to the core (Utils).
>>
>>
>> **See Also**
>>
>> * [JDK-8327483](https://bugs.openjdk.org/browse/JDK-8327483) TreeView: Allow for tooltip when cell text is truncated
>> * [JDK-8205211](https://bugs.openjdk.org/browse/JDK-8205211) Ability to show Tooltip only when text is shown with ellipsis (...)
>
> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
>
> whitespace
Changed the way the new property is being set. Instead of listening for a bunch of existing properties (that's bad), hooked up directly into `LabeledSkinBase.updateDisplayedText()` which does the actual manipulation with the text.
In addition, modified the Monkey Tester
https://github.com/andy-goryachev-oracle/MonkeyTest
to add ability to see the value of various properties in real time.
For example, to verify that the new property is being updated in the context of a table, select TableView page, set Control -> Context Menu -> Show Properties Monitor, select a cell and right click to open the Property Monitor window. Find a `TextFieldTableCell` in the list and observe the value changing when resizing the column:

-------------
PR Comment: https://git.openjdk.org/jfx/pull/1389#issuecomment-2093841963
More information about the openjfx-dev
mailing list