Class BindUtilities
java.lang.Object
com.inductiveautomation.factorypmi.application.binding.util.BindUtilities
Contains various static functions used to create bindings
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
connectBindings
(BindingRoot window, TagManager manager, Expression expr, Adapter adapter, InteractionListener interactionListener) Recursively goes through the given expression, connecting all BoundVariableExpressions up with PropertyListenerDescriptors.static QueryHolder
createQueryHolder
(String query, TagManager manager, BindingRoot selectedWindow, PropertyAdapter adapter, String thisPath) static QueryHolder
createQueryHolderForTagBinding
(String query, TagManager manager, TagPath localPath) static BoundValueHolder
createValueHolder
(String expression, TagManager manager, BindingRoot selectedWindow, PropertyAdapter adapter, String thisPath) static TagPath
derelativezie
(TagPath tagPath, TagPath parentPath) Deprecated.static List<PropertyNode>
static List<PropertyNode>
static Object
getCurrentValue
(PropertyNode property) Deprecated.Use PropertyNode.getQValue().getValue() insteadstatic FeatureDescriptor
getFeatureDescriptor
(Component parent, String propName) Returns the FeatureDescriptor for the given property name on the given component or null if the property is not found.static PropertyListenerDescriptor
getPLDForPath
(BindingRoot selectedWindow, String path) Creates a new PropertyListenerDescriptor for the given path.static PropertyNode
getPropertyNode
(Component parent, FeatureDescriptor fd) Returns a PropertyNode (Dynamic or Static) for the given feature descriptor on the given componentstatic PropertyNode
getPropertyNode
(Component source, String propName, boolean onlyBindable) Finds the PropertyNode for the given component+name.static PropertyNode
getPropertyNodeForPath
(BindingRoot window, String path, boolean onlyBindable) For the given path (with or without path delimiters { and }) in the given window, returns the PropertyNode.static PropertyNode
getPropertyNodeForRelativePath
(JComponent relativeTo, String path, boolean onlyBindable) static Class
static QualifiedValue
getQValue
(Component component, FeatureDescriptor property) static boolean
static boolean
isBound
(JComponent component, String propertyName) Checks to see if the property of the given component is bound or not.static boolean
isDBBound
(JComponent component, String propertyName) Checks to see if the property of the given component has a database binding.static boolean
Returns true if the string seems to be a path (absolute OR relative).static boolean
static boolean
isPropertyDefined
(BindingRoot window, String path) static boolean
Matches something like "{$...}"static void
static ExpressionParseContext
newBinder
(BindingRoot selectedWindow, TagManager tagManager, TagPath localPath, FunctionFactory funcFactory) static void
pullCurrentValues
(PropertyAdapter adapter)
-
Field Details
-
OPEN_DELIM
- See Also:
-
CLOSE_DELIM
- See Also:
-
RELPATH_SOURCE
- See Also:
-
RELPATH_PARENT
- See Also:
-
-
Constructor Details
-
BindUtilities
public BindUtilities()
-
-
Method Details
-
addAllInteractions
-
getPropertyType
-
isBound
Checks to see if the property of the given component is bound or not. -
isBound
-
isDBBound
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 RuntimeException Deprecated.UseTagPathParser
derelativezie(TagPath, TagPath)
instead (this calls through to that).- Throws:
RuntimeException
-
newBinder
public static ExpressionParseContext newBinder(BindingRoot selectedWindow, TagManager tagManager, TagPath localPath, FunctionFactory funcFactory) -
getPLDForPath
public static PropertyListenerDescriptor getPLDForPath(BindingRoot selectedWindow, String path) throws 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:
Exception
- if it can't pull the current value for the property.
-
connectBindings
public static void connectBindings(BindingRoot window, TagManager manager, Expression expr, Adapter adapter, InteractionListener interactionListener) throws 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:
RuntimeException
-
createQueryHolderForTagBinding
public static QueryHolder createQueryHolderForTagBinding(String query, TagManager manager, TagPath localPath) throws Exception - Throws:
Exception
-
createQueryHolder
public static QueryHolder createQueryHolder(String query, TagManager manager, BindingRoot selectedWindow, PropertyAdapter adapter, String thisPath) throws Exception - Throws:
Exception
-
createValueHolder
public static BoundValueHolder createValueHolder(String expression, TagManager manager, BindingRoot selectedWindow, PropertyAdapter adapter, String thisPath) throws Exception - Throws:
Exception
-
getBoundProperties
-
getAllProperties
-
isPropertyBindable
-
main
-
isPropertyDefined
-
isPath
Returns true if the string seems to be a path (absolute OR relative). Simply checks if the string starts with { and ends with } -
isRelativePath
Matches something like "{$...}" -
getPropertyNodeForPath
public static PropertyNode getPropertyNodeForPath(BindingRoot window, String path, boolean onlyBindable) throws 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 propertyonlyBindable
- If true, only bindable properties will be considered- Throws:
RuntimeException
-
getPropertyNodeForRelativePath
public static PropertyNode getPropertyNodeForRelativePath(JComponent relativeTo, String path, boolean onlyBindable) throws RuntimeException - Throws:
RuntimeException
-
getPropertyNode
public static PropertyNode getPropertyNode(Component source, String propName, boolean onlyBindable) throws 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:
RuntimeException
-
getCurrentValue
Deprecated.Use PropertyNode.getQValue().getValue() instead- Throws:
Exception
-
getQValue
public static QualifiedValue getQValue(Component component, FeatureDescriptor property) throws Exception - Throws:
Exception
-
pullCurrentValues
-
getFeatureDescriptor
Returns the FeatureDescriptor for the given property name on the given component or null if the property is not found. -
getPropertyNode
Returns a PropertyNode (Dynamic or Static) for the given feature descriptor on the given component
-