03-04-2019 11:04 AM
I have a snap, that I have developed, for which I would like to add the “Execute during preview” capability.
Can anyone provide me with java code capable of accomplishing this? I do not need the code to create the UI feature, property or variable. I just need the code to determine whether the execution process is in the validation or run-time mode.
TIA,
– Del
Solved! Go to Solution.
03-04-2019 12:08 PM
@del adding @Category(snap = SnapCategory.WRITE)
to the class definition will automatically expose the “Execute during preview” checkbox. As @rohithmadhavan stated, behavior can be customized with SuggestExecutionProvider
.
See Snap Development Documentation and Snap Development Documentation
05-26-2020 11:09 AM
Hi JiWon,
I’m not sure exactly what you’re asking. If you want to know how to define a checkbox property in a custom snap, you’d have code something like this in your defineProperties method:
propertyBuilder.describe("name", "label", "description")
.type(SnapType.BOOLEAN)
.defaultValue(true)
.add();
05-29-2020 01:45 AM
Thanks ptaylor 🙂
05-26-2020 11:36 AM
Hi @JiWon,
The solution for me was Robin’s response above. I’ve highlighted the necessary code here (in context):