use of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument in project tdi-studio-se by Talend.
the class BusinessDocumentProvider method saveDocumentToFile.
/**
* @generated
*/
protected void saveDocumentToFile(IDocument document, IFile file, boolean overwrite, IProgressMonitor monitor) throws CoreException {
Diagram diagram = (Diagram) document.getContent();
Resource diagramResource = diagram.eResource();
IDiagramDocument diagramDocument = (IDiagramDocument) document;
TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
List resources = domain.getResourceSet().getResources();
//$NON-NLS-1$
monitor.beginTask("Saving diagram", resources.size() + 1);
super.saveDocumentToFile(document, file, overwrite, new SubProgressMonitor(monitor, 1));
for (Iterator it = resources.iterator(); it.hasNext(); ) {
Resource nextResource = (Resource) it.next();
//$NON-NLS-1$
monitor.setTaskName("Saving " + nextResource.getURI());
if (nextResource != diagramResource && nextResource.isLoaded()) {
try {
nextResource.save(Collections.EMPTY_MAP);
} catch (IOException e) {
BusinessDiagramEditorPlugin.getInstance().logError("Unable to save resource: " + nextResource.getURI(), //$NON-NLS-1$
e);
}
}
monitor.worked(1);
}
monitor.done();
}
Aggregations