We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, these two parameter declarations behave differently:
#@ File[] (style="files,extensions:xls/xlsx") files
and
#@ File[] (style="files, extensions:xls/xlsx") files
The latter ignores the file extension filter because after splitting, the style string has a leading space.
Let's fix this by changing style.split(",") to style.trim().split("\\s*,\\s*") in all places where it is relevant:
style.split(",")
style.trim().split("\\s*,\\s*")
scijava-common:
scijava-common
scijava-common/src/main/java/org/scijava/widget/DefaultWidgetModel.java
Line 133 in 821c829
scijava-ui-swing: https://github.com/scijava/scijava-ui-swing/blob/d0802b1a09d380898f77022b4010682cf330fc28/src/main/java/org/scijava/ui/swing/widget/SwingFileWidget.java#L210
scijava-ui-swing
imagej-legacy: https://github.com/imagej/imagej-legacy/blob/325fd0933778dabd6ee8c09867961c698ffe945c/src/main/java/net/imagej/legacy/plugin/MacroRecorderPostprocessor.java#L95
imagej-legacy
The text was updated successfully, but these errors were encountered:
Safeguard against null style arg in UserInterface#chooseFile
e6e1fe9
This fixes the issue reported by @kephale on the forum, where the absence of a style attribute on a File parameter leads to a NullPointerException: https://forum.image.sc/t/error-for-file-type-imagej2-parameter/25585 This commit is a quick fix, it should probably be rewritten when addressing issue #333
Let's make a utility method (in a new WidgetStyle class, perhaps?) to handle this in a unified way?
WidgetStyle
Sorry, something went wrong.
@ctrueden do we want to be case-insensitive when testing style attributes (i.e. allowing all of message, MESSAGE and mEsSaGe)?
style
message
MESSAGE
mEsSaGe
imagejan
No branches or pull requests
Currently, these two parameter declarations behave differently:
and
The latter ignores the file extension filter because after splitting, the style string has a leading space.
Let's fix this by changing
style.split(",")
tostyle.trim().split("\\s*,\\s*")
in all places where it is relevant:scijava-common
:scijava-common/src/main/java/org/scijava/widget/DefaultWidgetModel.java
Line 133 in 821c829
scijava-ui-swing
:https://github.com/scijava/scijava-ui-swing/blob/d0802b1a09d380898f77022b4010682cf330fc28/src/main/java/org/scijava/ui/swing/widget/SwingFileWidget.java#L210
imagej-legacy
:https://github.com/imagej/imagej-legacy/blob/325fd0933778dabd6ee8c09867961c698ffe945c/src/main/java/net/imagej/legacy/plugin/MacroRecorderPostprocessor.java#L95
The text was updated successfully, but these errors were encountered: