Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-03-14 05:49:09 -0400
committerEike Stepper2009-03-14 05:49:09 -0400
commit0687762fb4b2a5fb50486c04144d8ff18daf7287 (patch)
tree4e35dbed8e423ba783abc5b76579bae4dc9e8c9c
parentddaa1ebede58ef166c2336f9c82511da6e76150a (diff)
downloadcdo-committers/estepper/emf-on-server.tar.gz
cdo-committers/estepper/emf-on-server.tar.xz
cdo-committers/estepper/emf-on-server.zip
[265435] Replace CDOModelElements by EModelElementscommitters/estepper/emf-on-server
https://bugs.eclipse.org/bugs/show_bug.cgi?id=265435
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java26
10 files changed, 44 insertions, 62 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
index 0160e79dde..870501968b 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
@@ -222,6 +222,25 @@ public final class CDOModelUtil
throw new IllegalArgumentException("Not a primitive type nor String nor Date: " + primitiveType);
}
+ public static CDOPackageInfo getPackageInfo(Object value, CDOPackageRegistry packageRegistry)
+ {
+ if (value instanceof EPackage)
+ {
+ return packageRegistry.getPackageInfo((EPackage)value);
+ }
+
+ if (value instanceof CDOPackageInfo)
+ {
+ CDOPackageInfo packageInfo = (CDOPackageInfo)value;
+ if (packageInfo.getPackageUnit().getPackageRegistry() == packageRegistry)
+ {
+ return packageInfo;
+ }
+ }
+
+ return null;
+ }
+
public static CDOClassInfo getClassInfo(EClass eClass)
{
synchronized (eClass)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java
index 9972a594a8..e9bee51d3f 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java
@@ -10,7 +10,6 @@
*/
package org.eclipse.emf.cdo.common.model;
-
import org.eclipse.emf.ecore.EPackage;
/**
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java
index 0ce4f28712..f333ce7794 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java
@@ -163,13 +163,6 @@ public final class CDOPackageTypeRegistry
{
if (ePackage.getClass() == EPackageImpl.class)
{
- // EFactory factory = ePackage.getEFactoryInstance();
- // if (factory instanceof CDOFactoryMarker)
- // {
- // return CDOPackageUnit.Type.NATIVE;
- // }
- //
- // return CDOPackageUnit.Type.LEGACY;
return CDOPackageUnit.Type.DYNAMIC;
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
index e9ce536e12..5d68c398fb 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
@@ -73,7 +73,7 @@ public final class EMFUtil
return o1.getKey().compareTo(o2.getKey());
}
});
-
+
return array;
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java
index 5c13fedee1..f782fcc60a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java
@@ -92,7 +92,11 @@ public class CDOPackageUnitImpl implements InternalCDOPackageUnit
public Type getType()
{
- if (type == null)
+ if (getOriginalType() == Type.DYNAMIC)
+ {
+ type = Type.DYNAMIC;
+ }
+ else if (type == null || type == Type.UNKNOWN)
{
if (state == State.PROXY)
{
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java
index bc803a7345..c2961e93d9 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionInstantiator.java
@@ -43,8 +43,7 @@ public class CDORevisionInstantiator implements Instantiator
public Object instantiate(Serializable id)
{
- return CDORevisionUtil
- .create(eClass, CDOIDHibernateFactoryImpl.getInstance().createCDOID(id, eClass.getName()));
+ return CDORevisionUtil.create(eClass, CDOIDHibernateFactoryImpl.getInstance().createCDOID(id, eClass.getName()));
}
public boolean isInstance(Object object)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
index 5dfdb067d6..bfdc6b4d12 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
@@ -263,8 +263,8 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
/**
* @since 2.0
*/
- public void handleCommitNotification(long timeStamp, CDOPackageUnit[] packageUnits,
- List<CDOIDAndVersion> dirtyIDs, List<CDOID> detachedObjects, List<CDORevisionDelta> deltas)
+ public void handleCommitNotification(long timeStamp, CDOPackageUnit[] packageUnits, List<CDOIDAndVersion> dirtyIDs,
+ List<CDOID> detachedObjects, List<CDORevisionDelta> deltas)
{
if (!isPassiveUpdateEnabled())
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
index 4f2d361e76..802ea279f5 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
@@ -158,9 +158,8 @@ public class SessionManager extends Container<ISession> implements ISessionManag
/**
* @since 2.0
*/
- public void handleCommitNotification(long timeStamp, CDOPackageUnit[] packageUnits,
- List<CDOIDAndVersion> dirtyIDs, List<CDOID> detachedObjects, List<CDORevisionDelta> deltas,
- Session excludedSession)
+ public void handleCommitNotification(long timeStamp, CDOPackageUnit[] packageUnits, List<CDOIDAndVersion> dirtyIDs,
+ List<CDOID> detachedObjects, List<CDORevisionDelta> deltas, Session excludedSession)
{
for (Session session : getSessions())
{
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 a204477bdf..b71b8a8569 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
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.common.model.CDOPackageInfo;
import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.model.EMFUtil;
-import org.eclipse.emf.cdo.common.model.CDOPackageRegistryPopulator.Descriptor;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.ui.SharedIcons;
import org.eclipse.emf.cdo.internal.ui.bundle.OM;
@@ -2437,38 +2436,6 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
}
/**
- * @ADDED
- * @author Victor Roldan
- */
-
- private final class LoadDescriptorAction extends LongRunningAction
- {
- private Descriptor descriptor;
-
- private LoadDescriptorAction(Descriptor ePackageDescriptor)
- {
- super(getEditorSite().getPage(), "{" + ePackageDescriptor.getNsURI() + "}", SharedIcons
- .getDescriptor(SharedIcons.OBJ_EPACKAGE_DYNAMIC));
- descriptor = ePackageDescriptor;
- }
-
- @Override
- protected void doRun(IProgressMonitor progressMonitor) throws Exception
- {
- EPackage ePackage = descriptor.getEPackage();
- if (ePackage != null)
- {
- view.getSession().getPackageRegistry().put(ePackage.getNsURI(), ePackage);
- }
- else
- {
- OM.LOG.warn("Could not load descriptor for EPackage " + descriptor.getNsURI());
- }
-
- }
- }
-
- /**
* Adapter that provides the current EditingDomain
*
* @since 2.0
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
index d64f8b52e1..28bdb169b9 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
@@ -243,22 +243,24 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
boolean added = false;
CDOPackageRegistry packageRegistry = session.getPackageRegistry();
-
for (String packageURI : registeredURIs)
{
- Type type = CDOPackageTypeRegistry.INSTANCE.lookup(packageURI);
- if (type == Type.NATIVE)
+ if (!packageRegistry.containsKey(packageURI))
{
- EPackage ePackage = packageRegistry.getEPackage(packageURI);
- if (ePackage == null)
- {
- ePackage = EPackage.Registry.INSTANCE.getEPackage(packageURI);
- }
-
- if (ePackage != null)
+ Type type = CDOPackageTypeRegistry.INSTANCE.lookup(packageURI);
+ if (type == Type.NATIVE)
{
- manager.add(new RegisterSinglePackageAction(page, session, packageURI));
- added = true;
+ EPackage ePackage = packageRegistry.getEPackage(packageURI);
+ if (ePackage == null)
+ {
+ ePackage = EPackage.Registry.INSTANCE.getEPackage(packageURI);
+ }
+
+ if (ePackage != null)
+ {
+ manager.add(new RegisterSinglePackageAction(page, session, packageURI));
+ added = true;
+ }
}
}
}

Back to the top