Class DynamicPropertyUtil


  • public class DynamicPropertyUtil
    extends java.lang.Object
    This class can be used to delegate the functions that a MutableDynamicPropertyProvider needs to implement.
    • Constructor Detail

      • DynamicPropertyUtil

        public DynamicPropertyUtil()
    • Method Detail

      • 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 remove
        name - The name of the property to remove
        ignoreSiblingsList - 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 the BindingRoot 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
      • 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)