Skip to content

JTable: Fix absence of horizontal scrollbar and add popup menu actions #63

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

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

tferr
Copy link
Contributor

@tferr tferr commented Apr 2, 2022

This ensures horizontal scrollbar is displayed when contents of table too small to fit in view port.
In addition, it implements a contextual menu hosting some basic actions:

  • Copy and Select All command (from the JTable action map)
  • Delete selected rows command
  • Resize command that enlarges column widths to largest cell in the column

Fixes #62

This ensures horizontal scrollbar is displayed when contents of table too small to fit in view port.
In addition, it implements a contextual menu hosting some basic actions:
- Copy and Select All command (from the JTable action map)
- Delete selected rows command
- Resize command that enlarges column widths to largest cell in the column

Fixes scijava#62
@tferr
Copy link
Contributor Author

tferr commented Apr 20, 2022

@imagejan, @ctrueden, just to bump this. Is there anyone I can mention directly that would have the bandwidth to merge this? Tables remain quite unusable without it. I am happy to provide more details

@ctrueden
Copy link
Member

@hinerm Do you have time to test and merge this PR? I wanted to do it today, but got sidetracked by scifio-labeling and ran out of time.

@imagejan
Copy link
Member

Thanks @tferr for improving the table display!

When testing quickly, I observed inconsistent behavior before and after running the Resize Column Widths command:

  • before: resizing the width of the window leads to appearance of scroll bar when the size gets too small
  • after: resizing of the window is only possible down to the minimal column size; no scroll bar appears.

image
image

Here's a script I used for testing:

#@output a
#@output b
#@output c
#@output d
#@output e
#@output f
#@output g
#@output h
#@output i
#@output j
#@output k
#@output l
#@output m
#@output n
#@output o
#@output p
#@output q
#@output r
#@output s
#@output t
#@output u
#@output v
#@output w

a = 1
b = 1
c = 1
d = 1
e = 1
f = 1
g = 1
h = 1
i = 1
j = 1
k = 1
l = 1
m = 1
n = 1
o = 1
p = 1
q = 1
r = 1
s = 1
t = 1
u = 100000
v = 1
w = 1

This (minor) issue doesn't appear when the total width of the resized columns is larger than the minimal width possible for the window. (You can try for example by making the second column larger, like #@output m => #@output mmmmm.)


Anyhow, the suggested changes seem good to me, and an improvement to the current situation, so that minor issue shouldn't block merging this PR. 👍

@ctrueden ctrueden merged commit 6673b20 into scijava:master Apr 22, 2022
@ctrueden
Copy link
Member

👍 My only question is about the new public void removeRows(int[]) method. Is this an override or is it new public API? If new, we need to bump the major/minor version digit now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unusable viewport in tables
3 participants