Revision 42873 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
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 |
import org.gvsig.app.project.documents.gui.WindowLayout;
|
|
52 |
import org.gvsig.tools.ToolsLocator;
|
|
53 | 53 |
import org.gvsig.tools.dynobject.DynStruct; |
54 | 54 |
import org.gvsig.tools.extensionpoint.ExtensionBuilder; |
55 |
import org.gvsig.tools.identitymanagement.SimpleIdentityManager; |
|
56 |
import org.gvsig.tools.identitymanagement.UnauthorizedException; |
|
55 | 57 |
import org.gvsig.tools.observer.BaseNotification; |
56 | 58 |
import org.gvsig.tools.observer.Notification; |
57 | 59 |
import org.gvsig.tools.observer.Observable; |
... | ... | |
152 | 154 |
return this; |
153 | 155 |
} |
154 | 156 |
|
157 |
@Override |
|
155 | 158 |
public IWindow getMainWindow(Document doc) { |
156 | 159 |
return getMainWindow(doc, null); |
157 | 160 |
} |
161 |
|
|
162 |
@Override |
|
163 |
public IWindow getMainWindow(Document doc, WindowLayout layout) { |
|
164 |
SimpleIdentityManager identityManager = ToolsLocator.getIdentityManager(); |
|
165 |
if( ! identityManager.getCurrentIdentity().isAuthorized(Document.ACCESS_DOCUMENT_AUTHORIZATION, this, this.getTypeName()) ) { |
|
166 |
throw new UnauthorizedException(Document.ACCESS_DOCUMENT_AUTHORIZATION, this, this.getTypeName()); |
|
167 |
} |
|
168 |
IDocumentWindow win; |
|
169 |
|
|
170 |
win = (IDocumentWindow) PluginServices.getMDIManager().getSingletonWindow(getMainWindowClass(), doc); |
|
171 |
return win; |
|
172 |
} |
|
173 |
|
|
174 |
@Override |
|
175 |
public IWindow getPropertiesWindow(Document doc) { |
|
176 |
SimpleIdentityManager identityManager = ToolsLocator.getIdentityManager(); |
|
177 |
if( ! identityManager.getCurrentIdentity().isAuthorized(Document.ACCESS_DOCUMENT_AUTHORIZATION, this, this.getTypeName()) ) { |
|
178 |
throw new UnauthorizedException(Document.ACCESS_DOCUMENT_AUTHORIZATION, this, this.getTypeName()); |
|
179 |
} |
|
180 |
return null; |
|
181 |
} |
|
158 | 182 |
|
183 |
|
|
184 |
|
|
185 |
@Override |
|
159 | 186 |
public JComponent getMainComponent(Document doc) { |
160 | 187 |
ApplicationManager application = ApplicationLocator.getManager(); |
161 | 188 |
Document activeDoc = application.getActiveDocument(); |
Also available in: Unified diff