Exemplo n.º 1
0
 public ValidationIssue(V anObject, String aMessage, boolean isLocalized) {
   super();
   _object = anObject;
   _message = aMessage;
   _isLocalized = isLocalized;
   if (!isLocalized) {
     _localizedMessage = aMessage;
   }
   if (_object instanceof FlexoObservable) {
     ((FlexoObservable) _object).addObserver(this);
   }
 }
 @Override
 public void update(FlexoObservable observable, DataModification dataModification) {
   if (observable == getComponentDefinition()) {
     if (dataModification instanceof ComponentNameChanged2) {
       logger.info("Building new resource after renaming");
       ComponentGenerator generator = (ComponentGenerator) getGenerator();
       setGenerator(null);
       getCGFile().setMarkedForDeletion(true);
       generator.refreshConcernedResources();
       generator.generate(true);
       generator.getRepository().refresh();
       observable.deleteObserver(this);
       isObserverRegistered = false;
     } else if (dataModification instanceof ComponentDeleted) {
       logger.info("Handle component has been deleted");
       setGenerator(null);
       getCGFile().setMarkedForDeletion(true);
       getCGFile().getRepository().refresh();
       observable.deleteObserver(this);
       isObserverRegistered = false;
     }
   }
 }
Exemplo n.º 3
0
 public void delete() {
   if (_object instanceof FlexoObservable) {
     ((FlexoObservable) _object).deleteObserver(this);
   }
   _validationReport.removeFromValidationIssues(this);
 }