Revision 41634 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/AbstractDocumentManager.java

View differences:

AbstractDocumentManager.java
48 48
import org.gvsig.app.project.DocumentsContainer;
49 49
import org.gvsig.app.project.Project;
50 50
import org.gvsig.app.project.documents.gui.IDocumentWindow;
51
import org.gvsig.app.project.documents.view.ViewDocument;
52
import org.gvsig.app.project.documents.view.gui.IView;
51 53
import org.gvsig.tools.dynobject.DynStruct;
52 54
import org.gvsig.tools.extensionpoint.ExtensionBuilder;
55
import org.gvsig.tools.observer.BaseNotification;
56
import org.gvsig.tools.observer.Notification;
53 57
import org.gvsig.tools.observer.Observable;
54 58
import org.gvsig.tools.observer.Observer;
59
import org.gvsig.tools.observer.impl.DelegateWeakReferencingObservable;
55 60
import org.gvsig.tools.persistence.PersistenceManager;
56 61
import org.gvsig.tools.persistence.PersistentState;
57 62
import org.gvsig.tools.persistence.exception.PersistenceException;
......
70 75

  
71 76
    
72 77
    private Map<String, JComponent> mainComponents = new HashMap<String, JComponent>();
78

  
79
    private DelegateWeakReferencingObservable observableHelper = null;
80

  
81
    protected AbstractDocumentManager() {
82
        this.observableHelper = new DelegateWeakReferencingObservable(this);
83
    }
73 84
    
74 85
    /**
75 86
     * Returns the type of document priority.
......
316 327
        // Do nothing
317 328
    }
318 329
    
330

  
331
    public void addObserver(Observer o) {
332
        this.observableHelper.addObserver(o);
333
    }
334

  
335
    public void deleteObserver(Observer o) {
336
        this.observableHelper.deleteObserver(o);
337
    }
338

  
339
    public void deleteObservers() {
340
        this.observableHelper.deleteObservers();
341
    }
319 342
    
343
    protected Notification notifyObservers(String type, Document doc) {
344
        Notification notification = new BaseNotification(type, new Object[] {doc});
345
        this.observableHelper.notifyObservers(notification);
346
        return notification;
347
    }
348

  
349
    protected Notification notifyObservers(String type, IWindow doc) {
350
        Notification notification = new BaseNotification(type, new Object[] {doc});
351
        this.observableHelper.notifyObservers(notification);
352
        return notification;
353
    }
320 354
}

Also available in: Unified diff