use of org.eclipse.gmf.runtime.notation.Diagram in project tdi-studio-se by Talend.
the class GmfPastCommand method doExecuteWithResult.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse
* .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
List pChildren = ((Diagram) part.getModel()).getPersistedChildren();
cloneAssignmentForModel(nodes, pChildren);
cloneAssignmentForModel(edges, ((Diagram) part.getModel()).getPersistedEdges());
return CommandResult.newOKCommandResult();
}
use of org.eclipse.gmf.runtime.notation.Diagram in project tdi-studio-se by Talend.
the class DiagramResourceManager method updateFromResource.
public void updateFromResource(BusinessProcessItem businessProcessItem, IFile file) {
Resource resource = createResource(file);
BusinessProcess semantic = (BusinessProcess) EcoreUtil.getObjectByType(resource.getContents(), BusinessPackage.eINSTANCE.getBusinessProcess());
Diagram notation = (Diagram) EcoreUtil.getObjectByType(resource.getContents(), NotationPackage.eINSTANCE.getDiagram());
businessProcessItem.setSemantic(semantic);
businessProcessItem.setNotation(notation);
}
use of org.eclipse.gmf.runtime.notation.Diagram 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