"Copy Binding" from outside of Vision

Background: my module adds a new popup/dockable panel to the designer that displays a tree of resources (similar to the tag browser).

I’d like to be able to right click on a resource and “Copy as Vision Binding”, then be able to paste the created binding to a Vision component property (as a workflow shortcut). The created binding would be a simple expression binding with a single function call.

Using a clipboard viewer, I can see that “Copy Binding” from within Vision gives me a com.inductiveautomation.factorypmi.application.binding.interchange.PropertyBindingConfig object, which looks like just a reference to original binding location.

Is what I’m looking for possible?

Duh, I was getting a PropertyBindingConfig because I was copying a Property Binding :laughing:
If I copy an expression binding I get an ExpressionBindingConfig.

image

1 Like

For posterity’s sake:

ClipboardUtil.doCopyTransferableToClipboard(new SerializableTransferable(
                 new ExpressionBindingConfig(), BindingConfiguration.class)
);
3 Likes