@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;
     }
   }
 }
Ejemplo n.º 2
0
 public void delete() {
   if (_object instanceof FlexoObservable) {
     ((FlexoObservable) _object).deleteObserver(this);
   }
   _validationReport.removeFromValidationIssues(this);
 }