Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5108458: JTable does not properly layout its content #16374

Closed
wants to merge 15 commits into from

Conversation

TejeshR13
Copy link
Contributor

@TejeshR13 TejeshR13 commented Oct 26, 2023

Table contents does not follow right-left Orientation when Max width of columns are set. This is due to not considering the offset in x position while painting table grid and table cell. The fix handles the offset and adjust the x position for each paint, similar to how header is painted. The fix is applied to both Basic and Synth Look and Feel.
The fix is verified for all Look and Feel manually and test verifies on Metal L&F since automatic test cannot be generalized throughout other Look and Feel.
CI tested is green for regression check and test check.


Progress

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

Issue

  • JDK-5108458: JTable does not properly layout its content (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16374

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16374.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 26, 2023

👋 Welcome back tr! 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 openjdk bot added the rfr Pull request is ready for review label Oct 26, 2023
@openjdk
Copy link

openjdk bot commented Oct 26, 2023

@TejeshR13 The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Oct 26, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 26, 2023

@prsadhuk
Copy link
Contributor

prsadhuk commented Nov 8, 2023

similar to how header is painted

Can you please point to the code where the header is painted similarly?

@TejeshR13
Copy link
Contributor Author

similar to how header is painted

Can you please point to the code where the header is painted similarly?

HeaderRect is used in cellRect which computes and thus handles the X position offset.

@TejeshR13
Copy link
Contributor Author

@prsadhuk @DamonGuy Any further suggestions/comments ?

Copy link
Contributor

@DamonGuy DamonGuy left a comment

Choose a reason for hiding this comment

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

There's plenty of places where the for loop is missing a space as well. Seems like there are a lot though, so I'll leave it up to you whether or not it should be fixed with this update. Would seem odd to have a space before some () and not after some others.

@TejeshR13
Copy link
Contributor Author

@prsadhuk @aivanov-jdk I have update the JTable.getCellRect() method as to consider the offset for RTL orientation, it works well and with minimal changes in Table UI classes.

@TejeshR13
Copy link
Contributor Author

@prsadhuk @aivanov-jdk Can u please let me know if any review suggestions are there for this PR?

src/java.desktop/share/classes/javax/swing/JTable.java Outdated Show resolved Hide resolved
src/java.desktop/share/classes/javax/swing/JTable.java Outdated Show resolved Hide resolved
src/java.desktop/share/classes/javax/swing/JTable.java Outdated Show resolved Hide resolved
Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

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

Looks good now.

src/java.desktop/share/classes/javax/swing/JTable.java Outdated Show resolved Hide resolved
@openjdk
Copy link

openjdk bot commented Dec 1, 2023

@TejeshR13 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:

5108458: JTable does not properly layout its content

Reviewed-by: dnguyen, aivanov, psadhukhan

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 849 new commits pushed to the master branch:

  • b9df827: 8309871: jdk/jfr/api/consumer/recordingstream/TestSetEndTime.java timed out
  • 9498469: 8318983: Fix comment typo in PKCS12Passwd.java
  • 4dcbd13: 8314905: jdk/jfr/tool/TestView.java fails with RuntimeException 'Invoked Concurrent' missing from stdout/stderr
  • 5dee2a3: 8320440: Implementation of Structured Concurrency (Second Preview)
  • 6f7bb79: 8320931: [REDO] dsymutil command leaves around temporary directories
  • 8be3e39: 8320129: "top" command during jtreg failure handler does not display CPU usage on OSX
  • 2f299e4: 8321182: SourceExample.SOURCE_14 comment should refer to 'switch expressions' instead of 'text blocks'
  • 3a09a05: 8313722: JFR: Avoid unnecessary calls to Events.from(Recording)
  • 42af8ce: 8308614: Enabling JVMTI ClassLoad event slows down vthread creation by factor 10
  • 1839433: 8320941: Discuss receiver type handling
  • ... and 839 more: https://git.openjdk.org/jdk/compare/fc98998627443d6e73ac70661f47f48b30525712...master

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 ready Pull request is ready to be integrated label Dec 1, 2023
@prsadhuk
Copy link
Contributor

prsadhuk commented Dec 4, 2023

Since this is about getting correct x value depending on column width, can you please confirm it works on table having columns with varying widths?

@TejeshR13
Copy link
Contributor Author

Since this is about getting correct x value depending on column width, can you please confirm it works on table having columns with varying widths?

Yes, I confirmed with varying widths and its working....

@TejeshR13
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 4, 2023

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

  • 2b00ac0: 8308753: Class-File API transition to Preview
  • b9df827: 8309871: jdk/jfr/api/consumer/recordingstream/TestSetEndTime.java timed out
  • 9498469: 8318983: Fix comment typo in PKCS12Passwd.java
  • 4dcbd13: 8314905: jdk/jfr/tool/TestView.java fails with RuntimeException 'Invoked Concurrent' missing from stdout/stderr
  • 5dee2a3: 8320440: Implementation of Structured Concurrency (Second Preview)
  • 6f7bb79: 8320931: [REDO] dsymutil command leaves around temporary directories
  • 8be3e39: 8320129: "top" command during jtreg failure handler does not display CPU usage on OSX
  • 2f299e4: 8321182: SourceExample.SOURCE_14 comment should refer to 'switch expressions' instead of 'text blocks'
  • 3a09a05: 8313722: JFR: Avoid unnecessary calls to Events.from(Recording)
  • 42af8ce: 8308614: Enabling JVMTI ClassLoad event slows down vthread creation by factor 10
  • ... and 840 more: https://git.openjdk.org/jdk/compare/fc98998627443d6e73ac70661f47f48b30525712...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 4, 2023
@openjdk openjdk bot closed this Dec 4, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 4, 2023
@openjdk
Copy link

openjdk bot commented Dec 4, 2023

@TejeshR13 Pushed as commit 0d0a657.

💡 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
client client-libs-dev@openjdk.org integrated Pull request has been integrated
6 participants