Example #1
0
  public boolean validate() {
    boolean valid = true;
    for (Entry<String, Boolean> entry : type.validate(link.getText(), null).entrySet()) {
      if (!entry.getValue().booleanValue()) {
        valid = false;
        break;
      }
    }
    if (valid) {
      refontLabel(false);
      return true;
    }

    if (useValidationGUIHints) {
      refontLabel(true);
    }
    return false;
  }
  public boolean validate() {
    boolean valid = true;
    for (Entry<String, Boolean> entry : type.validate(text.getText(), null).entrySet()) {
      if (!entry.getValue().booleanValue()) {
        valid = false;
        break;
      }
    }
    if (valid) {
      text.setForeground(fgColor);
      text.setBackground(bgColor);
      refontLabel(false);
      return true;
    }

    if (useValidationGUIHints) {
      text.setForeground(Colors.BLACK);
      text.setBackground(Colors.YELLOW);
      refontLabel(true);
    }
    return false;
  }