/** * The ValidationResult's content has changed. * Updates the label's text to become the formatted text * of the new ValidationResult. */ public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(ValidationResultModel.PROPERTYNAME_RESULT)) { updateText(label, (ValidationResult) evt.getNewValue()); } }
/** * Creates and returns a label with icon and text that indicates * the validation state and displays the first message text. * * @param model the model that provides the observable validation result * @return a label with text and icon that shows the validation severity * and the first validation message text */ public static JLabel createReportIconAndTextLabel(ValidationResultModel model) { JLabel label = createReportIconLabel(model); LabelTextChangeHandler.updateText(label, model.getResult()); model.addPropertyChangeListener( ValidationResultModel.PROPERTYNAME_RESULT, new LabelTextChangeHandler(label)); return label; }
/** * Creates and returns a label with icon and text that indicates * the validation state and displays the first message text * with the highest severity. * * @param model the model that provides the observable validation result * @return a label with text and icon that shows the validation severity * and the first validation message text */ public static JLabel createReportIconAndTextLabel(ValidationResultModel model) { JLabel label = createReportIconLabel(model); LabelTextChangeHandler.updateText(label, model.getResult()); model.addPropertyChangeListener( ValidationResultModel.PROPERTY_RESULT, new LabelTextChangeHandler(label)); return label; }
/** * The ValidationResult's content has changed. * Updates the label's text to become the formatted text * of the new ValidationResult. */ @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(ValidationResultModel.PROPERTY_RESULT)) { updateText(label, (ValidationResult) evt.getNewValue()); } }