Esempio n. 1
0
 public void setBinding(AbstractBinding value) {
   AbstractBinding oldValue = this.binding;
   if (oldValue == null) {
     if (value == null) {
       return; // No change
     } else {
       this.binding = value;
       unparsedBinding = value != null ? value.getStringRepresentation() : null;
       updateDependancies();
       if (bindingAttribute != null) {
         owner.notify(
             new FIBAttributeNotification<AbstractBinding>(bindingAttribute, oldValue, value));
       }
       owner.notifyBindingChanged(this);
       return;
     }
   } else {
     if (oldValue.equals(value)) {
       return; // No change
     } else {
       this.binding = value;
       unparsedBinding = value != null ? value.getStringRepresentation() : null;
       if (logger.isLoggable(Level.FINE)) {
         logger.fine("Binding takes now value " + value);
       }
       updateDependancies();
       if (bindingAttribute != null) {
         owner.notify(
             new FIBAttributeNotification<AbstractBinding>(bindingAttribute, oldValue, value));
       }
       owner.notifyBindingChanged(this);
       return;
     }
   }
 }
Esempio n. 2
0
 protected final void validate(ValidationReport report) {
   applyValidation(report);
   if (getEmbeddedObjects() != null) {
     for (FIBModelObject o : getEmbeddedObjects()) {
       o.validate(report);
     }
   }
 }
Esempio n. 3
0
 private static boolean isNameUsedInHierarchy(String aName, FIBModelObject object) {
   if (object.getName() != null && object.getName().equals(aName)) {
     return true;
   }
   if (object.getEmbeddedObjects() != null) {
     for (FIBModelObject o : object.getEmbeddedObjects()) {
       if (isNameUsedInHierarchy(aName, o)) return true;
     }
   }
   return false;
 }
Esempio n. 4
0
 private static List<FIBModelObject> retrieveObjectsWithName(
     String aName, FIBModelObject object, List<FIBModelObject> list) {
   if (object.getName() != null && object.getName().equals(aName)) {
     list.add(object);
   }
   if (object.getEmbeddedObjects() != null) {
     for (FIBModelObject o : object.getEmbeddedObjects()) {
       retrieveObjectsWithName(aName, o, list);
     }
   }
   return list;
 }
Esempio n. 5
0
 @Override
 public ValidationIssue<FIBModelObjectShouldHaveAUniqueName, FIBModelObject> applyValidation(
     FIBModelObject object) {
   if (StringUtils.isNotEmpty(object.getName())) {
     List<FIBModelObject> allObjectsWithThatName = object.getObjectsWithName(object.getName());
     if (allObjectsWithThatName.size() > 1) {
       allObjectsWithThatName.remove(object);
       GenerateUniqueName fixProposal = new GenerateUniqueName();
       ProblemIssue<FIBModelObjectShouldHaveAUniqueName, FIBModelObject> returned;
       if (object instanceof FIBWidget && ((FIBWidget) object).getManageDynamicModel()) {
         returned =
             new ValidationError<FIBModelObjectShouldHaveAUniqueName, FIBModelObject>(
                 this, object, "object_($object.toString)_has_duplicated_name", fixProposal);
       } else {
         returned =
             new ValidationWarning<FIBModelObjectShouldHaveAUniqueName, FIBModelObject>(
                 this, object, "object_($object.toString)_has_duplicated_name", fixProposal);
       }
       returned.addToRelatedValidableObjects(allObjectsWithThatName);
       return returned;
     }
   }
   return null;
 }
Esempio n. 6
0
 protected void finalizeDeserialization() {
   finalizeDeserialization(false);
   if (owner != null && hasBinding() && isValid()) {
     owner.notifyBindingChanged(this);
   }
 }