Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-09-04 08:51:17 +0000
committerEike Stepper2010-09-04 08:51:17 +0000
commitdde6f4ac72d1d2729b9c9d6b367438b3eaf8f2f1 (patch)
tree3b7682f9731eb7563e51c423b505b570325782fb /plugins/org.eclipse.emf.cdo.edit
parent65f4b0c0f7134da1b8853e37b01f3aebf8eaccdc (diff)
downloadcdo-dde6f4ac72d1d2729b9c9d6b367438b3eaf8f2f1.tar.gz
cdo-dde6f4ac72d1d2729b9c9d6b367438b3eaf8f2f1.tar.xz
cdo-dde6f4ac72d1d2729b9c9d6b367438b3eaf8f2f1.zip
[324506] Allow CDOResource to be saved to XMI directly (export)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=324506
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.edit')
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.java
index e7d5514499..03b67ebec6 100644
--- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.java
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.java
@@ -936,7 +936,13 @@ public class CDOItemProviderAdapter extends ItemProviderAdapter
if (object instanceof EObject)
{
CDOObject cdoObject = CDOUtil.getCDOObject((EObject)object);
- return cdoObject.eResource().getURI().toString() + "#" + cdoObject.cdoID().toURIFragment(); //$NON-NLS-1$
+ Resource resource = cdoObject.eResource();
+ if (resource != null)
+ {
+ CDOID id = cdoObject.cdoID();
+ String fragment = id != null ? id.toURIFragment() : resource.getURIFragment(cdoObject);
+ return resource.getURI().appendFragment(fragment).toString();
+ }
}
return null;

Back to the top