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();