Class BindUtilities
- java.lang.Object
- 
- com.inductiveautomation.factorypmi.application.binding.util.BindUtilities
 
- 
 public class BindUtilities extends java.lang.ObjectContains various static functions used to create bindings
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringCLOSE_DELIMstatic java.lang.StringOPEN_DELIMstatic java.lang.StringRELPATH_PARENTstatic java.lang.StringRELPATH_SOURCE
 - 
Constructor SummaryConstructors Constructor Description BindUtilities()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddAllInteractions(Expression e, java.util.List<InteractionDescriptor> list)static voidconnectBindings(BindingRoot window, TagManager manager, Expression expr, Adapter adapter, InteractionListener interactionListener)Recursively goes through the given expression, connecting all BoundVariableExpressions up with PropertyListenerDescriptors.static QueryHoldercreateQueryHolder(java.lang.String query, TagManager manager, BindingRoot selectedWindow, PropertyAdapter adapter, java.lang.String thisPath)static QueryHoldercreateQueryHolderForTagBinding(java.lang.String query, TagManager manager, TagPath localPath)static BoundValueHoldercreateValueHolder(java.lang.String expression, TagManager manager, BindingRoot selectedWindow, PropertyAdapter adapter, java.lang.String thisPath)static TagPathderelativezie(TagPath tagPath, TagPath parentPath)Deprecated.static java.util.List<PropertyNode>getAllProperties(java.lang.Object o)static java.util.List<PropertyNode>getBoundProperties(java.lang.Object o)static java.lang.ObjectgetCurrentValue(PropertyNode property)Deprecated.Use PropertyNode.getQValue().getValue() insteadstatic java.beans.FeatureDescriptorgetFeatureDescriptor(java.awt.Component parent, java.lang.String propName)Returns the FeatureDescriptor for the given property name on the given component or null if the property is not found.static PropertyListenerDescriptorgetPLDForPath(BindingRoot selectedWindow, java.lang.String path)Creates a new PropertyListenerDescriptor for the given path.static PropertyNodegetPropertyNode(java.awt.Component parent, java.beans.FeatureDescriptor fd)Returns a PropertyNode (Dynamic or Static) for the given feature descriptor on the given componentstatic PropertyNodegetPropertyNode(java.awt.Component source, java.lang.String propName, boolean onlyBindable)Finds the PropertyNode for the given component+name.static PropertyNodegetPropertyNodeForPath(BindingRoot window, java.lang.String path, boolean onlyBindable)For the given path (with or without path delimiters { and }) in the given window, returns the PropertyNode.static PropertyNodegetPropertyNodeForRelativePath(javax.swing.JComponent relativeTo, java.lang.String path, boolean onlyBindable)static java.lang.ClassgetPropertyType(java.beans.FeatureDescriptor fd)static QualifiedValuegetQValue(java.awt.Component component, java.beans.FeatureDescriptor property)static booleanisBound(java.lang.String s)static booleanisBound(javax.swing.JComponent component, java.lang.String propertyName)Checks to see if the property of the given component is bound or not.static booleanisDBBound(javax.swing.JComponent component, java.lang.String propertyName)Checks to see if the property of the given component has a database binding.static booleanisPath(java.lang.String s)Returns true if the string seems to be a path (absolute OR relative).static booleanisPropertyBindable(java.beans.FeatureDescriptor fd)static booleanisPropertyDefined(BindingRoot window, java.lang.String path)static booleanisRelativePath(java.lang.String s)Matches something like "{$...}"static voidmain(java.lang.String[] args)static ExpressionParseContextnewBinder(BindingRoot selectedWindow, TagManager tagManager, TagPath localPath, FunctionFactory funcFactory)static voidpullCurrentValues(PropertyAdapter adapter)
 
- 
- 
- 
Field Detail- 
OPEN_DELIMpublic static final java.lang.String OPEN_DELIM - See Also:
- Constant Field Values
 
 - 
CLOSE_DELIMpublic static final java.lang.String CLOSE_DELIM - See Also:
- Constant Field Values
 
 - 
RELPATH_SOURCEpublic static final java.lang.String RELPATH_SOURCE - See Also:
- Constant Field Values
 
 - 
RELPATH_PARENTpublic static final java.lang.String RELPATH_PARENT - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
addAllInteractionspublic static void addAllInteractions(Expression e, java.util.List<InteractionDescriptor> list) 
 - 
getPropertyTypepublic static java.lang.Class getPropertyType(java.beans.FeatureDescriptor fd) 
 - 
isBoundpublic static boolean isBound(javax.swing.JComponent component, java.lang.String propertyName)Checks to see if the property of the given component is bound or not.
 - 
isBoundpublic static boolean isBound(java.lang.String s) 
 - 
isDBBoundpublic static boolean isDBBound(@Nonnull javax.swing.JComponent component, @Nonnull java.lang.String propertyName)Checks to see if the property of the given component has a database binding. Used by Edge to check if db binding should show for a component.
 - 
