From 6cce3aa127779a299991bd9b5a1607f47c2eae9c Mon Sep 17 00:00:00 2001 From: Eike Stepper Date: Fri, 17 Oct 2008 19:07:54 +0000 Subject: [249847] Store resources in a hierarchical structure https://bugs.eclipse.org/bugs/show_bug.cgi?id=249847 --- .../provider/CDOResourceFolderItemProvider.java | 35 ++- .../provider/CDOResourceItemProvider.java | 44 ++-- .../provider/CDOResourceNodeItemProvider.java | 38 +-- .../eresource/provider/EresourceEditPlugin.java | 32 +-- .../EresourceItemProviderAdapterFactory.java | 64 +++-- plugins/org.eclipse.emf.cdo/model/eresource.ecore | 5 +- .../org/eclipse/emf/cdo/eresource/CDOResource.java | 105 ++++----- .../emf/cdo/eresource/CDOResourceFolder.java | 10 +- .../eclipse/emf/cdo/eresource/CDOResourceNode.java | 38 +-- .../emf/cdo/eresource/EresourceFactory.java | 16 +- .../emf/cdo/eresource/EresourcePackage.java | 260 ++++++++++----------- .../cdo/eresource/impl/CDOResourceFactoryImpl.java | 4 +- .../cdo/eresource/impl/CDOResourceFolderImpl.java | 18 +- .../emf/cdo/eresource/impl/CDOResourceImpl.java | 68 +++--- .../cdo/eresource/impl/CDOResourceNodeImpl.java | 147 +++++++++++- .../cdo/eresource/impl/EresourceFactoryImpl.java | 20 +- .../cdo/eresource/impl/EresourcePackageImpl.java | 98 +++----- .../eresource/util/EresourceAdapterFactory.java | 42 ++-- .../emf/cdo/eresource/util/EresourceSwitch.java | 49 ++-- .../emf/internal/cdo/CDOTransactionImpl.java | 24 +- .../org/eclipse/emf/internal/cdo/CDOViewImpl.java | 12 +- .../org/eclipse/emf/internal/cdo/util/FSMUtil.java | 19 -- .../internal/cdo/util/ProxyResolverResource.java | 190 --------------- .../cdo/util/ProxyResolverURIResourceMap.java | 129 ---------- 24 files changed, 621 insertions(+), 846 deletions(-) delete mode 100644 plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java delete mode 100644 plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverURIResourceMap.java diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java index e9114d34bc..44ebb4e20a 100644 --- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java +++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java @@ -2,7 +2,7 @@ * * * - * $Id: CDOResourceFolderItemProvider.java,v 1.1.2.1 2008-10-14 20:39:36 estepper Exp $ + * $Id: CDOResourceFolderItemProvider.java,v 1.1.2.2 2008-10-17 19:07:53 estepper Exp $ */ package org.eclipse.emf.cdo.eresource.provider; @@ -35,8 +35,8 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** - * This constructs an instance from a factory and a notifier. - * + * This constructs an instance from a factory and a notifier. + * * @generated */ public CDOResourceFolderItemProvider(AdapterFactory adapterFactory) @@ -45,8 +45,8 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i } /** - * This returns the property descriptors for the adapted class. - * + * This returns the property descriptors for the adapted class. + * * @generated */ @Override @@ -63,9 +63,9 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * * @generated */ @Override @@ -81,7 +81,6 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i /** * - * * @generated */ @Override @@ -94,8 +93,8 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i } /** - * This returns CDOResourceFolder.gif. - * + * This returns CDOResourceFolder.gif. + * * @generated */ @Override @@ -105,8 +104,8 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. + * * @generated */ @Override @@ -118,9 +117,9 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i } /** - * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating a - * viewer notification, which it passes to {@link #fireNotifyChanged}. - * + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * * @generated */ @Override @@ -138,9 +137,9 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under - * this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * * @generated */ @Override diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java index 1ff7b4dc5a..661430382a 100644 --- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java +++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java @@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.eresource.EresourcePackage; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcoreFactory; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; @@ -31,17 +32,17 @@ import java.util.Collection; import java.util.List; /** - * This is the item provider adapter for a {@link org.eclipse.emf.cdo.eresource.CDOResource} object. - * * @generated */ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** - * This constructs an instance from a factory and a notifier. - * + * This constructs an instance from a factory and a notifier. + * * @generated */ public CDOResourceItemProvider(AdapterFactory adapterFactory) @@ -50,8 +51,8 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme } /** - * This returns the property descriptors for the adapted class. - * + * This returns the property descriptors for the adapted class. + * * @generated */ @Override @@ -71,8 +72,8 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme } /** - * This adds a property descriptor for the URI feature. - * + * This adds a property descriptor for the URI feature. + * * @generated */ protected void addURIPropertyDescriptor(Object object) @@ -85,8 +86,8 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme } /** - * This adds a property descriptor for the Modified feature. - * + * This adds a property descriptor for the Modified feature. + * * @generated */ protected void addModifiedPropertyDescriptor(Object object) @@ -99,8 +100,8 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme } /** - * This adds a property descriptor for the Loaded feature. - * + * This adds a property descriptor for the Loaded feature. + * * @generated */ protected void addLoadedPropertyDescriptor(Object object) @@ -128,8 +129,8 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme } /** - * This adds a property descriptor for the Time Stamp feature. - * + * This adds a property descriptor for the Time Stamp feature. + * * @generated */ protected void addTimeStampPropertyDescriptor(Object object) @@ -144,9 +145,9 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * * @generated */ @Override @@ -162,7 +163,6 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme /** * - * * @generated */ @Override @@ -175,8 +175,8 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme } /** - * This returns CDOResource.gif. - * + * This returns CDOResource.gif. + * * @generated */ @Override @@ -198,9 +198,9 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme } /** - * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating a - * viewer notification, which it passes to {@link #fireNotifyChanged}. - * + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * * @generated */ @Override diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceNodeItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceNodeItemProvider.java index 7be54dc222..af77aa8ca5 100644 --- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceNodeItemProvider.java +++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceNodeItemProvider.java @@ -2,7 +2,7 @@ * * * - * $Id: CDOResourceNodeItemProvider.java,v 1.1.2.1 2008-10-14 20:39:36 estepper Exp $ + * $Id: CDOResourceNodeItemProvider.java,v 1.1.2.2 2008-10-17 19:07:53 estepper Exp $ */ package org.eclipse.emf.cdo.eresource.provider; @@ -38,8 +38,8 @@ public class CDOResourceNodeItemProvider extends ItemProviderAdapter implements IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** - * This constructs an instance from a factory and a notifier. - * + * This constructs an instance from a factory and a notifier. + * * @generated */ public CDOResourceNodeItemProvider(AdapterFactory adapterFactory) @@ -48,8 +48,8 @@ public class CDOResourceNodeItemProvider extends ItemProviderAdapter implements } /** - * This returns the property descriptors for the adapted class. - * + * This returns the property descriptors for the adapted class. + * * @generated */ @Override @@ -66,8 +66,8 @@ public class CDOResourceNodeItemProvider extends ItemProviderAdapter implements } /** - * This adds a property descriptor for the Name feature. - * + * This adds a property descriptor for the Name feature. + * * @generated */ protected void addNamePropertyDescriptor(Object object) @@ -80,8 +80,8 @@ public class CDOResourceNodeItemProvider extends ItemProviderAdapter implements } /** - * This adds a property descriptor for the Path feature. - * + * This adds a property descriptor for the Path feature. + * * @generated */ protected void addPathPropertyDescriptor(Object object) @@ -94,8 +94,8 @@ public class CDOResourceNodeItemProvider extends ItemProviderAdapter implements } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. + * * @generated */ @Override @@ -107,9 +107,9 @@ public class CDOResourceNodeItemProvider extends ItemProviderAdapter implements } /** - * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating a - * viewer notification, which it passes to {@link #fireNotifyChanged}. - * + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * * @generated */ @Override @@ -128,9 +128,9 @@ public class CDOResourceNodeItemProvider extends ItemProviderAdapter implements } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under - * this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * * @generated */ @Override @@ -140,8 +140,8 @@ public class CDOResourceNodeItemProvider extends ItemProviderAdapter implements } /** - * Return the resource locator for this item provider's resources. - * + * Return the resource locator for this item provider's resources. + * * @generated */ @Override diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceEditPlugin.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceEditPlugin.java index 6ca82c8ffb..d87b74ec2f 100644 --- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceEditPlugin.java +++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceEditPlugin.java @@ -15,29 +15,29 @@ import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.provider.EcoreEditPlugin; /** - * This is the central singleton for the Eresource edit plugin. - * + * This is the central singleton for the Eresource edit plugin. + * * @generated */ public final class EresourceEditPlugin extends EMFPlugin { /** - * Keep track of the singleton. - * + * Keep track of the singleton. + * * @generated */ public static final EresourceEditPlugin INSTANCE = new EresourceEditPlugin(); /** - * Keep track of the singleton. - * + * Keep track of the singleton. + * * @generated */ private static Implementation plugin; /** - * Create the instance. - * + * Create the instance. + * * @generated */ public EresourceEditPlugin() @@ -46,8 +46,8 @@ public final class EresourceEditPlugin extends EMFPlugin } /** - * Returns the singleton instance of the Eclipse plugin. - * + * Returns the singleton instance of the Eclipse plugin. + * * @return the singleton instance. * @generated */ @@ -58,8 +58,8 @@ public final class EresourceEditPlugin extends EMFPlugin } /** - * Returns the singleton instance of the Eclipse plugin. - * + * Returns the singleton instance of the Eclipse plugin. + * * @return the singleton instance. * @generated */ @@ -69,15 +69,15 @@ public final class EresourceEditPlugin extends EMFPlugin } /** - * The actual implementation of the Eclipse Plugin. - * + * The actual implementation of the Eclipse Plugin. + * * @generated */ public static class Implementation extends EclipsePlugin { /** - * Creates an instance. - * + * Creates an instance. + * * @generated */ public Implementation() diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceItemProviderAdapterFactory.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceItemProviderAdapterFactory.java index 60396a1a28..940d8bc719 100644 --- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceItemProviderAdapterFactory.java +++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceItemProviderAdapterFactory.java @@ -48,24 +48,24 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory IChangeNotifier, IDisposable, IChildCreationExtender { /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - * * @generated */ protected ComposedAdapterFactory parentAdapterFactory; /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. - * * @generated */ protected IChangeNotifier changeNotifier = new ChangeNotifier(); /** - * This helps manage the child creation extenders. - * + * This helps manage the child creation extenders. + * * @generated */ protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager( @@ -80,8 +80,8 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory protected Collection supportedTypes = new ArrayList(); /** - * This constructs an instance. - * + * This constructs an instance. + * * @generated */ public EresourceItemProviderAdapterFactory() @@ -96,15 +96,14 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory /** * This keeps track of the one adapter used for all {@link org.eclipse.emf.cdo.eresource.CDOResourceFolder} instances. * - * * @generated */ protected CDOResourceFolderItemProvider cdoResourceFolderItemProvider; /** - * This creates an adapter for a {@link org.eclipse.emf.cdo.eresource.CDOResourceFolder}. - * * @generated */ @Override @@ -127,9 +126,9 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory protected CDOResourceItemProvider cdoResourceItemProvider; /** - * This creates an adapter for a {@link org.eclipse.emf.cdo.eresource.CDOResource}. - * * @generated */ @Override @@ -144,8 +143,8 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory } /** - * This returns the root adapter factory that contains this factory. - * + * This returns the root adapter factory that contains this factory. + * * @generated */ public ComposeableAdapterFactory getRootAdapterFactory() @@ -154,8 +153,8 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory } /** - * This sets the composed adapter factory that contains this factory. - * + * This sets the composed adapter factory that contains this factory. + * * @generated */ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) @@ -165,7 +164,6 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory /** * - * * @generated */ @Override @@ -175,9 +173,9 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory } /** - * This implementation substitutes the factory itself as the key for the adapter. - * * @generated */ @Override @@ -188,7 +186,6 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory /** * - * * @generated */ @Override @@ -197,7 +194,7 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory if (isFactoryForType(type)) { Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || ((Class)type).isInstance(adapter)) + if (!(type instanceof Class) || (((Class)type).isInstance(adapter))) { return adapter; } @@ -208,7 +205,6 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory /** * - * * @generated */ public List getChildCreationExtenders() @@ -218,7 +214,6 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory /** * - * * @generated */ public Collection getNewChildDescriptors(Object object, EditingDomain editingDomain) @@ -228,7 +223,6 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory /** * - * * @generated */ public ResourceLocator getResourceLocator() @@ -237,8 +231,8 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory } /** - * This adds a listener. - * + * This adds a listener. + * * @generated */ public void addListener(INotifyChangedListener notifyChangedListener) @@ -247,8 +241,8 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory } /** - * This removes a listener. - * + * This removes a listener. + * * @generated */ public void removeListener(INotifyChangedListener notifyChangedListener) @@ -257,9 +251,9 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory } /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - * * @generated */ public void fireNotifyChanged(Notification notification) @@ -273,20 +267,16 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory } /** - * This disposes all of the item providers created by this factory. - * + * This disposes all of the item providers created by this factory. + * * @generated */ public void dispose() { if (cdoResourceFolderItemProvider != null) - { cdoResourceFolderItemProvider.dispose(); - } if (cdoResourceItemProvider != null) - { cdoResourceItemProvider.dispose(); - } } } diff --git a/plugins/org.eclipse.emf.cdo/model/eresource.ecore b/plugins/org.eclipse.emf.cdo/model/eresource.ecore index af16f7edcf..3fc3b6d6d1 100644 --- a/plugins/org.eclipse.emf.cdo/model/eresource.ecore +++ b/plugins/org.eclipse.emf.cdo/model/eresource.ecore @@ -8,7 +8,7 @@ eOpposite="#//CDOResourceFolder/nodes"/> + volatile="true" transient="true" derived="true"/> - + diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResource.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResource.java index b1e3d4be5e..bddc685b35 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResource.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResource.java @@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.eresource; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource.Diagnostic; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; @@ -20,20 +21,22 @@ import org.eclipse.emf.ecore.resource.ResourceSet; * A representation of the model object 'CDO Resource'. * * @extends Resource - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getResourceSet Resource Set}
  • - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getURI URI}
  • - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getContents Contents}
  • - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#isModified Modified}
  • - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#isLoaded Loaded}
  • - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#isTrackingModification Tracking Modification}
  • - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getErrors Errors}
  • - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getWarnings Warnings}
  • - *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getTimeStamp Time Stamp}
  • - *
