/** * 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()); }
/** * Traverses a component tree and sets the text component backgrounds * according to the severity of an associated validation result - if any. * The iteration starts at the given container.<p> * * The message keys used to associate components with validation messages * should be set using {@link #setMessageKey(JComponent, Object)} before * you call this method. * * @param container the component tree root * @param result the validation result used to lookup the severities * * @see #setMandatory(JComponent, boolean) * @see #setMessageKey(JComponent, Object) * @see #setMandatoryBackground(JTextComponent) * @see #setErrorBackground(JTextComponent) * @see #setWarningBackground(JTextComponent) * * @since 1.0.2 */ public static void updateComponentTreeSeverityBackground( Container container, ValidationResult result) { visitComponentTree(container, result.keyMap(), new SeverityBackgroundVisitor()); }
/** * Traverses a component tree and sets the text component backgrounds * according to the severity of an associated validation result - if any. * The iteration starts at the given container.<p> * * The message keys used to associate components with validation messages * should be set using {@link #setMessageKey(JComponent, Object)} before * you call this method. * * @param container the component tree root * @param result the validation result used to lookup the severities * * @see #setMandatory(JComponent, boolean) * @see #setMessageKey(JComponent, Object) * @see #setMandatoryBackground(JTextComponent) * @see #setErrorBackground(JTextComponent) * @see #setWarningBackground(JTextComponent) * * @since 1.0.2 */ public static void updateComponentTreeSeverityBackground( Container container, ValidationResult result) { visitComponentTree(container, result.keyMap(), new SeverityBackgroundVisitor()); }
private void updateFeedbackComponents() { removeAllFeedbackComponents(); visitComponentTree(content, model.getResult().keyMap(), 0, 0); repaint(); }