Revision 46769

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/DocumentManager.java
71 71
	/**
72 72
	 * Create a new ProjectDocument.
73 73
	 *
74
	 * @param project Opened project.
75
	 *
76 74
	 * @return ProjectDocument.
77 75
	 */
78 76
	public AbstractDocument createDocument();
......
125 123
	 * Return the main window asociated to the document.
126 124
	 * 
127 125
	 * @param doc, layout
126
         * @param layout
128 127
	 * @return Window asociated to document
129 128
	 */
130
	public IWindow getMainWindow(Document doc, WindowLayout layout) ;
129
	public IWindow getMainWindow(Document doc, WindowLayout layout);
131 130
        
131
        public boolean hasMainWindow(Document doc);
132
        
132 133
        /**
133 134
         * Create a new JComponent for the document or if already exists
134 135
         * in the specified container, return this.
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
186 186
    }
187 187

  
188 188
    @Override
189
    public boolean hasMainWindow(Document doc) {
190
        SimpleIdentityManager identityManager = ToolsLocator.getIdentityManager();
191
        if( ! identityManager.getCurrentIdentity().isAuthorized(Document.ACCESS_DOCUMENT_AUTHORIZATION, this, this.getTypeName()) ) {
192
            throw new UnauthorizedException(Document.ACCESS_DOCUMENT_AUTHORIZATION, this, this.getTypeName());
193
        }   
194
        IDocumentWindow win;
195

  
196
        win = (IDocumentWindow) PluginServices.getMDIManager().getSingletonWindow(getMainWindowClass(), doc);
197
        return win!=null;
198
    }
199

  
200
    @Override
189 201
    public IWindow getPropertiesWindow(Document doc) {
190 202
        SimpleIdentityManager identityManager = ToolsLocator.getIdentityManager();
191 203
        if( ! identityManager.getCurrentIdentity().isAuthorized(Document.ACCESS_DOCUMENT_AUTHORIZATION, this, this.getTypeName()) ) {

Also available in: Unified diff