- *

+ * + *

+ * The following features are supported: + *

    + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getResourceSet Resource Set}
  • + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getURI URI}
  • + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getContents Contents}
  • + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#isModified Modified}
  • + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#isLoaded Loaded}
  • + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#isTrackingModification Tracking Modification}
  • + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getErrors Errors}
  • + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getWarnings Warnings}
  • + *
  • {@link org.eclipse.emf.cdo.eresource.CDOResource#getTimeStamp Time Stamp}
  • + *
+ *

+ * * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource() * @model * @generated @@ -41,13 +44,13 @@ import org.eclipse.emf.ecore.resource.ResourceSet; public interface CDOResource extends CDOResourceNode, Resource { /** - * Returns the value of the 'Resource Set' attribute. + * Returns the value of the 'Resource Set' attribute. + * *

* If the meaning of the 'Resource Set' attribute isn't clear, there really should be more of a description * here... *

* - * * @return the value of the 'Resource Set' attribute. * @see #setResourceSet(ResourceSet) * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource_ResourceSet() @@ -57,27 +60,25 @@ public interface CDOResource extends CDOResourceNode, Resource ResourceSet getResourceSet(); /** - * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResource#getResourceSet Resource Set}' - * attribute. - * - * @param value - * the new value of the 'Resource Set' attribute. + * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResource#getResourceSet Resource Set}' attribute. + * + * @param value the new value of the 'Resource Set' attribute. * @see #getResourceSet() * @generated */ void setResourceSet(ResourceSet value); /** - * Returns the value of the 'URI' attribute. + * Returns the value of the 'URI' attribute. + * *

* If the meaning of the 'URI' attribute isn't clear, there really should be more of a description here... *

* - * * @return the value of the 'URI' attribute. * @see #setURI(URI) * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource_URI() - * @model dataType="org.eclipse.emf.cdo.eresource.URI" transient="true" + * @model dataType="org.eclipse.emf.cdo.eresource.URI" transient="true" volatile="true" derived="true" * @generated */ URI getURI(); @@ -94,14 +95,14 @@ public interface CDOResource extends CDOResourceNode, Resource void setURI(URI value); /** - * Returns the value of the 'Contents' containment reference list. The list contents are of type - * {@link org.eclipse.emf.ecore.EObject}. + * Returns the value of the 'Contents' containment reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. + * *

* If the meaning of the 'Contents' containment reference list isn't clear, there really should be more of a * description here... *

* - * * @return the value of the 'Contents' containment reference list. * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource_Contents() * @model containment="true" @@ -110,13 +111,13 @@ public interface CDOResource extends CDOResourceNode, Resource EList getContents(); /** - * Returns the value of the 'Modified' attribute. + * Returns the value of the 'Modified' attribute. + * *

* If the meaning of the 'Modified' attribute isn't clear, there really should be more of a description * here... *

* - * * @return the value of the 'Modified' attribute. * @see #setModified(boolean) * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource_Modified() @@ -128,9 +129,7 @@ public interface CDOResource extends CDOResourceNode, Resource /** * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResource#isModified Modified}' attribute. * - * - * @param value - * the new value of the 'Modified' attribute. + * @param value the new value of the 'Modified' attribute. * @see #isModified() * @generated */ @@ -152,13 +151,13 @@ public interface CDOResource extends CDOResourceNode, Resource boolean isLoaded(); /** - * Returns the value of the 'Tracking Modification' attribute. + * Returns the value of the 'Tracking Modification' attribute. + * *

* If the meaning of the 'Tracking Modification' attribute isn't clear, there really should be more of a * description here... *

* - * * @return the value of the 'Tracking Modification' attribute. * @see #setTrackingModification(boolean) * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource_TrackingModification() @@ -168,58 +167,54 @@ public interface CDOResource extends CDOResourceNode, Resource boolean isTrackingModification(); /** - * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResource#isTrackingModification - * Tracking Modification}' attribute. - * - * @param value - * the new value of the 'Tracking Modification' attribute. + * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResource#isTrackingModification Tracking Modification}' attribute. + * + * @param value the new value of the 'Tracking Modification' attribute. * @see #isTrackingModification() * @generated */ void setTrackingModification(boolean value); /** - * Returns the value of the 'Errors' attribute list. The list contents are of type - * {@link org.eclipse.emf.ecore.resource.Resource.Diagnostic}. + * Returns the value of the 'Errors' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.resource.Resource.Diagnostic}. + * *

* If the meaning of the 'Errors' attribute list isn't clear, there really should be more of a description * here... *

* - * * @return the value of the 'Errors' attribute list. * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource_Errors() - * @model dataType="org.eclipse.emf.cdo.eresource.Diagnostic" transient="true" changeable="false" volatile="true" - * derived="true" + * @model dataType="org.eclipse.emf.cdo.eresource.Diagnostic" transient="true" changeable="false" volatile="true" derived="true" * @generated */ EList getErrors(); /** - * Returns the value of the 'Warnings' attribute list. The list contents are of type - * {@link org.eclipse.emf.ecore.resource.Resource.Diagnostic}. + * Returns the value of the 'Warnings' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.resource.Resource.Diagnostic}. + * *

* If the meaning of the 'Warnings' attribute list isn't clear, there really should be more of a description * here... *

* - * * @return the value of the 'Warnings' attribute list. * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource_Warnings() - * @model dataType="org.eclipse.emf.cdo.eresource.Diagnostic" transient="true" changeable="false" volatile="true" - * derived="true" + * @model dataType="org.eclipse.emf.cdo.eresource.Diagnostic" transient="true" changeable="false" volatile="true" derived="true" * @generated */ EList getWarnings(); /** - * Returns the value of the 'Time Stamp' attribute. + * Returns the value of the 'Time Stamp' attribute. + * *

* If the meaning of the 'Time Stamp' attribute isn't clear, there really should be more of a description * here... *

* - * * @return the value of the 'Time Stamp' attribute. * @see #setTimeStamp(long) * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResource_TimeStamp() @@ -229,11 +224,9 @@ public interface CDOResource extends CDOResourceNode, Resource long getTimeStamp(); /** - * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResource#getTimeStamp Time Stamp}' - * attribute. - * - * @param value - * the new value of the 'Time Stamp' attribute. + * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResource#getTimeStamp Time Stamp}' attribute. + * + * @param value the new value of the 'Time Stamp' attribute. * @see #getTimeStamp() * @generated */ diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java index 047373959b..1eaeadc6af 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java @@ -2,7 +2,7 @@ * * * - * $Id: CDOResourceFolder.java,v 1.1.2.1 2008-10-14 20:39:30 estepper Exp $ + * $Id: CDOResourceFolder.java,v 1.1.2.2 2008-10-17 19:07:50 estepper Exp $ */ package org.eclipse.emf.cdo.eresource; @@ -26,15 +26,15 @@ import org.eclipse.emf.common.util.EList; public interface CDOResourceFolder extends CDOResourceNode { /** - * Returns the value of the 'Nodes' containment reference list. The list contents are of type - * {@link org.eclipse.emf.cdo.eresource.CDOResourceNode}. It is bidirectional and its opposite is ' - * {@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getFolder Folder}'. + * Returns the value of the 'Nodes' containment reference list. + * The list contents are of type {@link org.eclipse.emf.cdo.eresource.CDOResourceNode}. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getFolder Folder}'. + * *

* If the meaning of the 'Nodes' containment reference list isn't clear, there really should be more of a * description here... *

* - * * @return the value of the 'Nodes' containment reference list. * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResourceFolder_Nodes() * @see org.eclipse.emf.cdo.eresource.CDOResourceNode#getFolder diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceNode.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceNode.java index beda838f38..2735131860 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceNode.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceNode.java @@ -2,7 +2,7 @@ * * * - * $Id: CDOResourceNode.java,v 1.1.2.2 2008-10-15 19:35:04 estepper Exp $ + * $Id: CDOResourceNode.java,v 1.1.2.3 2008-10-17 19:07:50 estepper Exp $ */ package org.eclipse.emf.cdo.eresource; @@ -46,14 +46,14 @@ public interface CDOResourceNode extends CDOObject public boolean isRoot(); /** - * Returns the value of the 'Folder' container reference. It is bidirectional and its opposite is ' - * {@link org.eclipse.emf.cdo.eresource.CDOResourceFolder#getNodes Nodes}'. + * Returns the value of the 'Folder' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.eresource.CDOResourceFolder#getNodes Nodes}'. + * *

* If the meaning of the 'Folder' container reference isn't clear, there really should be more of a * description here... *

* - * * @return the value of the 'Folder' container reference. * @see #setFolder(CDOResourceFolder) * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResourceNode_Folder() @@ -64,23 +64,21 @@ public interface CDOResourceNode extends CDOObject CDOResourceFolder getFolder(); /** - * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getFolder Folder}' container - * reference. - * - * @param value - * the new value of the 'Folder' container reference. + * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getFolder Folder}' container reference. + * + * @param value the new value of the 'Folder' container reference. * @see #getFolder() * @generated */ void setFolder(CDOResourceFolder value); /** - * Returns the value of the 'Name' attribute. + * Returns the value of the 'Name' attribute. + * *

* If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... *

* - * * @return the value of the 'Name' attribute. * @see #setName(String) * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResourceNode_Name() @@ -101,17 +99,29 @@ public interface CDOResourceNode extends CDOObject void setName(String value); /** - * Returns the value of the 'Path' attribute. + * Returns the value of the 'Path' attribute. + * *

* If the meaning of the 'Path' attribute isn't clear, there really should be more of a description here... *

* - * * @return the value of the 'Path' attribute. + * @see #setPath(String) * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOResourceNode_Path() - * @model transient="true" changeable="false" volatile="true" derived="true" + * @model transient="true" volatile="true" derived="true" * @generated */ String getPath(); + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getPath Path}' attribute. + * + * @param value + * the new value of the 'Path' attribute. + * @see #getPath() + * @generated + */ + void setPath(String value); + } // CDOResourceNode diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourceFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourceFactory.java index 50e830ded4..d82ad32812 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourceFactory.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourceFactory.java @@ -15,21 +15,21 @@ import org.eclipse.emf.ecore.EFactory; /** * The Factory for the model. It provides a create method for each non-abstract class of * the model. - * * @see org.eclipse.emf.cdo.eresource.EresourcePackage * @generated */ public interface EresourceFactory extends EFactory { /** - * The singleton instance of the factory. - * + * The singleton instance of the factory. + * * @generated */ EresourceFactory eINSTANCE = org.eclipse.emf.cdo.eresource.impl.EresourceFactoryImpl.init(); /** - * Returns a new object of class 'CDO Resource Folder'. + * Returns a new object of class 'CDO Resource Folder'. + * * * @since 2.0 * @return a new object of class 'CDO Resource Folder'. @@ -38,16 +38,16 @@ public interface EresourceFactory extends EFactory CDOResourceFolder createCDOResourceFolder(); /** - * Returns a new object of class 'CDO Resource'. - * + * Returns a new object of class 'CDO Resource'. + * * @return a new object of class 'CDO Resource'. * @generated */ CDOResource createCDOResource(); /** - * Returns the package supported by this factory. - * + * Returns the package supported by this factory. + * * @return the package supported by this factory. * @generated */ diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java index 60006d6e1b..f330827263 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/EresourcePackage.java @@ -25,7 +25,6 @@ import org.eclipse.emf.ecore.EReference; *
  • and each data type
  • * * - * * @see org.eclipse.emf.cdo.eresource.EresourceFactory * @model kind="package" * @generated @@ -33,36 +32,36 @@ import org.eclipse.emf.ecore.EReference; public interface EresourcePackage extends EPackage { /** - * The package name. - * + * The package name. + * * @generated */ String eNAME = "eresource"; /** - * The package namespace URI. - * + * The package namespace URI. + * * @generated */ String eNS_URI = "http://www.eclipse.org/emf/CDO/resource/1.0.0"; /** - * The package namespace name. - * + * The package namespace name. + * * @generated */ String eNS_PREFIX = "eresource"; /** - * The singleton instance of the package. - * + * The singleton instance of the package. + * * @generated */ EresourcePackage eINSTANCE = org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl.init(); /** - * The meta object id for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl - * CDO Resource Node}' class. + * The meta object id for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl CDO Resource Node}' class. + * * * @since 2.0 * @see org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl @@ -72,7 +71,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_NODE = 0; /** - * The feature id for the 'Folder' container reference. + * The feature id for the 'Folder' container reference. + * * * @since 2.0 * @generated @@ -81,7 +81,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_NODE__FOLDER = 0; /** - * The feature id for the 'Name' attribute. + * The feature id for the 'Name' attribute. + * * * @since 2.0 * @generated @@ -90,7 +91,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_NODE__NAME = 1; /** - * The feature id for the 'Path' attribute. + * The feature id for the 'Path' attribute. + * * * @since 2.0 * @generated @@ -99,7 +101,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_NODE__PATH = 2; /** - * The number of structural features of the 'CDO Resource Node' class. + * The number of structural features of the 'CDO Resource Node' class. + * * * @since 2.0 * @generated @@ -108,8 +111,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_NODE_FEATURE_COUNT = 3; /** - * The meta object id for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceFolderImpl - * CDO Resource Folder}' class. + * The meta object id for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceFolderImpl CDO Resource Folder}' class. + * * * @since 2.0 * @see org.eclipse.emf.cdo.eresource.impl.CDOResourceFolderImpl @@ -119,7 +122,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_FOLDER = 1; /** - * The feature id for the 'Folder' container reference. + * The feature id for the 'Folder' container reference. + * * * @since 2.0 * @generated @@ -128,7 +132,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_FOLDER__FOLDER = CDO_RESOURCE_NODE__FOLDER; /** - * The feature id for the 'Name' attribute. + * The feature id for the 'Name' attribute. + * * * @since 2.0 * @generated @@ -137,7 +142,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_FOLDER__NAME = CDO_RESOURCE_NODE__NAME; /** - * The feature id for the 'Path' attribute. + * The feature id for the 'Path' attribute. + * * * @since 2.0 * @generated @@ -146,7 +152,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_FOLDER__PATH = CDO_RESOURCE_NODE__PATH; /** - * The feature id for the 'Nodes' containment reference list. + * The feature id for the 'Nodes' containment reference list. + * * * @since 2.0 * @generated @@ -155,7 +162,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_FOLDER__NODES = CDO_RESOURCE_NODE_FEATURE_COUNT + 0; /** - * The number of structural features of the 'CDO Resource Folder' class. + * The number of structural features of the 'CDO Resource Folder' class. + * * * @since 2.0 * @generated @@ -164,9 +172,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_FOLDER_FEATURE_COUNT = CDO_RESOURCE_NODE_FEATURE_COUNT + 1; /** - * The meta object id for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl CDO Resource}' - * class. - * + * The meta object id for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl CDO Resource}' class. + * * @see org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl * @see org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl#getCDOResource() * @generated @@ -174,7 +181,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE = 2; /** - * The feature id for the 'Folder' container reference. + * The feature id for the 'Folder' container reference. + * * * @since 2.0 * @generated @@ -183,7 +191,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE__FOLDER = CDO_RESOURCE_NODE__FOLDER; /** - * The feature id for the 'Name' attribute. + * The feature id for the 'Name' attribute. + * * * @since 2.0 * @generated @@ -192,49 +201,49 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE__NAME = CDO_RESOURCE_NODE__NAME; /** - * The feature id for the 'Path' attribute. - * + * The feature id for the 'Path' attribute. + * * @generated * @ordered */ int CDO_RESOURCE__PATH = CDO_RESOURCE_NODE__PATH; /** - * The feature id for the 'Resource Set' attribute. - * + * The feature id for the 'Resource Set' attribute. + * * @generated * @ordered */ int CDO_RESOURCE__RESOURCE_SET = CDO_RESOURCE_NODE_FEATURE_COUNT + 0; /** - * The feature id for the 'URI' attribute. - * + * The feature id for the 'URI' attribute. + * * @generated * @ordered */ int CDO_RESOURCE__URI = CDO_RESOURCE_NODE_FEATURE_COUNT + 1; /** - * The feature id for the 'Contents' containment reference list. - * * @generated * @ordered */ int CDO_RESOURCE__CONTENTS = CDO_RESOURCE_NODE_FEATURE_COUNT + 2; /** - * The feature id for the 'Modified' attribute. - * + * The feature id for the 'Modified' attribute. + * * @generated * @ordered */ int CDO_RESOURCE__MODIFIED = CDO_RESOURCE_NODE_FEATURE_COUNT + 3; /** - * The feature id for the 'Loaded' attribute. - * + * The feature id for the 'Loaded' attribute. + * * @generated * @ordered */ @@ -250,24 +259,24 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE__TRACKING_MODIFICATION = CDO_RESOURCE_NODE_FEATURE_COUNT + 5; /** - * The feature id for the 'Errors' attribute list. - * + * The feature id for the 'Errors' attribute list. + * * @generated * @ordered */ int CDO_RESOURCE__ERRORS = CDO_RESOURCE_NODE_FEATURE_COUNT + 6; /** - * The feature id for the 'Warnings' attribute list. - * + * The feature id for the 'Warnings' attribute list. + * * @generated * @ordered */ int CDO_RESOURCE__WARNINGS = CDO_RESOURCE_NODE_FEATURE_COUNT + 7; /** - * The feature id for the 'Time Stamp' attribute. - * + * The feature id for the 'Time Stamp' attribute. + * * @generated * @ordered */ @@ -283,8 +292,8 @@ public interface EresourcePackage extends EPackage int CDO_RESOURCE_FEATURE_COUNT = CDO_RESOURCE_NODE_FEATURE_COUNT + 9; /** - * The meta object id for the 'Resource Set' data type. - * + * The meta object id for the 'Resource Set' data type. + * * @see org.eclipse.emf.ecore.resource.ResourceSet * @see org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl#getResourceSet() * @generated @@ -292,8 +301,8 @@ public interface EresourcePackage extends EPackage int RESOURCE_SET = 3; /** - * The meta object id for the 'URI' data type. - * + * The meta object id for the 'URI' data type. + * * @see org.eclipse.emf.common.util.URI * @see org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl#getURI() * @generated @@ -301,8 +310,8 @@ public interface EresourcePackage extends EPackage int URI = 4; /** - * The meta object id for the 'Diagnostic' data type. - * + * The meta object id for the 'Diagnostic' data type. + * * @see org.eclipse.emf.ecore.resource.Resource.Diagnostic * @see org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl#getDiagnostic() * @generated @@ -310,8 +319,8 @@ public interface EresourcePackage extends EPackage int DIAGNOSTIC = 5; /** - * Returns the meta object for class '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode CDO Resource Node} - * '. + * Returns the meta object for class '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode CDO Resource Node}'. + * * * @since 2.0 * @return the meta object for class 'CDO Resource Node'. @@ -321,8 +330,8 @@ public interface EresourcePackage extends EPackage EClass getCDOResourceNode(); /** - * Returns the meta object for the container reference ' - * {@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getFolder Folder}'. + * Returns the meta object for the container reference '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getFolder Folder}'. + * * * @since 2.0 * @return the meta object for the container reference 'Folder'. @@ -333,8 +342,8 @@ public interface EresourcePackage extends EPackage EReference getCDOResourceNode_Folder(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getName - * Name}'. + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getName Name}'. + * * * @since 2.0 * @return the meta object for the attribute 'Name'. @@ -345,8 +354,8 @@ public interface EresourcePackage extends EPackage EAttribute getCDOResourceNode_Name(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getPath - * Path}'. + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode#getPath Path}'. + * * * @since 2.0 * @return the meta object for the attribute 'Path'. @@ -357,8 +366,8 @@ public interface EresourcePackage extends EPackage EAttribute getCDOResourceNode_Path(); /** - * Returns the meta object for class '{@link org.eclipse.emf.cdo.eresource.CDOResourceFolder - * CDO Resource Folder}'. + * Returns the meta object for class '{@link org.eclipse.emf.cdo.eresource.CDOResourceFolder CDO Resource Folder}'. + * * * @since 2.0 * @return the meta object for class 'CDO Resource Folder'. @@ -368,8 +377,8 @@ public interface EresourcePackage extends EPackage EClass getCDOResourceFolder(); /** - * Returns the meta object for the containment reference list ' - * {@link org.eclipse.emf.cdo.eresource.CDOResourceFolder#getNodes Nodes}'. + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.eresource.CDOResourceFolder#getNodes Nodes}'. + * * * @since 2.0 * @return the meta object for the containment reference list 'Nodes'. @@ -390,9 +399,8 @@ public interface EresourcePackage extends EPackage EClass getCDOResource(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#getResourceSet - * Resource Set}'. - * + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#getResourceSet Resource Set}'. + * * @return the meta object for the attribute 'Resource Set'. * @see org.eclipse.emf.cdo.eresource.CDOResource#getResourceSet() * @see #getCDOResource() @@ -403,7 +411,6 @@ public interface EresourcePackage extends EPackage /** * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#getURI URI}'. * - * * @return the meta object for the attribute 'URI'. * @see org.eclipse.emf.cdo.eresource.CDOResource#getURI() * @see #getCDOResource() @@ -412,10 +419,9 @@ public interface EresourcePackage extends EPackage EAttribute getCDOResource_URI(); /** - * Returns the meta object for the containment reference list ' - * {@link org.eclipse.emf.cdo.eresource.CDOResource#getContents Contents}'. - * * @return the meta object for the containment reference list 'Contents'. * @see org.eclipse.emf.cdo.eresource.CDOResource#getContents() * @see #getCDOResource() @@ -424,9 +430,8 @@ public interface EresourcePackage extends EPackage EReference getCDOResource_Contents(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#isModified - * Modified}'. - * + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#isModified Modified}'. + * * @return the meta object for the attribute 'Modified'. * @see org.eclipse.emf.cdo.eresource.CDOResource#isModified() * @see #getCDOResource() @@ -435,9 +440,8 @@ public interface EresourcePackage extends EPackage EAttribute getCDOResource_Modified(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#isLoaded - * Loaded}'. - * + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#isLoaded Loaded}'. + * * @return the meta object for the attribute 'Loaded'. * @see org.eclipse.emf.cdo.eresource.CDOResource#isLoaded() * @see #getCDOResource() @@ -446,9 +450,8 @@ public interface EresourcePackage extends EPackage EAttribute getCDOResource_Loaded(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#isTrackingModification - * Tracking Modification}'. - * + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#isTrackingModification Tracking Modification}'. + * * @return the meta object for the attribute 'Tracking Modification'. * @see org.eclipse.emf.cdo.eresource.CDOResource#isTrackingModification() * @see #getCDOResource() @@ -457,9 +460,8 @@ public interface EresourcePackage extends EPackage EAttribute getCDOResource_TrackingModification(); /** - * Returns the meta object for the attribute list '{@link org.eclipse.emf.cdo.eresource.CDOResource#getErrors - * Errors}'. - * + * Returns the meta object for the attribute list '{@link org.eclipse.emf.cdo.eresource.CDOResource#getErrors Errors}'. + * * @return the meta object for the attribute list 'Errors'. * @see org.eclipse.emf.cdo.eresource.CDOResource#getErrors() * @see #getCDOResource() @@ -468,9 +470,8 @@ public interface EresourcePackage extends EPackage EAttribute getCDOResource_Errors(); /** - * Returns the meta object for the attribute list '{@link org.eclipse.emf.cdo.eresource.CDOResource#getWarnings - * Warnings}'. - * + * Returns the meta object for the attribute list '{@link org.eclipse.emf.cdo.eresource.CDOResource#getWarnings Warnings}'. + * * @return the meta object for the attribute list 'Warnings'. * @see org.eclipse.emf.cdo.eresource.CDOResource#getWarnings() * @see #getCDOResource() @@ -479,9 +480,8 @@ public interface EresourcePackage extends EPackage EAttribute getCDOResource_Warnings(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#getTimeStamp - * Time Stamp}'. - * + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.eresource.CDOResource#getTimeStamp Time Stamp}'. + * * @return the meta object for the attribute 'Time Stamp'. * @see org.eclipse.emf.cdo.eresource.CDOResource#getTimeStamp() * @see #getCDOResource() @@ -492,7 +492,6 @@ public interface EresourcePackage extends EPackage /** * Returns the meta object for data type '{@link org.eclipse.emf.ecore.resource.ResourceSet Resource Set}'. * - * * @return the meta object for data type 'Resource Set'. * @see org.eclipse.emf.ecore.resource.ResourceSet * @model instanceClass="org.eclipse.emf.ecore.resource.ResourceSet" serializeable="false" @@ -501,9 +500,9 @@ public interface EresourcePackage extends EPackage EDataType getResourceSet(); /** - * Returns the meta object for data type '{@link org.eclipse.emf.common.util.URI URI}'. - * * @return the meta object for data type 'URI'. * @see org.eclipse.emf.common.util.URI * @model instanceClass="org.eclipse.emf.common.util.URI" @@ -512,9 +511,8 @@ public interface EresourcePackage extends EPackage EDataType getURI(); /** - * Returns the meta object for data type '{@link org.eclipse.emf.ecore.resource.Resource.Diagnostic - * Diagnostic}'. - * + * Returns the meta object for data type '{@link org.eclipse.emf.ecore.resource.Resource.Diagnostic Diagnostic}'. + * * @return the meta object for data type 'Diagnostic'. * @see org.eclipse.emf.ecore.resource.Resource.Diagnostic * @model instanceClass="org.eclipse.emf.ecore.resource.Resource.Diagnostic" serializeable="false" @@ -523,8 +521,8 @@ public interface EresourcePackage extends EPackage EDataType getDiagnostic(); /** - * Returns the factory that creates the instances of the model. - * + * Returns the factory that creates the instances of the model. + * * @return the factory that creates the instances of the model. * @generated */ @@ -539,14 +537,13 @@ public interface EresourcePackage extends EPackage *
  • and each data type
  • * * - * * @generated */ interface Literals { /** - * The meta object literal for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl - * CDO Resource Node}' class. + * The meta object literal for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl CDO Resource Node}' class. + * * * @since 2.0 * @see org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl @@ -556,7 +553,8 @@ public interface EresourcePackage extends EPackage EClass CDO_RESOURCE_NODE = eINSTANCE.getCDOResourceNode(); /** - * The meta object literal for the 'Folder' container reference feature. + * The meta object literal for the 'Folder' container reference feature. + * * * @since 2.0 * @generated @@ -564,7 +562,8 @@ public interface EresourcePackage extends EPackage EReference CDO_RESOURCE_NODE__FOLDER = eINSTANCE.getCDOResourceNode_Folder(); /** - * The meta object literal for the 'Name' attribute feature. + * The meta object literal for the 'Name' attribute feature. + * * * @since 2.0 * @generated @@ -572,7 +571,8 @@ public interface EresourcePackage extends EPackage EAttribute CDO_RESOURCE_NODE__NAME = eINSTANCE.getCDOResourceNode_Name(); /** - * The meta object literal for the 'Path' attribute feature. + * The meta object literal for the 'Path' attribute feature. + * * * @since 2.0 * @generated @@ -580,8 +580,8 @@ public interface EresourcePackage extends EPackage EAttribute CDO_RESOURCE_NODE__PATH = eINSTANCE.getCDOResourceNode_Path(); /** - * The meta object literal for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceFolderImpl - * CDO Resource Folder}' class. + * The meta object literal for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceFolderImpl CDO Resource Folder}' class. + * * * @since 2.0 * @see org.eclipse.emf.cdo.eresource.impl.CDOResourceFolderImpl @@ -591,7 +591,8 @@ public interface EresourcePackage extends EPackage EClass CDO_RESOURCE_FOLDER = eINSTANCE.getCDOResourceFolder(); /** - * The meta object literal for the 'Nodes' containment reference list feature. * * @since 2.0 @@ -600,9 +601,8 @@ public interface EresourcePackage extends EPackage EReference CDO_RESOURCE_FOLDER__NODES = eINSTANCE.getCDOResourceFolder_Nodes(); /** - * The meta object literal for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl CDO Resource} - * ' class. - * + * The meta object literal for the '{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl CDO Resource}' class. + * * @see org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl * @see org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl#getCDOResource() * @generated @@ -610,17 +610,17 @@ public interface EresourcePackage extends EPackage EClass CDO_RESOURCE = eINSTANCE.getCDOResource(); /** - * The meta object literal for the 'Resource Set' attribute feature. - * * @generated */ EAttribute CDO_RESOURCE__RESOURCE_SET = eINSTANCE.getCDOResource_ResourceSet(); /** - * The meta object literal for the 'URI' attribute feature. - * * @generated */ EAttribute CDO_RESOURCE__URI = eINSTANCE.getCDOResource_URI(); @@ -634,56 +634,56 @@ public interface EresourcePackage extends EPackage EReference CDO_RESOURCE__CONTENTS = eINSTANCE.getCDOResource_Contents(); /** - * The meta object literal for the 'Modified' attribute feature. - * * @generated */ EAttribute CDO_RESOURCE__MODIFIED = eINSTANCE.getCDOResource_Modified(); /** - * The meta object literal for the 'Loaded' attribute feature. - * * @generated */ EAttribute CDO_RESOURCE__LOADED = eINSTANCE.getCDOResource_Loaded(); /** - * The meta object literal for the 'Tracking Modification' attribute feature. - * * @generated */ EAttribute CDO_RESOURCE__TRACKING_MODIFICATION = eINSTANCE.getCDOResource_TrackingModification(); /** - * The meta object literal for the 'Errors' attribute list feature. - * * @generated */ EAttribute CDO_RESOURCE__ERRORS = eINSTANCE.getCDOResource_Errors(); /** - * The meta object literal for the 'Warnings' attribute list feature. - * * @generated */ EAttribute CDO_RESOURCE__WARNINGS = eINSTANCE.getCDOResource_Warnings(); /** - * The meta object literal for the 'Time Stamp' attribute feature. - * * @generated */ EAttribute CDO_RESOURCE__TIME_STAMP = eINSTANCE.getCDOResource_TimeStamp(); /** - * The meta object literal for the 'Resource Set' data type. - * + * The meta object literal for the 'Resource Set' data type. + * * @see org.eclipse.emf.ecore.resource.ResourceSet * @see org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl#getResourceSet() * @generated @@ -691,8 +691,8 @@ public interface EresourcePackage extends EPackage EDataType RESOURCE_SET = eINSTANCE.getResourceSet(); /** - * The meta object literal for the 'URI' data type. - * + * The meta object literal for the 'URI' data type. + * * @see org.eclipse.emf.common.util.URI * @see org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl#getURI() * @generated @@ -700,8 +700,8 @@ public interface EresourcePackage extends EPackage EDataType URI = eINSTANCE.getURI(); /** - * The meta object literal for the 'Diagnostic' data type. - * + * The meta object literal for the 'Diagnostic' data type. + * * @see org.eclipse.emf.ecore.resource.Resource.Diagnostic * @see org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl#getDiagnostic() * @generated diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java index b7be97e353..da87dba0a4 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java @@ -14,7 +14,6 @@ package org.eclipse.emf.cdo.eresource.impl; import org.eclipse.emf.cdo.CDOViewSet; import org.eclipse.emf.cdo.eresource.CDOResourceFactory; -import org.eclipse.emf.cdo.eresource.EresourceFactory; import org.eclipse.emf.cdo.util.CDOURIUtil; import org.eclipse.emf.internal.cdo.CDOViewImpl; @@ -46,7 +45,6 @@ public class CDOResourceFactoryImpl implements Resource.Factory, CDOResourceFact public Resource createResource(URI uri) { - CDOResourceImpl resource = (CDOResourceImpl)EresourceFactory.eINSTANCE.createCDOResource(); // URI can be invalid or incomplete. Extract repo + resource path and build a new URI. String repositoryUUID = CDOURIUtil.extractRepositoryUUID(uri); @@ -58,7 +56,7 @@ public class CDOResourceFactoryImpl implements Resource.Factory, CDOResourceFact URI newURI = CDOURIUtil.createResourceURI(view, path); // Important: Set URI *after* registration with the view! - resource.setURI(newURI); + CDOResourceImpl resource = new CDOResourceImpl(newURI); resource.setRoot(CDOURIUtil.SEGMENT_SEPARATOR.equals(path)); resource.setExisting(isGetResource()); return resource; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFolderImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFolderImpl.java index 71d737edf0..1adaee27ce 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFolderImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFolderImpl.java @@ -2,7 +2,7 @@ * * * - * $Id: CDOResourceFolderImpl.java,v 1.1.2.3 2008-10-15 19:35:04 estepper Exp $ + * $Id: CDOResourceFolderImpl.java,v 1.1.2.4 2008-10-17 19:07:51 estepper Exp $ */ package org.eclipse.emf.cdo.eresource.impl; @@ -17,19 +17,19 @@ import org.eclipse.emf.ecore.EClass; * An implementation of the model object 'CDO Resource Folder'. * * @since 2.0 - *

    - * The following features are implemented: - *

      - *
    • {@link org.eclipse.emf.cdo.eresource.impl.CDOResourceFolderImpl#getNodes Nodes}
    • - *
    - *

    + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.emf.cdo.eresource.impl.CDOResourceFolderImpl#getNodes Nodes}
    • + *
    + *

    + * * @generated */ public class CDOResourceFolderImpl extends CDOResourceNodeImpl implements CDOResourceFolder { /** * - * * @generated */ protected CDOResourceFolderImpl() @@ -63,7 +63,6 @@ public class CDOResourceFolderImpl extends CDOResourceNodeImpl implements CDORes /** * - * * @generated */ @Override @@ -74,7 +73,6 @@ public class CDOResourceFolderImpl extends CDOResourceNodeImpl implements CDORes /** * - * * @generated */ @SuppressWarnings("unchecked") 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 1d8a9a80f8..f74113e115 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 @@ -19,7 +19,6 @@ import org.eclipse.emf.cdo.CDOView; import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.id.CDOIDUtil; import org.eclipse.emf.cdo.eresource.CDOResource; -import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.EresourcePackage; import org.eclipse.emf.cdo.util.CDOURIUtil; import org.eclipse.emf.cdo.util.ObjectNotFoundException; @@ -30,8 +29,6 @@ import org.eclipse.emf.internal.cdo.CDOViewImpl; import org.eclipse.emf.internal.cdo.InternalCDOObject; import org.eclipse.emf.internal.cdo.util.FSMUtil; -import org.eclipse.net4j.util.ObjectUtil; - import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.notify.impl.NotificationChainImpl; @@ -95,6 +92,11 @@ public class CDOResourceImpl extends CDOResourceNodeImpl implements CDOResource, */ private boolean root; + /** + * @ADDED + */ + private URI initialURI; + /** * @ADDED */ @@ -120,6 +122,15 @@ public class CDOResourceImpl extends CDOResourceNodeImpl implements CDOResource, */ private EList warnings; + /** + * @ADDED + * @since 2.0 + */ + public CDOResourceImpl(URI initialURI) + { + this.initialURI = initialURI; + } + /** * * @@ -175,15 +186,31 @@ public class CDOResourceImpl extends CDOResourceNodeImpl implements CDOResource, } /** - * + * * + * @since 2.0 * @generated */ - public URI getURI() + public URI getURIGen() { return (URI)eGet(EresourcePackage.Literals.CDO_RESOURCE__URI, true); } + /** + * + * + * @generated NOT + */ + public URI getURI() + { + if (initialURI != null) + { + return initialURI; + } + + return CDOURIUtil.createResourceURI(cdoView(), getPath()); + } + /** * * @@ -202,29 +229,8 @@ public class CDOResourceImpl extends CDOResourceNodeImpl implements CDOResource, */ public void setURI(URI newURI) { - URI oldURI = getURI(); - if (!ObjectUtil.equals(oldURI, newURI)) - { - setURIGen(newURI); - - CDOViewImpl view = cdoView(); - if (view != null) - { - handleChangedURI(view, newURI); - } - } - } - - /** - * @ADDED - * @since 2.0 - */ - public void handleChangedURI(CDOViewImpl view, URI newURI) - { - String[] folderAndName = CDOURIUtil.extractResourceFolderAndName(newURI); - CDOResourceFolder folder = view.getResourceFolder(folderAndName[0]); - setFolder(folder); - setName(folderAndName[1]); + String newPath = CDOURIUtil.extractResourcePath(newURI); + setPath(newPath); } /** @@ -287,6 +293,11 @@ public class CDOResourceImpl extends CDOResourceNodeImpl implements CDOResource, */ private Notification setLoaded(boolean isLoaded) { + if (isLoaded) + { + initialURI = null; + } + boolean oldIsLoaded = loaded; loaded = isLoaded; @@ -306,6 +317,7 @@ public class CDOResourceImpl extends CDOResourceNodeImpl implements CDOResource, return EresourcePackage.CDO_RESOURCE__LOADED; } }; + return notification; } else diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceNodeImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceNodeImpl.java index 7a5f74779a..b1f8261cda 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceNodeImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceNodeImpl.java @@ -2,18 +2,25 @@ * * * - * $Id: CDOResourceNodeImpl.java,v 1.1.2.1 2008-10-14 20:39:30 estepper Exp $ + * $Id: CDOResourceNodeImpl.java,v 1.1.2.2 2008-10-17 19:07:51 estepper Exp $ */ package org.eclipse.emf.cdo.eresource.impl; +import org.eclipse.emf.cdo.common.util.CDOException; import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.CDOResourceNode; import org.eclipse.emf.cdo.eresource.EresourcePackage; +import org.eclipse.emf.cdo.util.CDOURIUtil; import org.eclipse.emf.internal.cdo.CDOObjectImpl; +import org.eclipse.emf.internal.cdo.CDOTransactionImpl; + +import org.eclipse.net4j.util.ObjectUtil; import org.eclipse.emf.ecore.EClass; +import java.util.List; + /** * An implementation of the model object 'CDO Resource Node'. @@ -78,11 +85,41 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe * * @generated */ - public void setFolder(CDOResourceFolder newFolder) + public void setFolderGen(CDOResourceFolder newFolder) { eSet(EresourcePackage.Literals.CDO_RESOURCE_NODE__FOLDER, newFolder); } + /** + * + * + * @generated NOT + */ + public void setFolder(CDOResourceFolder newFolder) + { + String oldPath = getPath(); + basicSetFolder(newFolder, true); + adjustContainedResources(oldPath); + } + + /** + * @ADDED + */ + public void basicSetFolder(CDOResourceFolder newFolder, boolean checkDuplicates) + { + CDOResourceFolder oldFolder = getFolder(); + if (!ObjectUtil.equals(oldFolder, newFolder)) + { + if (checkDuplicates) + { + String newPath = (newFolder == null ? "" : newFolder.getPath()) + CDOURIUtil.SEGMENT_SEPARATOR + getName(); + checkDuplicates(newPath); + } + + setFolderGen(newFolder); + } + } + /** * * @@ -98,11 +135,42 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe * * @generated */ - public void setName(String newName) + public void setNameGen(String newName) { eSet(EresourcePackage.Literals.CDO_RESOURCE_NODE__NAME, newName); } + /** + * + * + * @generated NOT + */ + public void setName(String newName) + { + String oldPath = getPath(); + basicSetName(newName, true); + adjustContainedResources(oldPath); + } + + /** + * @ADDED + */ + public void basicSetName(String newName, boolean checkDuplicates) + { + String oldName = getName(); + if (!ObjectUtil.equals(oldName, newName)) + { + if (checkDuplicates) + { + CDOResourceFolder parent = getFolder(); + String newPath = (parent == null ? "" : parent.getPath()) + CDOURIUtil.SEGMENT_SEPARATOR + getName(); + checkDuplicates(newPath); + } + + setNameGen(newName); + } + } + /** * * @@ -118,4 +186,77 @@ public abstract class CDOResourceNodeImpl extends CDOObjectImpl implements CDORe return folder.getPath() + "/" + getName(); } + + /** + * + * + * @generated NOT + */ + public void setPath(String newPath) + { + CDOTransactionImpl transaction = cdoView().toTransaction(); + if (newPath == null) + { + throw new CDOException("Null path is not allowed"); + } + + String oldPath = getPath(); + if (!ObjectUtil.equals(oldPath, newPath)) + { + // TODO check for duplicates + List names = CDOURIUtil.analyzePath(newPath); + if (names.isEmpty()) + { + throw new CDOException("Root path is not allowed"); + } + + String newName = names.remove(names.size() - 1); + CDOResourceFolder newFolder = transaction.getOrCreateResourceFolder(names); + basicSetFolder(newFolder, false); + basicSetName(newName, false); + + adjustContainedResources(oldPath); + } + } + + /** + * @ADDED + */ + private void adjustContainedResources(String oldPath) + { + // ResourceSet resourceSet = cdoView().getViewSet().getResourceSet(); + // EList resources = resourceSet.getResources(); + // for (Resource resource : resources.toArray(new Resource[resources.size()])) + // { + // if (resource instanceof CDOResource) + // { + // CDOResource cdoResource = (CDOResource)resource; + // String path = cdoResource.getPath(); + // // if (ObjectUtil.equals(path, oldPath)) + // // { + // // // Don't handle *this* node + // // continue; + // // } + // + // if (path.startsWith(oldPath)) + // { + // } + // } + // } + } + + /** + * @ADDED + */ + private void checkDuplicates(String newPath) + { + try + { + cdoView().getResourceID(newPath); + } + catch (Exception ex) + { + throw new CDOException("Duplicate path: " + newPath); + } + } } // CDOResourceNodeImpl diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourceFactoryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourceFactoryImpl.java index d15d3a6cdb..9ac655f3d0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourceFactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourceFactoryImpl.java @@ -10,6 +10,7 @@ **************************************************************************/ package org.eclipse.emf.cdo.eresource.impl; +import org.eclipse.emf.cdo.eresource.*; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.EresourceFactory; @@ -25,14 +26,13 @@ import org.eclipse.emf.ecore.plugin.EcorePlugin; /** * An implementation of the model Factory. - * * @generated */ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFactory { /** - * Creates the default factory implementation. - * + * Creates the default factory implementation. + * * @generated */ public static EresourceFactory init() @@ -54,8 +54,8 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto } /** - * Creates an instance of the factory. - * + * Creates an instance of the factory. + * * @generated */ public EresourceFactoryImpl() @@ -65,7 +65,6 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto /** * - * * @generated */ @Override @@ -74,9 +73,9 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto switch (eClass.getClassifierID()) { case EresourcePackage.CDO_RESOURCE_FOLDER: - return createCDOResourceFolder(); + return (EObject)createCDOResourceFolder(); case EresourcePackage.CDO_RESOURCE: - return createCDOResource(); + return (EObject)createCDOResource(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -84,7 +83,6 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto /** * - * * @generated */ @Override @@ -101,7 +99,6 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto /** * - * * @generated */ @Override @@ -130,7 +127,6 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto /** * - * * @generated */ public CDOResource createCDOResource() @@ -161,7 +157,6 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto /** * - * * @generated */ public EresourcePackage getEresourcePackage() @@ -171,7 +166,6 @@ public class EresourceFactoryImpl extends EFactoryImpl implements EresourceFacto /** * - * * @deprecated * @generated */ diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourcePackageImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourcePackageImpl.java index 0945a393d0..0dfb9ef2e3 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourcePackageImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/EresourcePackageImpl.java @@ -28,49 +28,42 @@ import org.eclipse.emf.ecore.resource.Resource.Diagnostic; /** * An implementation of the model Package. - * * @generated */ public class EresourcePackageImpl extends EPackageImpl implements EresourcePackage { /** * - * * @generated */ private EClass cdoResourceNodeEClass = null; /** * - * * @generated */ private EClass cdoResourceFolderEClass = null; /** * - * * @generated */ private EClass cdoResourceEClass = null; /** * - * * @generated */ private EDataType resourceSetEDataType = null; /** * - * * @generated */ private EDataType uriEDataType = null; /** * - * * @generated */ private EDataType diagnosticEDataType = null; @@ -95,24 +88,27 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ private static boolean isInited = false; /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * Simple dependencies are satisfied by calling this method on all dependent packages before doing anything else. This - * method drives initialization for interdependent packages directly, in parallel with this package, itself. - *

    - * Of this package and its interdependencies, all packages which have not yet been registered by their URI values are - * first created and registered. The packages are then initialized in two steps: meta-model objects for all of the - * packages are created before any are initialized, since one package's meta-model objects may refer to those of - * another. - *

    - * Invocation of this method will not affect any packages that have already been initialized. + * Creates, registers, and initializes the Package for this + * model, and for any others upon which it depends. Simple + * dependencies are satisfied by calling this method on all + * dependent packages before doing anything else. This method drives + * initialization for interdependent packages directly, in parallel + * with this package, itself. + *

    Of this package and its interdependencies, all packages which + * have not yet been registered by their URI values are first created + * and registered. The packages are then initialized in two steps: + * meta-model objects for all of the packages are created before any + * are initialized, since one package's meta-model objects may refer to + * those of another. + *

    Invocation of this method will not affect any packages that have + * already been initialized. + * * - * * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() @@ -121,9 +117,7 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka public static EresourcePackage init() { if (isInited) - { return (EresourcePackage)EPackage.Registry.INSTANCE.getEPackage(EresourcePackage.eNS_URI); - } // Obtain or create and register package EresourcePackageImpl theEresourcePackage = (EresourcePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EresourcePackageImpl ? EPackage.Registry.INSTANCE @@ -215,7 +209,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EClass getCDOResource() @@ -225,7 +218,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EAttribute getCDOResource_ResourceSet() @@ -235,7 +227,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EAttribute getCDOResource_URI() @@ -245,7 +236,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EReference getCDOResource_Contents() @@ -255,7 +245,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EAttribute getCDOResource_Modified() @@ -265,7 +254,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EAttribute getCDOResource_Loaded() @@ -275,7 +263,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EAttribute getCDOResource_TrackingModification() @@ -285,7 +272,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EAttribute getCDOResource_Errors() @@ -295,7 +281,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EAttribute getCDOResource_Warnings() @@ -305,7 +290,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EAttribute getCDOResource_TimeStamp() @@ -315,7 +299,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EDataType getResourceSet() @@ -325,7 +308,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EDataType getURI() @@ -335,7 +317,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EDataType getDiagnostic() @@ -345,7 +326,6 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ public EresourceFactory getEresourceFactory() @@ -355,23 +335,20 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ private boolean isCreated = false; /** - * Creates the meta-model objects for the package. This method is guarded to have no affect on any invocation but its - * first. - * + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * * @generated */ public void createPackageContents() { if (isCreated) - { return; - } isCreated = true; // Create classes and their features @@ -402,23 +379,20 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka /** * - * * @generated */ private boolean isInitialized = false; /** - * Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any - * invocation but its first. - * + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * * @generated */ public void initializePackageContents() { if (isInitialized) - { return; - } isInitialized = true; // Initialize package @@ -434,32 +408,32 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka // Set bounds for type parameters // Add supertypes to classes - cdoResourceFolderEClass.getESuperTypes().add(getCDOResourceNode()); - cdoResourceEClass.getESuperTypes().add(getCDOResourceNode()); + cdoResourceFolderEClass.getESuperTypes().add(this.getCDOResourceNode()); + cdoResourceEClass.getESuperTypes().add(this.getCDOResourceNode()); // Initialize classes and features; add operations and parameters initEClass(cdoResourceNodeEClass, CDOResourceNode.class, "CDOResourceNode", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCDOResourceNode_Folder(), getCDOResourceFolder(), getCDOResourceFolder_Nodes(), "folder", null, - 0, 1, CDOResourceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, - !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCDOResourceNode_Folder(), this.getCDOResourceFolder(), this.getCDOResourceFolder_Nodes(), + "folder", null, 0, 1, CDOResourceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getCDOResourceNode_Name(), ecorePackage.getEString(), "name", null, 0, 1, CDOResourceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getCDOResourceNode_Path(), ecorePackage.getEString(), "path", null, 0, 1, CDOResourceNode.class, - IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEClass(cdoResourceFolderEClass, CDOResourceFolder.class, "CDOResourceFolder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCDOResourceFolder_Nodes(), getCDOResourceNode(), getCDOResourceNode_Folder(), "nodes", null, 0, - -1, CDOResourceFolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, - !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCDOResourceFolder_Nodes(), this.getCDOResourceNode(), this.getCDOResourceNode_Folder(), "nodes", + null, 0, -1, CDOResourceFolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(cdoResourceEClass, CDOResource.class, "CDOResource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getCDOResource_ResourceSet(), getResourceSet(), "resourceSet", null, 0, 1, CDOResource.class, + initEAttribute(getCDOResource_ResourceSet(), this.getResourceSet(), "resourceSet", null, 0, 1, CDOResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_URI(), getURI(), "uRI", null, 0, 1, CDOResource.class, IS_TRANSIENT, !IS_VOLATILE, - IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getCDOResource_URI(), this.getURI(), "uRI", null, 0, 1, CDOResource.class, IS_TRANSIENT, + IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEReference(getCDOResource_Contents(), theEcorePackage.getEObject(), null, "contents", null, 0, -1, CDOResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -470,9 +444,9 @@ public class EresourcePackageImpl extends EPackageImpl implements EresourcePacka initEAttribute(getCDOResource_TrackingModification(), ecorePackage.getEBoolean(), "trackingModification", null, 0, 1, CDOResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_Errors(), getDiagnostic(), "errors", null, 0, -1, CDOResource.class, IS_TRANSIENT, - IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEAttribute(getCDOResource_Warnings(), getDiagnostic(), "warnings", null, 0, -1, CDOResource.class, + initEAttribute(getCDOResource_Errors(), this.getDiagnostic(), "errors", null, 0, -1, CDOResource.class, + IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getCDOResource_Warnings(), this.getDiagnostic(), "warnings", null, 0, -1, CDOResource.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEAttribute(getCDOResource_TimeStamp(), theEcorePackage.getELong(), "timeStamp", null, 0, 1, CDOResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java index b682d6a099..6ac82ece25 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java @@ -10,6 +10,7 @@ **************************************************************************/ package org.eclipse.emf.cdo.eresource.util; +import org.eclipse.emf.cdo.eresource.*; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.CDOResourceNode; @@ -23,22 +24,21 @@ import org.eclipse.emf.ecore.EObject; /** * The Adapter Factory for the model. It provides an adapter createXXX * method for each class of the model. - * * @see org.eclipse.emf.cdo.eresource.EresourcePackage * @generated */ public class EresourceAdapterFactory extends AdapterFactoryImpl { /** - * The cached model package. - * + * The cached model package. + * * @generated */ protected static EresourcePackage modelPackage; /** - * Creates an instance of the adapter factory. - * + * Creates an instance of the adapter factory. + * * @generated */ public EresourceAdapterFactory() @@ -50,10 +50,10 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl } /** - * Returns whether this factory is applicable for the type of the object. This implementation + * Returns whether this factory is applicable for the type of the object. + * This implementation * returns true if the object is either the model's package or is an instance object of the model. - * * @return whether this factory is applicable for the type of the object. * @generated */ @@ -72,8 +72,8 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl } /** - * The switch that delegates to the createXXX methods. - * + * The switch that delegates to the createXXX methods. + * * @generated */ protected EresourceSwitch modelSwitch = new EresourceSwitch() @@ -104,10 +104,9 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl }; /** - * Creates an adapter for the target. - * - * @param target - * the object to adapt. + * Creates an adapter for the target. + * + * @param target the object to adapt. * @return the adapter for the target. * @generated */ @@ -118,8 +117,8 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode - * CDO Resource Node}'. This default implementation returns null so that we can + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode CDO Resource Node}'. + * This default implementation returns null so that we can * easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @since 2.0 @@ -133,8 +132,8 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResourceFolder - * CDO Resource Folder}'. This default implementation returns null so that we can + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResourceFolder CDO Resource Folder}'. + * This default implementation returns null so that we can * easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. * * @since 2.0 @@ -148,10 +147,9 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResource - * CDO Resource}'. This default implementation returns null so that we can easily + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResource CDO Resource}'. + * This default implementation returns null so that we can easily * ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. - * * @return the new adapter. * @see org.eclipse.emf.cdo.eresource.CDOResource * @generated @@ -162,9 +160,9 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for the default case. This default implementation returns null. This default implementation returns null. - * * @return the new adapter. * @generated */ diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java index 6075a7f16e..76ef67a35c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java @@ -19,28 +19,28 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import java.util.List; +import org.eclipse.emf.cdo.eresource.*; /** * The Switch for the model's inheritance hierarchy. It supports the call * {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, * starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is * returned, which is the result of the switch. - * * @see org.eclipse.emf.cdo.eresource.EresourcePackage * @generated */ public class EresourceSwitch { /** - * The cached model package - * + * The cached model package + * * @generated */ protected static EresourcePackage modelPackage; /** - * Creates an instance of the switch. - * + * Creates an instance of the switch. + * * @generated */ public EresourceSwitch() @@ -54,7 +54,6 @@ public class EresourceSwitch /** * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. * - * * @return the first non-null result returned by a caseXXX call. * @generated */ @@ -66,7 +65,6 @@ public class EresourceSwitch /** * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. * - * * @return the first non-null result returned by a caseXXX call. * @generated */ @@ -86,7 +84,6 @@ public class EresourceSwitch /** * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. * - * * @return the first non-null result returned by a caseXXX call. * @generated */ @@ -99,9 +96,7 @@ public class EresourceSwitch CDOResourceNode cdoResourceNode = (CDOResourceNode)theEObject; T result = caseCDOResourceNode(cdoResourceNode); if (result == null) - { result = defaultCase(theEObject); - } return result; } case EresourcePackage.CDO_RESOURCE_FOLDER: @@ -109,13 +104,9 @@ public class EresourceSwitch CDOResourceFolder cdoResourceFolder = (CDOResourceFolder)theEObject; T result = caseCDOResourceFolder(cdoResourceFolder); if (result == null) - { result = caseCDOResourceNode(cdoResourceFolder); - } if (result == null) - { result = defaultCase(theEObject); - } return result; } case EresourcePackage.CDO_RESOURCE: @@ -123,13 +114,9 @@ public class EresourceSwitch CDOResource cdoResource = (CDOResource)theEObject; T result = caseCDOResource(cdoResource); if (result == null) - { result = caseCDOResourceNode(cdoResource); - } if (result == null) - { result = defaultCase(theEObject); - } return result; } default: @@ -138,12 +125,12 @@ public class EresourceSwitch } /** - * Returns the result of interpreting the object as an instance of 'CDO Resource Node'. This implementation returns null; returning a non-null result will terminate the switch. * * @since 2.0 - * @param object - * the target of the switch. + * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'CDO Resource Node'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated @@ -154,12 +141,12 @@ public class EresourceSwitch } /** - * Returns the result of interpreting the object as an instance of 'CDO Resource Folder'. This implementation returns null; returning a non-null result will terminate the switch. * * @since 2.0 - * @param object - * the target of the switch. + * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'CDO Resource Folder'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated @@ -170,11 +157,10 @@ public class EresourceSwitch } /** - * Returns the result of interpreting the object as an instance of 'CDO Resource'. + * Returns the result of interpreting the object as an instance of 'CDO Resource'. + * * This implementation returns null; returning a non-null result will terminate the switch. - * - * @param object - * the target of the switch. + * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'CDO Resource'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated @@ -185,12 +171,11 @@ public class EresourceSwitch } /** - * Returns the result of interpreting the object as an instance of 'EObject'. This + * Returns the result of interpreting the object as an instance of 'EObject'. + * This * implementation returns null; returning a non-null result will terminate the switch, but this is the last case * anyway. - * - * @param object - * the target of the switch. + * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'EObject'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated 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 cdd1dfb691..5ae27d134c 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 @@ -35,6 +35,7 @@ import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.CDOResourceNode; import org.eclipse.emf.cdo.eresource.EresourceFactory; import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl; +import org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl; import org.eclipse.emf.cdo.spi.common.InternalCDOPackage; import org.eclipse.emf.cdo.spi.common.InternalCDORevision; import org.eclipse.emf.cdo.spi.common.InternalCDORevisionDelta; @@ -236,6 +237,16 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa List names = CDOURIUtil.analyzePath(uri); String resourceName = names.isEmpty() ? null : names.remove(names.size() - 1); + CDOResourceFolder folder = getOrCreateResourceFolder(names); + attachNewResourceNode(folder, resourceName, resource); + } + + /** + * @return never null; + * @since 2.0 + */ + public CDOResourceFolder getOrCreateResourceFolder(List names) + { CDOResourceFolder folder = null; for (String name : names) { @@ -262,26 +273,27 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa } } - attachNewResourceNode(folder, resourceName, resource); + return folder; } private void attachNewResourceNode(CDOResourceFolder folder, String name, CDOResourceNode newNode) { - newNode.setName(name); + CDOResourceNodeImpl node = (CDOResourceNodeImpl)newNode; + node.basicSetName(name, false); if (folder == null) { - if (newNode.isRoot()) + if (node.isRoot()) { - CDOStateMachine.INSTANCE.attach((InternalCDOObject)newNode, this); + CDOStateMachine.INSTANCE.attach(node, this); } else { - getRootResource().getContents().add(newNode); + getRootResource().getContents().add(node); } } else { - newNode.setFolder(folder); + node.basicSetFolder(folder, false); } } 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 3747c3acd4..6e92d99b73 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 @@ -340,9 +340,10 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement } /** + * @return never null * @since 2.0 */ - protected CDOID getResourceID(String path) + public CDOID getResourceID(String path) { if (StringUtil.isEmpty(path)) { @@ -366,6 +367,9 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement return folderID; } + /** + * @retrn never null + */ private CDOID getResourceID(CDOID folderID, String name) { folderID = getResourceNodeID(folderID, name); @@ -373,6 +377,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement { throw new CDOException("Can not find " + name); } + return folderID; } @@ -496,8 +501,11 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement } /** + * TODO Remove me + * * @since 2.0 */ + @Deprecated public CDOResourceFolder getResourceFolder(String path) { if (path == null) @@ -805,7 +813,7 @@ public class CDOViewImpl extends org.eclipse.net4j.util.event.Notifier implement protected void cleanObject(InternalCDOObject object, InternalCDORevision revision) { object.cdoInternalCleanup(); - + object.cdoInternalSetView(this); object.cdoInternalSetRevision(revision); object.cdoInternalSetID(revision.getID()); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java index 254289eee5..2b4d43a2bb 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java @@ -28,22 +28,17 @@ import org.eclipse.emf.internal.cdo.CDOViewImpl; import org.eclipse.emf.internal.cdo.CDOViewSetImpl; import org.eclipse.emf.internal.cdo.InternalCDOObject; -import org.eclipse.net4j.util.ImplementationError; - import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EGenericType; import org.eclipse.emf.ecore.EModelElement; import org.eclipse.emf.ecore.EObject; 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.ResourceSetImpl; import org.eclipse.emf.ecore.util.EcoreUtil; import java.util.Collection; import java.util.Iterator; -import java.util.Map; /** * @author Eike Stepper @@ -281,22 +276,8 @@ public final class FSMUtil synchronized (resourceSet) { viewSet = (CDOViewSetImpl)CDOUtil.getViewSet(resourceSet); - if (viewSet == null) { - if (resourceSet instanceof ResourceSetImpl) - { - Map resourceMap = null; - ResourceSetImpl rs = (ResourceSetImpl)resourceSet; - resourceMap = rs.getURIResourceMap(); - rs.setURIResourceMap(new ProxyResolverURIResourceMap(null, resourceMap)); - } - else - { - throw new ImplementationError("Not a " + ResourceSetImpl.class.getName() + ": " - + resourceSet.getClass().getName()); - } - viewSet = new CDOViewSetImpl(); resourceSet.eAdapters().add(viewSet); } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java deleted file mode 100644 index 1e4f98d4f1..0000000000 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java +++ /dev/null @@ -1,190 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2004 - 2008 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.internal.cdo.util; - -import org.eclipse.emf.internal.cdo.CDOViewImpl; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.TreeIterator; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Map; - -/** - * @author Eike Stepper - */ -final class ProxyResolverResource implements Resource -{ - @SuppressWarnings("unused") - private CDOViewImpl view; - - public ProxyResolverResource(CDOViewImpl view) - { - this.view = view; - } - - /* - * @ADDED Called by {@link ResourceSetImpl#getResource(URI, boolean)} - */ - public boolean isLoaded() - { - return true; - } - - /* - * @ADDED Called by {@link ResourceSetImpl#getEObject(URI, boolean)} - */ - public EObject getEObject(String uriFragment) - { - // TODO Implement me - throw new UnsupportedOperationException("Not yet implemented"); - // CDOID id = CDOIDUtil.create(Long.parseLong(uriFragment)); - // InternalCDOObject object = view.getObject(id); - // InternalEObject instance = object.cdoInternalInstance(); - // if (instance instanceof CDOAdapterImpl) - // { - // if (object.cdoState() == CDOState.PROXY) - // { - // object.cdoInternalPostLoad(); - // } - // } - // - // return instance; - } - - public TreeIterator getAllContents() - { - throw new UnsupportedOperationException(); - } - - public EList getContents() - { - throw new UnsupportedOperationException(); - } - - public EList getErrors() - { - throw new UnsupportedOperationException(); - } - - public ResourceSet getResourceSet() - { - throw new UnsupportedOperationException(); - } - - public URI getURI() - { - throw new UnsupportedOperationException(); - } - - public String getURIFragment(EObject object) - { - throw new UnsupportedOperationException(); - } - - public void delete(Map options) throws IOException - { - throw new UnsupportedOperationException(); - } - - public long getTimeStamp() - { - throw new UnsupportedOperationException(); - } - - public void setTimeStamp(long timeStamp) - { - throw new UnsupportedOperationException(); - } - - public EList getWarnings() - { - throw new UnsupportedOperationException(); - } - - public boolean isModified() - { - throw new UnsupportedOperationException(); - } - - public boolean isTrackingModification() - { - throw new UnsupportedOperationException(); - } - - public void load(Map options) throws IOException - { - throw new UnsupportedOperationException(); - } - - public void load(InputStream inputStream, Map options) throws IOException - { - throw new UnsupportedOperationException(); - } - - public void save(Map options) throws IOException - { - throw new UnsupportedOperationException(); - } - - public void save(OutputStream outputStream, Map options) throws IOException - { - throw new UnsupportedOperationException(); - } - - public void setModified(boolean isModified) - { - throw new UnsupportedOperationException(); - } - - public void setTrackingModification(boolean isTrackingModification) - { - throw new UnsupportedOperationException(); - } - - public void setURI(URI uri) - { - throw new UnsupportedOperationException(); - } - - public void unload() - { - throw new UnsupportedOperationException(); - } - - public EList eAdapters() - { - throw new UnsupportedOperationException(); - } - - public boolean eDeliver() - { - throw new UnsupportedOperationException(); - } - - public void eNotify(Notification notification) - { - throw new UnsupportedOperationException(); - } - - public void eSetDeliver(boolean deliver) - { - throw new UnsupportedOperationException(); - } -} diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverURIResourceMap.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverURIResourceMap.java deleted file mode 100644 index df14a5ede6..0000000000 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverURIResourceMap.java +++ /dev/null @@ -1,129 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2004 - 2008 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.internal.cdo.util; - -import org.eclipse.emf.internal.cdo.CDOViewImpl; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -/** - * @author Eike Stepper - */ -public final class ProxyResolverURIResourceMap implements Map -{ - private Map delegate; - - private Resource proxyResolverResource; - - public ProxyResolverURIResourceMap(CDOViewImpl view, Map delegate) - { - if (delegate == null) - { - delegate = new HashMap(); // TODO Cleanup of this lookup - // cache? - } - - this.delegate = delegate; - proxyResolverResource = new ProxyResolverResource(view); - } - - public Resource get(Object key) - { - if (key instanceof URI) - { - URI uri = (URI)key; - String scheme = uri.scheme(); - if ("cdo".equals(scheme)) - { - String opaquePart = uri.opaquePart(); - if ("proxy".equals(opaquePart)) - { - return proxyResolverResource; - } - } - } - - return delegate.get(key); - } - - public void clear() - { - delegate.clear(); - } - - public boolean containsKey(Object key) - { - return delegate.containsKey(key); - } - - public boolean containsValue(Object value) - { - return delegate.containsValue(value); - } - - public Set> entrySet() - { - return delegate.entrySet(); - } - - @Override - public boolean equals(Object o) - { - return delegate.equals(o); - } - - @Override - public int hashCode() - { - return delegate.hashCode(); - } - - public boolean isEmpty() - { - return delegate.isEmpty(); - } - - public Set keySet() - { - return delegate.keySet(); - } - - public Resource put(URI key, Resource value) - { - return delegate.put(key, value); - } - - public void putAll(Map t) - { - delegate.putAll(t); - } - - public Resource remove(Object key) - { - return delegate.remove(key); - } - - public int size() - { - return delegate.size(); - } - - public Collection values() - { - return delegate.values(); - } -} -- cgit v1.2.3