/** * Traverses a component tree and sets the severity for all text components. * The iteration starts at the given container. If a validation result is * associated with a component, the result's severity is set. Otherwise * the severity is set to {@code null}. The severity is set using * {@link #setSeverity(JComponent, Severity)}.<p> * * Before you use this method, associate components with validation * messages using {@link #setMessageKey(JComponent, Object)}. * * @param container the component tree root * @param result the validation result that provides the associated messages * * @see #setSeverity(JComponent, Severity) */ public static void updateComponentTreeSeverity(Container container, ValidationResult result) { visitComponentTree(container, result.keyMap(), new SeverityVisitor()); }
/** * Traverses a component tree and sets the severity for all text components. * The iteration starts at the given container. If a validation result is * associated with a component, the result's severity is set. Otherwise * the severity is set to {@code null}. The severity is set using * {@link #setSeverity(JComponent, Severity)}.<p> * * Before you use this method, associate components with validation * messages using {@link #setMessageKey(JComponent, Object)}. * * @param container the component tree root * @param result the validation result that provides the associated messages * * @see #setSeverity(JComponent, Severity) */ public static void updateComponentTreeSeverity(Container container, ValidationResult result) { visitComponentTree(container, result.keyMap(), new SeverityVisitor()); }