summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-07 06:06:50 (EDT)
committerEike Stepper2007-10-07 06:06:50 (EDT)
commit831f8aa68633869726ada59819d9bddbc2c8c844 (patch)
tree8f1fe57fc879b8889a1eefe1d6e04208c019f719
parent790094f357670c5b7954b3ab44f188b2c9849264 (diff)
downloadcdo-831f8aa68633869726ada59819d9bddbc2c8c844.zip
cdo-831f8aa68633869726ada59819d9bddbc2c8c844.tar.gz
cdo-831f8aa68633869726ada59819d9bddbc2c8c844.tar.bz2
[205651] Implement transaction rollback
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205651
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java12
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java3
2 files changed, 13 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index 779f34d..e7b69d6 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -8,6 +8,7 @@ package org.eclipse.emf.cdo.internal.ui.editor;
import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.CDOView;
+import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.ui.SharedIcons;
import org.eclipse.emf.cdo.internal.ui.bundle.OM;
import org.eclipse.emf.cdo.internal.ui.views.CDOEventHandler;
@@ -1207,6 +1208,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
{
if (cdoObject instanceof CDOLegacyImpl)
{
+ // TODO Consider CDOObject.cdoRefresh(boolean force)
CDOStateMachine.INSTANCE.read(cdoObject);
}
}
@@ -1220,6 +1222,16 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
@Override
protected void viewDirtyStateChanged()
{
+ if (viewerInput instanceof CDOResource)
+ {
+ CDOResource resource = (CDOResource)viewerInput;
+ if (!view.isObjectRegistered(resource.cdoID()))
+ {
+ closeEditor();
+ return;
+ }
+ }
+
fireDirtyPropertyChange();
}
};
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index 1b541f0..70e5aef 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -223,6 +223,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
for (CDOObject newResource : newResources.values())
{
removeObject(newResource.cdoID());
+ getResourceSet().getResources().remove(newResource);
}
}
@@ -240,8 +241,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
{
CDOStateMachine.INSTANCE.rollback((InternalCDOObject)dirtyObject);
}
-
- // getSession().fireInvalidationEvent(CDOSessionInvalidationEvent.LOCAL_ROLLBACK, dirtyObjects.keySet(), null);
}
cleanUp();