GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SwingObjectWidget: set values by string comparison by imagejan · Pull Request #87 · scijava/scijava-ui-swing

Conversation

@imagejan

@imagejan imagejan commented Mar 28, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes scijava/scijava-common#471.

Previously, we were trying to set the JComboBox value with a new instance of the object.

We don't always have the possibility to keep a list of the allowed choices for the current model, nor can we override the equals() method for the Objects of this widget instance.
So we have to fall back to comparing all combobox items to the current value by their toString() and ObjectService.getName() strings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@imagejan
SwingObjectWidget: set values by string comparison
94b0ca2
Previously, we were trying to set the JComboBox value
with a new instance of the object.

We don't always have the possibility to keep a list of the allowed
choices for the current model, nor can we override the `equals()` method
for the `Object`s of this widget instance.
So we have to fall back to comparing all combobox items to the current
value by their `toString()` and `ObjectService.getName()` strings.
@imagejan
imagejan requested a review from ctrueden March 28, 2025 15:17
@imagesc-bot

imagesc-bot commented Mar 28, 2025

Copy link
Copy Markdown

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/scijava-persist-not-working-for-enums/99827/9

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ctrueden

ctrueden commented Apr 3, 2025

Copy link
Copy Markdown
Member

This is awesome. The reason I didn't merge it instantly is because switching to string comparison over reference and/or object equality is a fundamental change in how the widgets behave, and it honestly makes me nervous that there will be unintended consequences. E.g. it's possible to have two different Datasets or ImagePluses with the same name, which will be rendered identically in the widget, which could (according to my vague intuition, without having tested yet) result in the wrong object being selected and filled in some scenarios.

So... testing needed. I hope to get to it extremely soon; I know how annoying this bug has been.

tischi reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@imagesc-bot

imagesc-bot commented Apr 3, 2025

Copy link
Copy Markdown

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/fiji-friends-weekly-dev-update-thread/103718/84

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@imagesc-bot

imagesc-bot commented Apr 21, 2025

Copy link
Copy Markdown

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/fiji-friends-weekly-dev-update-thread/103718/87

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@imagesc-bot

imagesc-bot commented May 19, 2025

Copy link
Copy Markdown

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/fiji-friends-weekly-dev-update-thread/103718/94

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@ctrueden ctrueden Awaiting requested review from ctrueden

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Persistence of enum choices in Commands

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@imagejan @imagesc-bot @ctrueden
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.