コード例 #1
0
 private void addToAllValidIfNeeded(E element) {
   if (allValid != null) {
     if (element instanceof Property<?>) {
       allValid.add((Property<?>) element);
     } else if (element instanceof Model) {
       allValid.add(((Model) element).allValid());
     }
   }
 }
コード例 #2
0
 private void removeFromAllValidIfNeeded(E element) {
   if (allValid != null) {
     if (element instanceof Property<?>) {
       allValid.remove((Property<?>) element);
     } else if (element instanceof Model) {
       allValid.remove(((Model) element).allValid());
     }
   }
 }
コード例 #3
0
 /**
  * @return a property that, if we contain properties or models, will be true if all contains
  *     properties/models (as well as ourself) are valid.
  */
 public Property<Boolean> allValid() {
   if (allValid == null) {
     allValid = new PropertyGroup(getValueObject().getName() + ".allValid");
     allValid.add(this);
     for (E element : getDirect()) {
       addToAllValidIfNeeded(element);
     }
   }
   return allValid;
 }