Lines 1-4
Link Here
|
1 |
/****************************************************************************** |
1 |
/****************************************************************************** |
|
|
2 |
* Copyright (c) 2005, 2006 IBM Corporation and others. |
2 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 20-25
Link Here
|
20 |
import org.eclipse.core.resources.IStorage; |
21 |
import org.eclipse.core.resources.IStorage; |
21 |
import org.eclipse.core.runtime.CoreException; |
22 |
import org.eclipse.core.runtime.CoreException; |
22 |
import org.eclipse.core.runtime.IAdaptable; |
23 |
import org.eclipse.core.runtime.IAdaptable; |
|
|
24 |
import org.eclipse.core.runtime.IPath; |
23 |
import org.eclipse.core.runtime.IProgressMonitor; |
25 |
import org.eclipse.core.runtime.IProgressMonitor; |
24 |
import org.eclipse.core.runtime.IStatus; |
26 |
import org.eclipse.core.runtime.IStatus; |
25 |
import org.eclipse.core.runtime.NullProgressMonitor; |
27 |
import org.eclipse.core.runtime.NullProgressMonitor; |
Lines 364-367
Link Here
|
364 |
DiagramIOUtil.save(domain, file, diagram, monitor, options); |
366 |
DiagramIOUtil.save(domain, file, diagram, monitor, options); |
365 |
} |
367 |
} |
366 |
} |
368 |
} |
|
|
369 |
|
370 |
/** |
371 |
* Additionally handles updating the URI of the diagram's resource when on |
372 |
* an element moved event. |
373 |
* |
374 |
* @param fileEditorInput the input of an document editor |
375 |
* @param path the path of the new location of the file |
376 |
*/ |
377 |
protected void handleElementMoved(IFileEditorInput fileEditorInput, IPath path) { |
378 |
if (path != null) { |
379 |
IDiagramDocument diagramDocument = getDiagramDocument(fileEditorInput); |
380 |
Diagram diagram = null; |
381 |
if (diagramDocument != null) { |
382 |
diagram = diagramDocument.getDiagram(); |
383 |
} |
384 |
if (diagram != null) { |
385 |
//not to os string! |
386 |
diagram.eResource().setURI(URI.createPlatformResourceURI(path.toString())); |
387 |
} |
388 |
} |
389 |
|
390 |
super.handleElementMoved(fileEditorInput, path); |
391 |
} |
367 |
} |
392 |
} |