* @generated
*/
protected void setDocumentContent(IDocument document, IEditorInput element)
throws CoreException {
IDiagramDocument diagramDocument = (IDiagramDocument) document;
TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
if (element instanceof FileEditorInput) {
IStorage storage = ((FileEditorInput) element).getStorage();
Diagram diagram = DiagramIOUtil.load(domain, storage, true,
getProgressMonitor());
document.setContent(diagram);
} else if (element instanceof URIEditorInput) {
URI uri = ((URIEditorInput) element).getURI();
Resource resource = null;
try {
resource = domain.getResourceSet().getResource(
uri.trimFragment(), false);
if (resource == null) {
resource = domain.getResourceSet().createResource(
uri.trimFragment());
}
if (!resource.isLoaded()) {
try {
Map options = new HashMap(