Revision 39483 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/DefaultProject.java
DefaultProject.java | ||
---|---|---|
1200 | 1200 |
// TODO Auto-generated method stub |
1201 | 1201 |
|
1202 | 1202 |
} |
1203 |
|
|
1204 | 1203 |
public Document getActiveDocument() { |
1204 |
return this.getActiveDocument(null); |
|
1205 |
} |
|
1206 |
|
|
1207 |
public Document getActiveDocument(Class<? extends Document> documentClass) { |
|
1205 | 1208 |
ApplicationManager application = ApplicationLocator.getManager(); |
1206 | 1209 |
|
1207 | 1210 |
Document document = null; |
... | ... | |
1217 | 1220 |
// del Model a Document |
1218 | 1221 |
try { |
1219 | 1222 |
document = (Document) ((SingletonWindow) window).getWindowModel(); |
1220 |
return document; |
|
1223 |
if( documentClass == null ) { |
|
1224 |
return document; |
|
1225 |
} |
|
1226 |
if( documentClass.isAssignableFrom(document.getClass())) { |
|
1227 |
return document; |
|
1228 |
} |
|
1221 | 1229 |
} catch (ClassCastException e) { |
1222 | 1230 |
// Do nothing, skip this window |
1223 | 1231 |
} |
Also available in: Unified diff