summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-04 01:51:13 (EDT)
committerEike Stepper2007-07-04 01:51:13 (EDT)
commitcf5a788c212d352f14ec2850768f96d77ec3311b (patch)
tree488e3e1aa0cb7a25621fe0b5fd9b37311ba09e82
parent1fef71e6c7b59e389e46447ce8d6468be95aadd7 (diff)
downloadcdo-cf5a788c212d352f14ec2850768f96d77ec3311b.zip
cdo-cf5a788c212d352f14ec2850768f96d77ec3311b.tar.gz
cdo-cf5a788c212d352f14ec2850768f96d77ec3311b.tar.bz2
task 1: Develop 0.8.0
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/CDO UI.launch2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/Test.java43
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java53
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java37
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java5
8 files changed, 136 insertions, 41 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/CDO UI.launch b/plugins/org.eclipse.emf.cdo.ui/CDO UI.launch
index 4c314b1..83d0369 100644
--- a/plugins/org.eclipse.emf.cdo.ui/CDO UI.launch
+++ b/plugins/org.eclipse.emf.cdo.ui/CDO UI.launch
@@ -20,7 +20,7 @@
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
<stringAttribute key="selectedPlugin" value="org.eclipse.emf.cdo.ui"/>
<stringAttribute key="selected_target_plugins" value="com.ibm.icu,com.jcraft.jsch,javax.servlet,javax.servlet.jsp,org.apache.ant,org.apache.commons.el,org.apache.commons.logging,org.apache.jasper,org.apache.lucene,org.apache.lucene.analysis,org.eclipse.ant.core,org.eclipse.ant.ui,org.eclipse.compare,org.eclipse.core.boot,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.databinding,org.eclipse.core.databinding.beans,org.eclipse.core.expressions,org.eclipse.core.filebuffers,org.eclipse.core.filesystem,org.eclipse.core.filesystem.win32.x86,org.eclipse.core.jobs,org.eclipse.core.net,org.eclipse.core.resources,org.eclipse.core.resources.compatibility,org.eclipse.core.resources.win32,org.eclipse.core.runtime,org.eclipse.core.runtime.compatibility,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.core.variables,org.eclipse.cvs,org.eclipse.cvs.source,org.eclipse.debug.core,org.eclipse.debug.ui,org.eclipse.emf,org.eclipse.emf.ant,org.eclipse.emf.cheatsheets,org.eclipse.emf.codegen,org.eclipse.emf.codegen.ecore,org.eclipse.emf.codegen.ecore.ui,org.eclipse.emf.codegen.ui,org.eclipse.emf.common,org.eclipse.emf.common.ui,org.eclipse.emf.commonj.sdo,org.eclipse.emf.converter,org.eclipse.emf.doc,org.eclipse.emf.ecore,org.eclipse.emf.ecore.change,org.eclipse.emf.ecore.change.edit,org.eclipse.emf.ecore.edit,org.eclipse.emf.ecore.editor,org.eclipse.emf.ecore.sdo,org.eclipse.emf.ecore.sdo.doc,org.eclipse.emf.ecore.sdo.edit,org.eclipse.emf.ecore.sdo.editor,org.eclipse.emf.ecore.sdo.source,org.eclipse.emf.ecore.xmi,org.eclipse.emf.edit,org.eclipse.emf.edit.ui,org.eclipse.emf.exporter,org.eclipse.emf.importer,org.eclipse.emf.importer.ecore,org.eclipse.emf.importer.java,org.eclipse.emf.importer.rose,org.eclipse.emf.mapping,org.eclipse.emf.mapping.ecore2ecore,org.eclipse.emf.mapping.ecore2ecore.editor,org.eclipse.emf.mapping.ecore2xml,org.eclipse.emf.mapping.ecore2xml.ui,org.eclipse.emf.mapping.ui,org.eclipse.emf.mapping.xsd2ecore,org.eclipse.emf.mapping.xsd2ecore.editor,org.eclipse.emf.source,org.eclipse.equinox.app,org.eclipse.equinox.common,org.eclipse.equinox.http.jetty,org.eclipse.equinox.http.registry,org.eclipse.equinox.http.servlet,org.eclipse.equinox.jsp.jasper,org.eclipse.equinox.jsp.jasper.registry,org.eclipse.equinox.launcher,org.eclipse.equinox.launcher.win32.win32.x86,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.help.appserver,org.eclipse.help.base,org.eclipse.help.ui,org.eclipse.help.webapp,org.eclipse.jdt,org.eclipse.jdt.apt.core,org.eclipse.jdt.apt.ui,org.eclipse.jdt.compiler.apt,org.eclipse.jdt.compiler.tool,org.eclipse.jdt.core,org.eclipse.jdt.core.manipulation,org.eclipse.jdt.debug,org.eclipse.jdt.debug.ui,org.eclipse.jdt.doc.isv,org.eclipse.jdt.doc.user,org.eclipse.jdt.junit,org.eclipse.jdt.junit.runtime,org.eclipse.jdt.junit4.runtime,org.eclipse.jdt.launching,org.eclipse.jdt.source,org.eclipse.jdt.ui,org.eclipse.jface,org.eclipse.jface.databinding,org.eclipse.jface.text,org.eclipse.jsch.core,org.eclipse.ltk.core.refactoring,org.eclipse.ltk.ui.refactoring,org.eclipse.osgi,org.eclipse.osgi.services,org.eclipse.osgi.util,org.eclipse.pde,org.eclipse.pde.build,org.eclipse.pde.core,org.eclipse.pde.doc.user,org.eclipse.pde.junit.runtime,org.eclipse.pde.runtime,org.eclipse.pde.source,org.eclipse.pde.ui,org.eclipse.pde.ui.templates,org.eclipse.platform,org.eclipse.platform.doc.isv,org.eclipse.platform.source,org.eclipse.platform.source.win32.win32.x86,org.eclipse.rcp,org.eclipse.rcp.source,org.eclipse.rcp.source.win32.win32.x86,org.eclipse.sdk,org.eclipse.search,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.team.core,org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui,org.eclipse.text,org.eclipse.tomcat,org.eclipse.ui,org.eclipse.ui.browser,org.eclipse.ui.cheatsheets,org.eclipse.ui.console,org.eclipse.ui.editors,org.eclipse.ui.externaltools,org.eclipse.ui.forms,org.eclipse.ui.ide,org.eclipse.ui.ide.application,org.eclipse.ui.intro,org.eclipse.ui.intro.universal,org.eclipse.ui.navigator,org.eclipse.ui.navigator.resources,org.eclipse.ui.presentations.r21,org.eclipse.ui.views,org.eclipse.ui.views.properties.tabbed,org.eclipse.ui.win32,org.eclipse.ui.workbench,org.eclipse.ui.workbench.compatibility,org.eclipse.ui.workbench.texteditor,org.eclipse.update.configurator,org.eclipse.update.core,org.eclipse.update.core.win32,org.eclipse.update.scheduler,org.eclipse.update.ui,org.eclipse.xsd,org.eclipse.xsd.cheatsheets,org.eclipse.xsd.doc,org.eclipse.xsd.ecore.exporter,org.eclipse.xsd.ecore.importer,org.eclipse.xsd.edit,org.eclipse.xsd.editor,org.eclipse.xsd.source,org.junit,org.junit4,org.mortbay.jetty"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.protocol,org.eclipse.emf.cdo.tests.model1.editor,org.eclipse.emf.cdo.tests.model1.edit,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.edit,org.eclipse.emf.cdo.ui,org.eclipse.net4j,org.eclipse.emf.cdo.tests.model1,org.eclipse.net4j.tcp,org.eclipse.emf.cdo,org.eclipse.net4j.ui"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.protocol,org.eclipse.emf.cdo.tests.model1.edit,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.edit,org.eclipse.emf.cdo.ui,org.eclipse.net4j,org.eclipse.emf.cdo.tests.model1,org.eclipse.net4j.tcp,org.eclipse.emf.cdo,org.eclipse.net4j.ui"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="tracing" value="true"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
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 afe4f0c..ecef20f 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
@@ -120,7 +120,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EventObject;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@@ -943,7 +942,8 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
ResourceSet resourceSet = view.getResourceSet();
editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, resourceSet);
- editingDomain.setResourceToReadOnlyMap(new HashMap<Resource, Boolean>());
+ // editingDomain.setResourceToReadOnlyMap(new HashMap<Resource,
+ // Boolean>());
String resourcePath = editorInput.getResourcePath();
if (resourcePath == null)
@@ -1611,25 +1611,20 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
*/
public void menuAboutToShow(IMenuManager menuManager)
{
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
MenuManager submenuManager = new MenuManager("New Root");
- populateManager(submenuManager);
- try
+ if (populateManager(submenuManager))
{
menuManager.insertBefore("edit", submenuManager);
}
- catch (IllegalArgumentException ex)
- {
- menuManager.add(submenuManager);
- }
-
- ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
}
/**
* @ADDED
*/
- private void populateManager(MenuManager menuManager)
+ private boolean populateManager(MenuManager menuManager)
{
+ boolean populated = false;
CDOPackage[] cdoPackages = CDOPackageManager.INSTANCE.getPackages();
for (CDOPackage cdoPackage : cdoPackages)
{
@@ -1640,11 +1635,14 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
for (CDOClass cdoClass : cdoClasses)
{
submenuManager.add(new CreateRootAction(cdoClass));
+ populated = true;
}
menuManager.add(submenuManager);
}
}
+
+ return populated;
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/Test.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/Test.java
new file mode 100644
index 0000000..fb05d63
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/Test.java
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.internal.ui.editor;
+
+import org.eclipse.emf.cdo.util.CDOUtil;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+
+/**
+ * @author Eike Stepper
+ */
+public class Test
+{
+
+ public static void main(String[] args)
+ {
+ AdapterFactoryEditingDomain editingDomain = new AdapterFactoryEditingDomain(null, null)
+ {
+ @Override
+ public AdapterFactory getAdapterFactory()
+ {
+
+ URI uri = CDOUtil.createURI("/path");
+ System.out.println(uri.isRelative() ? "relative" : "absolute");
+ System.out.println(isReadOnlyURI(uri) ? "readonly" : "writable");
+ return null;
+ }
+ };
+
+ editingDomain.getAdapterFactory();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
index c03a84c..c92c5e4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
@@ -50,6 +50,8 @@ public interface CDOView extends INotifier
public CDORevision resolve(CDOID id);
+ public boolean isDirty();
+
/**
* @see CDOTransaction#commit()
*/
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
index bc4ec98..59e4bd2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
@@ -24,14 +24,13 @@ import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource.Diagnostic;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.emf.internal.cdo.CDOViewImpl;
import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+import org.eclipse.emf.internal.cdo.CDOViewImpl;
import org.eclipse.emf.internal.cdo.bundle.CDO;
import java.io.IOException;
@@ -48,18 +47,18 @@ import java.util.Map;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getResourceSet <em>Resource Set</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getURI <em>URI</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getContents <em>Contents</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#isModified <em>Modified</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#isLoaded <em>Loaded</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#isTrackingModification <em>Tracking Modification</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getErrors <em>Errors</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getWarnings <em>Warnings</em>}</li>
- * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getPath <em>Path</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getResourceSet <em>Resource Set</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getURI <em>URI</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getContents <em>Contents</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#isModified <em>Modified</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#isLoaded <em>Loaded</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#isTrackingModification <em>Tracking Modification</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getErrors <em>Errors</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getWarnings <em>Warnings</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getPath <em>Path</em>}</li>
* </ul>
* </p>
- *
+ *
* @generated
*/
public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
@@ -72,7 +71,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* @ADDED
*/
- private CDOViewImpl adapter;
+ private CDOViewImpl view;
/**
* @ADDED
@@ -81,6 +80,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
protected CDOResourceImpl()
@@ -90,6 +90,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -99,8 +100,8 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
}
/**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -111,6 +112,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public ResourceSet getResourceSet()
@@ -120,6 +122,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setResourceSet(ResourceSet newResourceSet)
@@ -129,6 +132,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public URI getURI()
@@ -171,6 +175,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean isModified()
@@ -180,6 +185,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setModified(boolean newModified)
@@ -189,6 +195,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean isLoaded()
@@ -198,6 +205,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setLoaded(boolean newLoaded)
@@ -207,6 +215,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean isTrackingModification()
@@ -216,6 +225,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setTrackingModification(boolean newTrackingModification)
@@ -225,6 +235,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@SuppressWarnings("unchecked")
@@ -235,6 +246,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@SuppressWarnings("unchecked")
@@ -245,6 +257,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public String getPath()
@@ -320,7 +333,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
*/
public void save(Map<?, ?> options) throws IOException
{
- // Do nothing
+ view.commit();
}
/**
@@ -423,20 +436,20 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
@Override
public CDOViewImpl cdoView()
{
- return adapter;
+ return view;
}
/**
* @ADDED
*/
- public void cdoSetAdapter(CDOViewImpl adapter)
+ public void cdoSetView(CDOViewImpl view)
{
if (TRACER.isEnabled())
{
- TRACER.format("Setting adpter: {0}", adapter);
+ TRACER.format("Setting view: {0}", view);
}
- this.adapter = adapter;
+ this.view = view;
}
/**
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index 322b86f..d684bac 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -131,7 +131,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
{
if (this instanceof CDOResourceImpl)
{
- ((CDOResourceImpl)this).cdoSetAdapter(adapter);
+ ((CDOResourceImpl)this).cdoSetView(adapter);
}
}
@@ -263,7 +263,10 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
revision.set(cdoFeature, 0, setting);
}
- eSettings[i] = null;
+ if (eSettings != null)
+ {
+ eSettings[i] = null;
+ }
}
public CDORevisionImpl copyRevision()
@@ -301,6 +304,11 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
{
if (cdoTransient())
{
+ if (eSettings == null)
+ {
+ return null;
+ }
+
return eSettings[dynamicFeatureID];
}
@@ -313,6 +321,11 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
if (cdoTransient())
{
// TODO What about defaultValues != null?
+ if (eSettings == null)
+ {
+ return false;
+ }
+
return eSettings[eDynamicFeatureID(feature)] != null;
}
@@ -324,11 +337,13 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
{
if (cdoTransient())
{
+ eSettings(); // Important to create eSettings array if necessary
eSettings[dynamicFeatureID] = value;
- return;
}
-
- super.dynamicSet(dynamicFeatureID, value);
+ else
+ {
+ super.dynamicSet(dynamicFeatureID, value);
+ }
}
@Override
@@ -336,11 +351,15 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
{
if (cdoTransient())
{
- eSettings[dynamicFeatureID] = null;
- return;
+ if (eSettings != null)
+ {
+ eSettings[dynamicFeatureID] = null;
+ }
+ }
+ else
+ {
+ super.dynamicUnset(dynamicFeatureID);
}
-
- super.dynamicUnset(dynamicFeatureID);
}
@Override
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 8c72c92..70fe335 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
@@ -42,6 +42,8 @@ public class CDOTransactionImpl
private Map<CDOID, CDOObjectImpl> dirtyObjects = new HashMap();
+ private boolean dirty;
+
public CDOTransactionImpl(CDOViewImpl view)
{
this.view = view;
@@ -52,6 +54,11 @@ public class CDOTransactionImpl
return view;
}
+ public boolean isDirty()
+ {
+ return dirty;
+ }
+
public Map<CDOID, CDOResourceImpl> getNewResources()
{
return newResources;
@@ -79,6 +86,11 @@ public class CDOTransactionImpl
public void commit()
{
+ if (!dirty)
+ {
+ return;
+ }
+
if (TRACER.isEnabled())
{
TRACER.trace("commit()");
@@ -98,6 +110,7 @@ public class CDOTransactionImpl
newResources.clear();
newObjects.clear();
dirtyObjects.clear();
+ dirty = false;
nextTemporaryID = INITIAL_TEMPORARY_ID;
}
catch (RuntimeException ex)
@@ -155,6 +168,8 @@ public class CDOTransactionImpl
{
throw new ImplementationError("Duplicate ID: " + object);
}
+
+ dirty = true;
}
private void postCommit(Map objects, CommitTransactionResult result)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index f5b8524..5d790f2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -263,6 +263,11 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
}
}
+ public boolean isDirty()
+ {
+ return transaction == null ? false : transaction.isDirty();
+ }
+
public void commit()
{
checkWritable();