Class DefaultTagDropHandler
java.lang.Object
com.inductiveautomation.factorypmi.designer.beaninfo.tags.AbstractBindingTagDropHandler
com.inductiveautomation.factorypmi.designer.beaninfo.tags.DefaultTagDropHandler
- All Implemented Interfaces:
TagDropHandler
- Direct Known Subclasses:
TextComponentTagDropHandler
A TagDropHandler that has a framework to install property bindings between the target component and the dropped tag
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
static interface
Provides a simple mechanism for adding a SimpleBoundTagAdapter binding on a componentstatic class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBinding
(Property<?> prop, DefaultTagDropHandler.BindConfiguration desc) void
addBinding
(Property<?> prop, String propName) Adds a binding configuration to bind the given component property to the given tag property.void
addBinding
(Property<?> prop, String propName, boolean forceNonBinding) void
addOneWayBinding
(Property<?> prop, String propName) createBasicBindConfig
(String propName, boolean forceNonBinding) boolean
handleDrop
(DesignerContext context, List<NodeBrowseInfo> nodes, JComponent bean, DropTargetDropEvent dropEvent) Adds property bindings according to this handler's binding map.protected boolean
handlePropertyPathDrop
(DesignerContext context, NodeBrowseInfo node, JComponent bean) This is called when the drop is an attribute path that isn't the Value propertyprotected boolean
handleValueDrop
(DesignerContext context, NodeBrowseInfo node, JComponent bean) This is used to handle most drops.protected boolean
processBinding
(DesignerContext context, NodeBrowseInfo node, JComponent bean, DefaultTagDropHandler.BindConfiguration desc) This is called for each binding defined if the drop is a standard tag drop, except for the Value propertyprotected boolean
processBinding
(DesignerContext context, TagPath path, Property<?> property, JComponent bean, String propName, boolean nonBidirectional) Convenience function for drop handlers that subvert the normal way of doing things to do a quick bindingprotected boolean
processValueBinding
(DesignerContext context, NodeBrowseInfo tag, JComponent bean, DefaultTagDropHandler.BindConfiguration desc) This is called for the value property path for a standard tag drop.void
removeBinding
(Property<?> prop) Methods inherited from class com.inductiveautomation.factorypmi.designer.beaninfo.tags.AbstractBindingTagDropHandler
findController, findProperty
-
Constructor Details
-
DefaultTagDropHandler
-
-
Method Details
-
addBinding
Adds a binding configuration to bind the given component property to the given tag property. Binding will be bidirectional if the property -
addOneWayBinding
-
addBinding
-
createBasicBindConfig
public DefaultTagDropHandler.BindConfiguration createBasicBindConfig(String propName, boolean forceNonBinding) -
addBinding
-
removeBinding
-
handleDrop
public boolean handleDrop(DesignerContext context, List<NodeBrowseInfo> nodes, JComponent bean, DropTargetDropEvent dropEvent) Adds property bindings according to this handler's binding map. If the dropped tag is for a TagProp other than Value, then that property is used as the value and no other bindings are processed- Returns:
- a boolean indicating whether or not the drop was successfully handled.
-
handleValueDrop
This is used to handle most drops. If this is called, you are guaranteed that path is a non-null, non-folder, value property tag path. The default implementation adds simple tag bindings that were defined through calls to addBinding() -
handlePropertyPathDrop
protected boolean handlePropertyPathDrop(DesignerContext context, NodeBrowseInfo node, JComponent bean) This is called when the drop is an attribute path that isn't the Value property -
processValueBinding
protected boolean processValueBinding(DesignerContext context, NodeBrowseInfo tag, JComponent bean, DefaultTagDropHandler.BindConfiguration desc) This is called for the value property path for a standard tag drop. The default simply calls processPropertyBinding. (treats value like any other binding) -
processBinding
protected boolean processBinding(DesignerContext context, NodeBrowseInfo node, JComponent bean, DefaultTagDropHandler.BindConfiguration desc) This is called for each binding defined if the drop is a standard tag drop, except for the Value property -
processBinding
protected boolean processBinding(DesignerContext context, TagPath path, Property<?> property, JComponent bean, String propName, boolean nonBidirectional) Convenience function for drop handlers that subvert the normal way of doing things to do a quick binding
-