derelativezie@Deprecated public static TagPath derelativezie(TagPath tagPath, TagPath parentPath) throws java.lang.RuntimeException Deprecated.UseTagPathParserderelativezie(TagPath, TagPath)instead (this calls through to that).- Throws:
- java.lang.RuntimeException
 
 - 
newBinderpublic static ExpressionParseContext newBinder(BindingRoot selectedWindow, TagManager tagManager, TagPath localPath, FunctionFactory funcFactory) 
 - 
getPLDForPathpublic static PropertyListenerDescriptor getPLDForPath(BindingRoot selectedWindow, java.lang.String path) throws java.lang.Exception Creates a new PropertyListenerDescriptor for the given path. Only the initial value, source component, and source property will be configured on the PLD- Throws:
- java.lang.Exception- if it can't pull the current value for the property.
 
 - 
connectBindingspublic static void connectBindings(BindingRoot window, TagManager manager, Expression expr, Adapter adapter, InteractionListener interactionListener) throws java.lang.RuntimeException Recursively goes through the given expression, connecting all BoundVariableExpressions up with PropertyListenerDescriptors. Multiple BVEs that share the same path will share one PLD, so that an expression isn't re-evaluated multiple times for one property change event from component.- Throws:
- java.lang.RuntimeException
 
 - 
createQueryHolderForTagBindingpublic static QueryHolder createQueryHolderForTagBinding(java.lang.String query, TagManager manager, TagPath localPath) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
createQueryHolderpublic static QueryHolder createQueryHolder(java.lang.String query, TagManager manager, BindingRoot selectedWindow, PropertyAdapter adapter, java.lang.String thisPath) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
createValueHolderpublic static BoundValueHolder createValueHolder(java.lang.String expression, TagManager manager, BindingRoot selectedWindow, PropertyAdapter adapter, java.lang.String thisPath) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
getBoundPropertiespublic static java.util.List<PropertyNode> getBoundProperties(java.lang.Object o) 
 - 
getAllPropertiespublic static java.util.List<PropertyNode> getAllProperties(java.lang.Object o) 
 - 
isPropertyBindablepublic static boolean isPropertyBindable(java.beans.FeatureDescriptor fd) 
 - 
mainpublic static void main(java.lang.String[] args) 
 - 
isPropertyDefinedpublic static boolean isPropertyDefined(BindingRoot window, java.lang.String path) 
 - 
isPathpublic static boolean isPath(java.lang.String s) Returns true if the string seems to be a path (absolute OR relative). Simply checks if the string starts with { and ends with }
 - 
isRelativePathpublic static boolean isRelativePath(java.lang.String s) Matches something like "{$...}"
 - 
getPropertyNodeForPathpublic static PropertyNode getPropertyNodeForPath(BindingRoot window, java.lang.String path, boolean onlyBindable) throws java.lang.RuntimeException For the given path (with or without path delimiters { and }) in the given window, returns the PropertyNode.- Parameters:
- window- The window in which the path resides. Throws a RuntimeException if the path isn't valid.
- path- The path to the property
- onlyBindable- If true, only bindable properties will be considered
- Throws:
- java.lang.RuntimeException
 
 - 
getPropertyNodeForRelativePathpublic static PropertyNode getPropertyNodeForRelativePath(javax.swing.JComponent relativeTo, java.lang.String path, boolean onlyBindable) throws java.lang.RuntimeException - Throws:
- java.lang.RuntimeException
 
 - 
getPropertyNodepublic static PropertyNode getPropertyNode(java.awt.Component source, java.lang.String propName, boolean onlyBindable) throws java.lang.RuntimeException Finds the PropertyNode for the given component+name. If the property doesn't exist, a RuntimeException is thrown.- Parameters:
- source- The component to look for the property on.
- propName- The name of the property. Can be in the format "name:path.to.subprop" for UDT sub-properties.
- onlyBindable- If true, only bindable properties will be accepted.
- Throws:
- java.lang.RuntimeException
 
 - 
getCurrentValue@Deprecated public static java.lang.Object getCurrentValue(PropertyNode property) throws java.lang.Exception Deprecated.Use PropertyNode.getQValue().getValue() instead- Throws:
- java.lang.Exception
 
 - 
getQValuepublic static QualifiedValue getQValue(java.awt.Component component, java.beans.FeatureDescriptor property) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
pullCurrentValuespublic static void pullCurrentValues(PropertyAdapter adapter) 
 - 
getFeatureDescriptorpublic static java.beans.FeatureDescriptor getFeatureDescriptor(java.awt.Component parent, java.lang.String propName)Returns the FeatureDescriptor for the given property name on the given component or null if the property is not found.
 - 
getPropertyNodepublic static PropertyNode getPropertyNode(java.awt.Component parent, java.beans.FeatureDescriptor fd) Returns a PropertyNode (Dynamic or Static) for the given feature descriptor on the given component
 
- 
 
-