Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-05-20 11:36:16 +0000
committerEike Stepper2015-05-20 11:36:16 +0000
commitc4ad915470ccf75df9b43dceeb89849838298674 (patch)
treeba4583b408701bc99a0cc2d9de8319fc9a75edbc /plugins/org.eclipse.emf.cdo.explorer
parent26f3832ce0f83af27ebfc763d24b526c02b207e6 (diff)
downloadcdo-c4ad915470ccf75df9b43dceeb89849838298674.tar.gz
cdo-c4ad915470ccf75df9b43dceeb89849838298674.tar.xz
cdo-c4ad915470ccf75df9b43dceeb89849838298674.zip
[467442] Add Interactive Transaction Conflict Resolution
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=467442
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.explorer')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java8
2 files changed, 10 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutImpl.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutImpl.java
index 51fe0b1979..c67d95fb8f 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutImpl.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutImpl.java
@@ -647,7 +647,7 @@ public abstract class CDOCheckoutImpl extends AbstractElement implements CDOChec
});
URI from = URI.createURI("cdo://" + view.getSession().getRepositoryInfo().getUUID() + "/");
- URI to = URI.createURI("cdo.checkout://" + getID() + "/" + repository.getID() + "/");
+ URI to = uri.appendSegment("");
view.getResourceSet().getURIConverter().getURIMap().put(from, to);
addView(view);
@@ -665,7 +665,7 @@ public abstract class CDOCheckoutImpl extends AbstractElement implements CDOChec
path = "/" + path;
}
- return URI.createURI(CDOCheckoutViewProvider.SCHEME + "://" + getID() + "/" + getRepository().getID() + path);
+ return URI.createURI(CDOCheckoutViewProvider.SCHEME + "://" + getID() + path);
}
public String getEditorOpenerID(CDOID objectID)
@@ -767,8 +767,13 @@ public abstract class CDOCheckoutImpl extends AbstractElement implements CDOChec
{
super.init(folder, type, properties);
- uri = createResourceURI(null);
- repository = OM.getRepositoryManager().getElement(properties.getProperty(PROP_REPOSITORY));
+ String repositoryID = properties.getProperty(PROP_REPOSITORY);
+ repository = OM.getRepositoryManager().getElement(repositoryID);
+ if (repository == null)
+ {
+ throw new IllegalStateException("Repository not found: " + repositoryID);
+ }
+
branchID = Integer.parseInt(properties.getProperty(PROP_BRANCH_ID));
branchPath = properties.getProperty(PROP_BRANCH_PATH);
branchPoints = properties.getProperty(PROP_BRANCH_POINTS);
@@ -781,6 +786,7 @@ public abstract class CDOCheckoutImpl extends AbstractElement implements CDOChec
rootID = CDOIDUtil.read(property);
}
+ uri = createResourceURI(null);
((CDORepositoryImpl)repository).addCheckout(this);
}
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java
index 20c921f693..c301fe6fc8 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java
@@ -28,8 +28,6 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.core.runtime.Path;
-
import java.util.HashMap;
import java.util.Map;
@@ -92,12 +90,6 @@ public class CDOCheckoutViewProvider extends AbstractCDOViewProvider
return super.getResourceURI(view, path);
}
- @Override
- public String getPath(URI uri)
- {
- return new Path(uri.path()).makeAbsolute().removeFirstSegments(1).toString();
- }
-
public static void disposeResourceSet(ResourceSet resourceSet)
{
CheckoutViewProviderAdapter adapter = CheckoutViewProviderAdapter.get(resourceSet);

Back to the top