Class WizardStateDependencyValidator<T>


  • public class WizardStateDependencyValidator<T>
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDependency​(T dependent, T predecessor)
      Registers a dependency from one property state to another.
      java.util.Set<T> findAffectedDependants​(WizardState<T> globalState)
      Returns a set of all property keys that need to have their values set because a predecessor property has been changed that may affect the valid values for this property.
      void updatePropertyValues​(WizardState<T> globalState)
      Updates the local cache values for all the relevant properties.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WizardStateDependencyValidator

        public WizardStateDependencyValidator()
    • Method Detail

      • addDependency

        public void addDependency​(T dependent,
                                  T predecessor)
        Registers a dependency from one property state to another. If the predecessor is null, then the dependent is registered such that a call to findAffectedDependants(WizardState) will include that property key only if its cached value is null. (i.e. the first time it is called.)
        Parameters:
        dependent - the property key that depends on a previous property being set.
        predecessor - the property key of the property that affects the dependent property.
      • findAffectedDependants

        public java.util.Set<T> findAffectedDependants​(WizardState<T> globalState)
        Returns a set of all property keys that need to have their values set because a predecessor property has been changed that may affect the valid values for this property. Also, any property keys that don't have a value in the local cache will be returned.
        Parameters:
        globalState - the global WizardState that is passed from one wizard panel to the next.
        Returns:
        the set of property keys whose values should be (re)computed.
      • updatePropertyValues

        public void updatePropertyValues​(WizardState<T> globalState)
        Updates the local cache values for all the relevant properties. This method should be called from a wizard panel when the "next" action is invoked (i.e. the user values have been accepted).
        Parameters:
        globalState - The WizardState containing all the property values.