โ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
โ03-04-2019 11:19 AM
Youโll need to implement SuggestExecutionProvider
and override the executeForSuggest
method for โexecutingโ during validation.
Since you donโt need the โExecute during previewโ property, the easiest approach will be to call the execute
method within executeForSuggest
as follows:
@Override
public void executeForSuggest() {
execute();
}
โ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
โ03-04-2019 12:56 PM
Thank you very much for your lighting-speed responses @rohithmadhavan and @robin.
I started on @rohithmadhavanโs suggestion first and the path was very educational for me as I started to implement it. However, my question was vague in detail, and a little misdirecting, so @robinโs response was the simpler solution I was looking for. Iโve developed 4 simple snaps, but none were write snaps, so that answer was not yet obvious to me.
Itโs now working like a charm, so thank you both very much!
โ Del
โ05-25-2020 05:48 AM
Can you please share how did you create that checkbox UI feature for a custom snap by sharing the codes?
Thank you