Context actions

Context actions allow you to add custom buttons into an algorithm’s parameter group that by default will also appear within a node’s context menu. They can be used for multiple purposes such as loading example data, applying an auto-configuration, opening websites, or displaying documentation or data in a new tab.

We do no anymore recommend the creation of context actions to implement examples. Instead, register node examples within the extension.

Example of a context action

To create one, annotate a public function with @JIPipeDocumentation and @JIPipeContextAction. The function should have one parameter: an instance of JIPipeWorkbench.

@JIPipeDocumentation(name = "Load example", description = "Loads example parameters that showcase how to use this algorithm.")
@JIPipeContextAction(iconURL = ResourceUtils.RESOURCE_BASE_PATH + "/icons/actions/graduation-cap.png")
public void setToExample(JIPipeWorkbench parent) {
    // Insert code here
}