Exemplo 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());
      }
    }
  }
Exemplo n.º 2
0
 /** Sets BackgroundColor of this entry */
 public void setBackground(Color color) {
   if (moneyField != null) {
     moneyField.setBackground(color);
     currencyLabel.setBackground(color);
   }
 }