/** * 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; }