Skip to content

Commit

Permalink
Table: fixed border arc of components in complex table cell editors (…
Browse files Browse the repository at this point in the history
…issue #786)
  • Loading branch information
DevCharly committed Jan 10, 2024
1 parent a9ea9da commit 50c630f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ FlatLaf Change Log
#761)
- ScrollPane: Styling ScrollPane border properties did not work if view
component is a Table.
- Table: Switching theme looses table grid and intercell spacing. (issues #733
and #750)
- Table: Fixed background of `boolean` columns when using alternating row
colors. (issue #780)
- Table:
- Switching theme looses table grid and intercell spacing. (issues #733 and
#750)
- Fixed background of `boolean` columns when using alternating row colors.
(issue #780)
- Fixed border arc of components in complex table cell editors. (issue #786)
- TableHeader: No longer temporary replace header cell renderer while painting.
This avoids a `StackOverflowError` in case that custom renderer does this too.
(see [NetBeans issue #6835](https://github.com/apache/netbeans/issues/6835))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,10 @@ public static boolean isCellEditor( Component c ) {
if( c == null )
return false;

// check whether used in cell editor (check 3 levels up)
Component c2 = c;
for( int i = 0; i <= 2 && c2 != null; i++ ) {
Container parent = c2.getParent();
if( parent instanceof JTable && ((JTable)parent).getEditorComponent() == c2 )
return true;

c2 = parent;
}
// check whether used as table cell editor
Container parent = c.getParent();
if( parent instanceof JTable && ((JTable)parent).getEditorComponent() == c )
return true;

// check whether used as cell editor
// Table.editor is set in JTable.GenericEditor constructor
Expand Down

1 comment on commit 50c630f

@MikOfClassX
Copy link

Choose a reason for hiding this comment

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

👍

Please sign in to comment.