Skip to content

Commit 2d791be

Browse files
authored
Merge pull request #313 from tferr/patch-1
Fix for #239
2 parents b0c4f99 + 97edb92 commit 2d791be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/net/imagej/legacy/plugin/MacroPreprocessor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,18 @@ public void process(final Module module) {
6767
if (!ij1Helper.isMacro()) return;
6868
for (final ModuleItem<?> input : module.getInfo().inputs()) {
6969
final String name = input.getName();
70+
final Class<?> type = input.getType();
71+
if (Button.class.equals(type) || ColorTable.class.equals(type) || ItemVisibility.MESSAGE.equals(input.getVisibility())) {
72+
// resolve buttons, display messages, and color tables. For the latter a parameter
73+
// value is provided but IJM cannot do anything with it. See #239 for details
74+
module.resolveInput(name);
75+
continue;
76+
}
7077
final String value = ij1Helper.getMacroParameter(name);
7178
if (value == null) {
7279
// no macro parameter value provided
7380
continue;
7481
}
75-
final Class<?> type = input.getType();
7682
if (!convertService.supports(value, type)) {
7783
// cannot convert macro value into the input's actual type
7884
continue;

0 commit comments

Comments
 (0)