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

Dataset selector dialog fix2 #96

Merged
merged 5 commits into from
Dec 4, 2024

Conversation

xulman
Copy link
Contributor

@xulman xulman commented Nov 22, 2024

This PR adds:

  • one extra commit left over from the previous PR (sorry for that!)

  • N5Importer.runWithDialog() to import N5-ish containers always through the GUI dialog.

  • the dialog can select/highlight an item at its opening

  • the dialog enables/disables 'OK' button based on its availability

  • the 'OK' was proposed to be renamed to 'Open in Imagej'

  • the ENTER key was registered with this button

...considering the initial value, and was thus always
displaying an empty field (no text)
...run(), which already sets up a whole lot of neccesary stuff around
to actually be able to browse and later open an N5-compatible container.
The implemented way of using run() warrants that the GUI dialog is
always opened (or an exception is thrown).
...is a busy-run type of waiter until the container is fully discovered
and this dialog's tree is fully populated consequently. The waiting loop
is based on the observation that the async discovering code enables and
disables a "message bar" prior and after the discovery. So, the waiting
monitors when the "message bar" diappears. SwingUtils cannot help here.
...commands its 'selectionDialog' to potentially uncollapse parts
of its tree, and select (highlight) the item that matches the
provided path. Before looking for the right tree item/node, the
code needs to wait until the container is fully discovered and thus
the tree is populated, and the wanted item could be thus found.
- renamed to "Open in Imagej"
- is disabled if there's any tree item selected,
  or non-selectable items are clicked
- ENTER key associated with the button
@xulman
Copy link
Contributor Author

xulman commented Nov 22, 2024

@bogovicj
Copy link
Contributor

bogovicj commented Dec 4, 2024

This is great, @xulman thanks!

I'll merge this shortly - one change I will revert is to keep the button labeled "OK", the reason being that I re-use the dialog in n5-viewer and so "Open In ImageJ" would feel too specific.

We could consider making the text customizable in the future though, if you think it's useful.

@bogovicj bogovicj merged commit 1a75d6d into saalfeldlab:master Dec 4, 2024
3 checks passed
@xulman
Copy link
Contributor Author

xulman commented Dec 5, 2024

Thank you for letting this be upstream, it makes the DnD Fiji life much easier.
And, of course, totally no problem with the OK button. Thank you again.

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.

2 participants