Skip to content

Conversation

@eirikbakke
Copy link
Contributor

The loadImage(URI) method was added in #8114 , as part of a broader consolidation of various icon loading methods. After seeing one log message, we see that both the nbres: and nbresloc: protocols should be handled, not just nbresloc. The difference is in whether a given file should be loaded with localization suffixes or not, per this API documentation.

The log message in question was as follows:
WARNING [org.openide.util.ImageUtilities]: loadImage(URI) called with unusual URI: nbres:/org/netbeans/modules/form/resources/palette/panel_16.png

This PR adds handling of the nbres case, and changes the handling of the nbresloc case to enable loading with localization.

A quick test of the IDE saw no new problems, including in the Matisse form builder.

@eirikbakke eirikbakke added Platform [ci] enable platform tests (platform/*) UI User Interface labels Feb 12, 2025
@eirikbakke eirikbakke requested a review from mbien February 12, 2025 20:28
@mbien mbien added this to the NB26 milestone Feb 12, 2025
Copy link
Member

@mbien mbien 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, thanks @eirikbakke!

@mbien
Copy link
Member

mbien commented Feb 12, 2025

btw good that you added the log warnings in the original PR, otherwise we probably wouldn't have noticed this ;)

@eirikbakke
Copy link
Contributor Author

True! But either way it falls back to the old method that was used to load icons from URLs. It might have missed a localization, or used a bitmap icon instead of an SVG.

@eirikbakke
Copy link
Contributor Author

eirikbakke commented Feb 12, 2025

I did see this similar log warning, but could not immediately figure out what the "ergoloc" protocol was:

WARNING [org.openide.util.ImageUtilities]: loadImage(URI) called with unusual URI: ergoloc:/org/netbeans/modules/ide/ergonomics/enterprise/org-netbeans-modules-websvc-core-client-resources-ws_client_16.png

@mbien
Copy link
Member

mbien commented Feb 12, 2025

ergoloc sounds ergonomics related. The mechanism which activates clusters when certain wizard entries are hit etc.
https://github.com/search?q=repo%3Aapache%2Fnetbeans%20ergoloc&type=code seems like it isn't used much though

@eirikbakke
Copy link
Contributor Author

Yeah, I'm just not sure whether ImageUtilities should do anything about it. We could exempt the warning message in case of an "ergoloc" protocol, but then I feel like we should know if it is actually working first...

@mbien
Copy link
Member

mbien commented Feb 13, 2025

Other than ergoloc being a strange device trying to help with back pain I don't know anything about it + it seems to be not used for icons. Lets get this PR in :)

@eirikbakke eirikbakke merged commit 6852f28 into apache:master Feb 13, 2025
32 checks passed
@eirikbakke
Copy link
Contributor Author

Thanks for reporting the log message!

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

Labels

Platform [ci] enable platform tests (platform/*) UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants