Class DynamicPropertyUtil
java.lang.Object
com.inductiveautomation.factorypmi.application.binding.util.DynamicPropertyUtil
This class can be used to delegate the functions that a MutableDynamicPropertyProvider needs to implement.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Deprecated.static void
checkRemovalLegality
(DynamicPropertyProvider thiz, String name, Collection<String> ignoreSiblingsList) Checks to see if it is legal to remove the named property from the given dynamic property provider.static boolean
classHasProperty
(Class clz, String name) static int
countDependencies
(Component component, String propertyName) Counts the number of interactions that are dependent on the named property of the given componentstatic void
firePropertyChange
(JComponent parent, String name, Object oldValue, Object newValue) static Set<PropertyAdapter>
getDependencies
(DynamicPropertyProvider thiz, String name, Collection<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
Fetches the interaction controller given a component.static DynamicPropertyDescriptor[]
getProperties
(TreeMap<String, DynamicPropertyDescriptor> dynamicProps) static Class
getPropertyType
(MutableDynamicPropertyProvider thiz, String name) static Object
getPropertyValue
(MutableDynamicPropertyProvider thiz, String name) static boolean
isPropertyDefined
(MutableDynamicPropertyProvider thiz, String name) static boolean
Returns true if the given property's name is unique to the property provider, checking both static and dynamic propertiesstatic String
listToHTML
(Collection<PropertyAdapter> list) static void
removeProperty
(MutableDynamicPropertyProvider thiz, String name) Deprecated.static void
removeProperty
(MutableDynamicPropertyProvider thiz, String name, Collection<String> ignoreSiblingsList) static void
setPropertyValue
(MutableDynamicPropertyProvider thiz, String name, Object value) protected static boolean
-
Constructor Details
-
DynamicPropertyUtil
public DynamicPropertyUtil()
-
-
Method Details
-
getProperties
public static DynamicPropertyDescriptor[] getProperties(TreeMap<String, DynamicPropertyDescriptor> dynamicProps) -
checkRemovalLegality
public static void checkRemovalLegality(DynamicPropertyProvider thiz, String name, Collection<String> ignoreSiblingsList) throws 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:
IllegalArgumentException
-
getDependencies
public static Set<PropertyAdapter> getDependencies(DynamicPropertyProvider thiz, String name, Collection<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
Counts the number of interactions that are dependent on the named property of the given component -
getInteractionController
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
-
removeProperty
@Deprecated public static void removeProperty(MutableDynamicPropertyProvider thiz, String name) throws IllegalArgumentException Deprecated.- Throws:
IllegalArgumentException
-
removeProperty
public static void removeProperty(MutableDynamicPropertyProvider thiz, String name, Collection<String> ignoreSiblingsList) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
addProperty
@Deprecated public static void addProperty(MutableDynamicPropertyProvider thiz, DynamicPropertyDescriptor prop) throws InvalidNameException Deprecated.- Throws:
InvalidNameException
-
getPropertyValue
-
getPropertyType
-
typesEqual
-
setPropertyValue
public static void setPropertyValue(MutableDynamicPropertyProvider thiz, String name, Object value) throws ClassCastException - Throws:
ClassCastException
-
firePropertyChange
public static void firePropertyChange(JComponent parent, String name, Object oldValue, 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
-
isPropertyDefined
-