Skip to content

8375444: MenuButton - textTruncated Property is always false#2040

Closed
FlorianKirmaier wants to merge 4 commits intoopenjdk:masterfrom
FlorianKirmaier:JDK-8375444-menubutton
Closed

8375444: MenuButton - textTruncated Property is always false#2040
FlorianKirmaier wants to merge 4 commits intoopenjdk:masterfrom
FlorianKirmaier:JDK-8375444-menubutton

Conversation

@FlorianKirmaier
Copy link
Copy Markdown
Member

@FlorianKirmaier FlorianKirmaier commented Jan 15, 2026

For MenuButton and SplitMenuButton the textTruncated Property is always false - but the text is correctly rendered truncated if it is to long.

This PR fixes it, by extending the logic in LabeledImpl - to always forward this property.
I've also extended the existing tests for the truncated property.

It would be great, to get some feedback on how i fixes the bug.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8375444: MenuButton - textTruncated Property is always false (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/2040/head:pull/2040
$ git checkout pull/2040

Update a local copy of the PR:
$ git checkout pull/2040
$ git pull https://git.openjdk.org/jfx.git pull/2040/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2040

View PR using the GUI difftool:
$ git pr show -t 2040

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/2040.diff

Using Webrev

Link to Webrev Comment

Fix textTruncated property for MenuButton
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Jan 15, 2026

👋 Welcome back fkirmaier! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Jan 15, 2026

@FlorianKirmaier This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8375444: MenuButton - textTruncated Property is always false

Reviewed-by: angorya, mstrauss

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 30 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk Bot added the rfr Ready for review label Jan 15, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Jan 15, 2026

Webrevs

labeled.textProperty().addListener(shuttler);

labeledImpl.textTruncatedProperty().subscribe(v -> {
LabeledHelper.setTextTruncated(labeled, v);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the property be bound instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going through the Accessor pattern of Labeled.
I could extend it, to return the BooleanProperty and use it.
Should i?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, right, I forgot it's a read-only property (and I should know).

let me take a look, at first glance it looks right.

@andy-goryachev-oracle
Copy link
Copy Markdown
Contributor

/reviewers 2

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Jan 15, 2026

@andy-goryachev-oracle
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

Copy link
Copy Markdown
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behaves as expected, the implementation looks good (thanks to Subscription).

Minor comments, will re-approve if you make changes.

For reviewers: added "text truncated" indicator to all controls that extend Labeled, grab the latest here:
https://github.com/andy-goryachev-oracle/MonkeyTest

Small code formatting fixes
@FlorianKirmaier
Copy link
Copy Markdown
Member Author

Thank you for the quick feedback! I did the small formatting changes.

Removed unnecessary newline
Removed commented out print statements.
Fixed import order.
@FlorianKirmaier
Copy link
Copy Markdown
Member Author

Thank you for the two quick code reviews!
I did all the small formatting changes.
Please let me know, whether i should change anything else.

@openjdk openjdk Bot added the ready Ready to be integrated label Feb 10, 2026
@andy-goryachev-oracle
Copy link
Copy Markdown
Contributor

@FlorianKirmaier this is ready to integrate

@FlorianKirmaier
Copy link
Copy Markdown
Member Author

/integrate

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Feb 12, 2026

Going to push as commit bf93e0d.
Since your change was applied there have been 35 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Feb 12, 2026
@openjdk openjdk Bot closed this Feb 12, 2026
@openjdk openjdk Bot removed ready Ready to be integrated rfr Ready for review labels Feb 12, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Feb 12, 2026

@FlorianKirmaier Pushed as commit bf93e0d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants