/** * The ValidationResult's severity has changed. * Updates the label's visibility and icon. */ @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(ValidationResultModel.PROPERTY_SEVERITY)) { updateVisibilityAndIcon(label, (Severity) evt.getNewValue()); } }
/** * Creates and returns an icon label that indicates the validation severity. * A handler updates the label's visibility and icon each time the severity * of the given validation result model changes. * * @param model the model that provides the observable validation result * @return a label with an icon that presents the validation severity */ public static JLabel createReportIconLabel(ValidationResultModel model) { JLabel label = new JLabel(); LabelIconChangeHandler.updateVisibilityAndIcon(label, model.getSeverity()); model.addPropertyChangeListener( ValidationResultModel.PROPERTY_SEVERITY, new LabelIconChangeHandler(label)); return label; }
/** * Creates and returns an icon label that indicates the validation severity. * A handler updates the label's visibility and icon each time the severity * of the given validation result model changes. * * @param model the model that provides the observable validation result * @return a label with an icon that presents the validation severity */ public static JLabel createReportIconLabel(ValidationResultModel model) { JLabel label = new JLabel(); LabelIconChangeHandler.updateVisibilityAndIcon(label, model.getSeverity()); model.addPropertyChangeListener( ValidationResultModel.PROPERTYNAME_SEVERITY, new LabelIconChangeHandler(label)); return label; }
/** * The ValidationResult's severity has changed. * Updates the label's visibility and icon. */ public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(ValidationResultModel.PROPERTYNAME_SEVERITY)) { updateVisibilityAndIcon(label, (Severity) evt.getNewValue()); } }