diff options
author | Eike Stepper | 2015-02-24 10:47:14 +0000 |
---|---|---|
committer | Eike Stepper | 2015-02-24 10:47:14 +0000 |
commit | 7dfe618be9130e8f1f03ba5f44c7e3e87389e71b (patch) | |
tree | eff04a1acf9cc92f1882168335d40868a3635d4b /plugins | |
parent | 5b364c40cdb008a9d60bae2299009403b53b0e65 (diff) | |
download | cdo-7dfe618be9130e8f1f03ba5f44c7e3e87389e71b.tar.gz cdo-7dfe618be9130e8f1f03ba5f44c7e3e87389e71b.tar.xz cdo-7dfe618be9130e8f1f03ba5f44c7e3e87389e71b.zip |
[458349] Consolidate UI
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
Diffstat (limited to 'plugins')
5 files changed, 43 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/checkouts/CDOCheckout.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/checkouts/CDOCheckout.java index a1892ad93a..4124ff8b9d 100644 --- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/checkouts/CDOCheckout.java +++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/checkouts/CDOCheckout.java @@ -25,6 +25,7 @@ import org.eclipse.emf.cdo.view.CDOView; import org.eclipse.net4j.util.AdapterUtil; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.ResourceSet; /** * A CDO checkout. @@ -88,10 +89,16 @@ public interface CDOCheckout extends CDOExplorerElement, CDOTimeProvider, StateP public CDOView openView(); + public CDOView openView(ResourceSet resourceSet); + public CDOView openView(boolean readOnly); + public CDOView openView(boolean readOnly, ResourceSet resourceSet); + public CDOTransaction openTransaction(); + public CDOTransaction openTransaction(ResourceSet resourceSet); + public boolean isDirty(); public String getEditorID(CDOID objectID); 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 42f78e5f3e..6edc407c97 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 @@ -38,6 +38,8 @@ import org.eclipse.net4j.util.lifecycle.ILifecycle; import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import java.io.File; import java.util.ArrayList; @@ -437,27 +439,47 @@ public abstract class CDOCheckoutImpl extends AbstractElement implements CDOChec return ObjectType.valueFor(rootObject); } + protected ResourceSetImpl createResourceSet() + { + return new ResourceSetImpl(); + } + public final CDOView openView() { - return doOpenView(readOnly); + return openView(createResourceSet()); + } + + public CDOView openView(ResourceSet resourceSet) + { + return openView(readOnly, resourceSet); } public final CDOView openView(boolean readOnly) { - return doOpenView(readOnly); + return openView(readOnly, createResourceSet()); + } + + public CDOView openView(boolean readOnly, ResourceSet resourceSet) + { + return doOpenView(readOnly, resourceSet); } public final CDOTransaction openTransaction() { + return openTransaction(createResourceSet()); + } + + public CDOTransaction openTransaction(ResourceSet resourceSet) + { if (readOnly) { throw new ReadOnlyException("Checkout '" + getLabel() + "' is read-only"); } - return (CDOTransaction)doOpenView(false); + return (CDOTransaction)doOpenView(false, resourceSet); } - protected CDOView doOpenView(boolean readOnly) + protected CDOView doOpenView(boolean readOnly, ResourceSet resourceSet) { if (view == null) { @@ -466,13 +488,14 @@ public abstract class CDOCheckoutImpl extends AbstractElement implements CDOChec CDOSession session = view.getSession(); CDOBranch branch = view.getBranch(); + CDOBranchPoint head = branch.getHead(); if (readOnly) { - return configureView(session.openView(branch)); + return configureView(session.openView(head, resourceSet)); } - return configureView(session.openTransaction(branch)); + return configureView(session.openTransaction(head, resourceSet)); } protected CDOView configureView(final CDOView view) diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/OfflineCDOCheckout.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/OfflineCDOCheckout.java index 44a3cfa5bb..71c16d7a79 100644 --- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/OfflineCDOCheckout.java +++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/OfflineCDOCheckout.java @@ -44,6 +44,8 @@ import org.eclipse.net4j.util.event.IEvent; import org.eclipse.net4j.util.event.IListener; import org.eclipse.net4j.util.security.IPasswordCredentialsProvider; +import org.eclipse.emf.ecore.resource.ResourceSet; + import org.h2.jdbcx.JdbcDataSource; import java.io.File; @@ -263,7 +265,7 @@ public class OfflineCDOCheckout extends CDOCheckoutImpl } @Override - protected CDOView doOpenView(boolean readOnly) + protected CDOView doOpenView(boolean readOnly, ResourceSet resourceSet) { if (workspace == null) { @@ -272,10 +274,10 @@ public class OfflineCDOCheckout extends CDOCheckoutImpl if (readOnly) { - return workspace.openView(); + return workspace.openView(resourceSet); } - return workspace.openTransaction(); + return workspace.openTransaction(resourceSet); } /** diff --git a/plugins/org.eclipse.emf.cdo.releng/CDO.setup b/plugins/org.eclipse.emf.cdo.releng/CDO.setup index 90cb7d248f..57d9937ebe 100644 --- a/plugins/org.eclipse.emf.cdo.releng/CDO.setup +++ b/plugins/org.eclipse.emf.cdo.releng/CDO.setup @@ -181,7 +181,7 @@ <repository url="http://download.eclipse.org/tools/buckminster/updates-4.4M6"/> <repository - url="http://download.eclipse.org/technology/nebula/archives/Q12015/release"/> + url="http://download.eclipse.org/technology/nebula/snapshot"/> <repository url="http://download.eclipse.org/modeling/mdt/uml2/updates/4.1milestones"/> <repository diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOTransactionContainerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOTransactionContainerImpl.java index 43bf2130a8..e98fcc187e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOTransactionContainerImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOTransactionContainerImpl.java @@ -63,7 +63,7 @@ public abstract class CDOTransactionContainerImpl extends CDOViewContainerImpl i public CDOTransaction openTransaction(CDOBranchPoint target, ResourceSet resourceSet) { checkArg(target.getTimeStamp() == CDOBranchPoint.UNSPECIFIED_DATE, "Target is not head of a branch: " + target); - return openTransaction(target.getBranch()); + return openTransaction(target.getBranch(), resourceSet); } public CDOTransaction openTransaction(CDOBranchPoint target) |