Uh oh!
There was an error while loading. Please reload this page.
Add WidgetStyle utility class to centralize style logic - #384
Conversation
9f48d17 to
655d08cCompareThis should replace isStyle() implementations and other case logic around (possibly multiple) style attributes of parameters. Also add a test exercising this utility class.
imagejan
commented
Oct 30, 2020
Thanks @ctrueden for merging this. Now that |
ctrueden
commented
Oct 30, 2020
If we change it immediately, I'd be OK with breaking it. It's not part of pom-scijava et al. yet. |
This pull request addresses #333 and is a first step toward fixing #197 and #382.
The methods in the new
WidgetStyleutility class should replaceisStyle()implementations and other case logic around (possibly multiple) style attributes of parameters in the following places:scijava-ui-swing:chooseFileandchooseFilesinAbstractSwingUIcreateFileFilterinSwingFileWidgetSwingChoiceRadioWidgetbatch-processor:getTargetWidgetStyleinFileBatchInputProviderimagej-plugins-batch:getTargetWidgetStyleinDatasetBatchInputProviderhere in
imagej-legacy, and finallysome places in
scijava-ui-awt, and threetimes inscijava-ui-pivotRemaining questions:
I wasn't sure about the naming of
getStyleModifiers. The intended use case is for styles like"extensions:tiff/tif"to get the list of allowed extensions, but there might be more general use cases.Should
getStyleModifiersreturn an array of strings directly fromsplit("/")? Or rather aSet<String>with trimmed, lower-case values?