Ejemplo n.º 1
0
  /** Check mandatory and isEditable to set color settings. */
  protected void performFlags() {
    Assert.isNotNull(moneyField);
    Assert.isNotNull(flagLabel);

    if (isReadonly()) {
      moneyField.setBackground(SystemColor.control);
      flagLabel.setIcon(GUI.getOptionalIcon());
    } else {
      // @todo find appropriate system color
      moneyField.setBackground(Color.white);

      if (mandatory && getObjectValue() == null) {
        flagLabel.setIcon(GUI.getMandatoryIcon());
      } else {
        flagLabel.setIcon(GUI.getOptionalIcon());
      }
    }
  }