Class DynamicPropertyUtil
- java.lang.Object
-
- com.inductiveautomation.factorypmi.application.binding.util.DynamicPropertyUtil
-
public class DynamicPropertyUtil extends java.lang.Object
This class can be used to delegate the functions that a MutableDynamicPropertyProvider needs to implement.
-
-
Constructor Summary
Constructors Constructor Description DynamicPropertyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addProperty(MutableDynamicPropertyProvider thiz, DynamicPropertyDescriptor prop)
Deprecated.static void
checkRemovalLegality(DynamicPropertyProvider thiz, java.lang.String name, java.util.Collection<java.lang.String> ignoreSiblingsList)
Checks to see if it is legal to remove the named property from the given dynamic property provider.static boolean
classHasProperty(java.lang.Class clz, java.lang.String name)
static int
countDependencies(java.awt.Component component, java.lang.String propertyName)
Counts the number of interactions that are dependent on the named property of the given componentstatic void
firePropertyChange(javax.swing.JComponent parent, java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
static java.util.Set<PropertyAdapter>
getDependencies(DynamicPropertyProvider thiz, java.lang.String name, java.util.Collection<java.lang.String> ignoreSiblingsList)
Finds all property adapters that have an interaction to the given property name, ignoring adapters whose target is the given source and whose target prop name is in the ignore list.static InteractionController
getInteractionController(java.awt.Component comp)
Fetches the interaction controller given a component.static DynamicPropertyDescriptor[]
getProperties(java.util.TreeMap<java.lang.String,DynamicPropertyDescriptor> dynamicProps)
static java.lang.Class
getPropertyType(MutableDynamicPropertyProvider thiz, java.lang.String name)
static java.lang.Object
getPropertyValue(MutableDynamicPropertyProvider thiz, java.lang.String name)
static boolean
isPropertyDefined(MutableDynamicPropertyProvider thiz, java.lang.String name)
static boolean
isPropertyNameUnique(DynamicPropertyProvider thiz, DynamicPropertyDescriptor prop)
Returns true if the given property's name is unique to the property provider, checking both static and dynamic propertiesstatic java.lang.String
listToHTML(java.util.Collection<PropertyAdapter> list)
static void
removeProperty(MutableDynamicPropertyProvider thiz, java.lang.String name)
Deprecated.static void
removeProperty(MutableDynamicPropertyProvider thiz, java.lang.String name, java.util.Collection<java.lang.String> ignoreSiblingsList)
static void
setPropertyValue(MutableDynamicPropertyProvider thiz, java.lang.String name, java.lang.Object value)
protected static boolean
typesEqual(UdtDefinitionInfo a, UdtDefinitionInfo b)
-
-
-
Method Detail
-
getProperties
public static DynamicPropertyDescriptor[] getProperties(java.util.TreeMap<java.lang.String,DynamicPropertyDescriptor> dynamicProps)
-
checkRemovalLegality
public static void checkRemovalLegality(DynamicPropertyProvider thiz, java.lang.String name, java.util.Collection<java.lang.String> ignoreSiblingsList) throws java.lang.IllegalArgumentException
Checks to see if it is legal to remove the named property from the given dynamic property provider. If another component's property is bound to this property, legality fails, and an IllegalArgumentException is thrown. If legality succeeds, this function simply returns.- Parameters:
thiz
- The dynamic property provider that contains the property to removename
- The name of the property to removeignoreSiblingsList
- An optional (null-OK) list of names of properties that will also be deleted from the same property provider, so their dependencies can be ignored- Throws:
java.lang.IllegalArgumentException
-
getDependencies
public static java.util.Set<PropertyAdapter> getDependencies(DynamicPropertyProvider thiz, java.lang.String name, java.util.Collection<java.lang.String> ignoreSiblingsList)
Finds all property adapters that have an interaction to the given property name, ignoring adapters whose target is the given source and whose target prop name is in the ignore list.
-
countDependencies
public static int countDependencies(java.awt.Component component, java.lang.String propertyName)
Counts the number of interactions that are dependent on the named property of the given component
-
getInteractionController
public static InteractionController getInteractionController(java.awt.Component comp)
Fetches the interaction controller given a component. Can return null if you pass in a null component or if theBindingRoot
cannot be found in the component's ancestors.- Parameters:
comp
- The component whose ancestors we want to search for the interaction controller- Returns:
- The interaction controller for the given component's ancestor chain
-
listToHTML
public static java.lang.String listToHTML(java.util.Collection<PropertyAdapter> list)
-
removeProperty
@Deprecated public static void removeProperty(MutableDynamicPropertyProvider thiz, java.lang.String name) throws java.lang.IllegalArgumentException
Deprecated.- Throws:
java.lang.IllegalArgumentException
-
removeProperty
public static void removeProperty(MutableDynamicPropertyProvider thiz, java.lang.String name, java.util.Collection<java.lang.String> ignoreSiblingsList) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
addProperty
@Deprecated public static void addProperty(MutableDynamicPropertyProvider thiz, DynamicPropertyDescriptor prop) throws javax.naming.InvalidNameException
Deprecated.- Throws:
javax.naming.InvalidNameException
-
getPropertyValue
public static java.lang.Object getPropertyValue(MutableDynamicPropertyProvider thiz, java.lang.String name)
-
getPropertyType
public static java.lang.Class getPropertyType(MutableDynamicPropertyProvider thiz, java.lang.String name)
-
typesEqual
protected static boolean typesEqual(UdtDefinitionInfo a, UdtDefinitionInfo b)
-
setPropertyValue
public static void setPropertyValue(MutableDynamicPropertyProvider thiz, java.lang.String name, java.lang.Object value) throws java.lang.ClassCastException
- Throws:
java.lang.ClassCastException
-
firePropertyChange
public static void firePropertyChange(javax.swing.JComponent parent, java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
-
isPropertyNameUnique
public static boolean isPropertyNameUnique(DynamicPropertyProvider thiz, DynamicPropertyDescriptor prop)
Returns true if the given property's name is unique to the property provider, checking both static and dynamic properties
-
classHasProperty
public static boolean classHasProperty(java.lang.Class clz, java.lang.String name)
-
isPropertyDefined
public static boolean isPropertyDefined(MutableDynamicPropertyProvider thiz, java.lang.String name)
-
-