From 68c7086726a9a853a7aa0afd24d841fb83df3f24 Mon Sep 17 00:00:00 2001
From: Eike Stepper
Date: Tue, 4 Jan 2011 20:00:09 +0000
Subject: [284307] Add support for streaming of large byte arrays / BLOB
https://bugs.eclipse.org/bugs/show_bug.cgi?id=284307
---
.../org.eclipse.emf.cdo.edit/META-INF/MANIFEST.MF | 3 +-
...eAnnotation_details_EStringToStringMapEntry.gif | Bin 0 -> 350 bytes
.../CreateModelElement_annotations_Annotation.gif | Bin 0 -> 585 bytes
.../icons/full/obj16/Annotation.gif | Bin 0 -> 554 bytes
plugins/org.eclipse.emf.cdo.edit/plugin.properties | 6 +
.../org/eclipse/emf/cdo/edit/CDOEditPlugin.java | 94 +++++++
.../eresource/provider/EresourceEditPlugin.java | 93 -------
.../EresourceItemProviderAdapterFactory.java | 3 +-
.../etypes/provider/AnnotationItemProvider.java | 187 ++++++++++++++
.../provider/EtypesItemProviderAdapterFactory.java | 275 +++++++++++++++++++++
.../etypes/provider/ModelElementItemProvider.java | 177 +++++++++++++
.../org.eclipse.emf.cdo/model/eresource.genmodel | 2 +-
plugins/org.eclipse.emf.cdo/model/etypes.genmodel | 54 ++--
.../cdo/eresource/impl/EresourcePackageImpl.java | 32 +--
.../emf/cdo/etypes/impl/EtypesPackageImpl.java | 19 +-
.../eclipse/emf/cdo/etypes/util/EtypesSwitch.java | 6 -
.../emf/internal/cdo/object/CDOLegacyAdapter.java | 1 -
17 files changed, 787 insertions(+), 165 deletions(-)
create mode 100644 plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateAnnotation_details_EStringToStringMapEntry.gif
create mode 100644 plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateModelElement_annotations_Annotation.gif
create mode 100644 plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/Annotation.gif
create mode 100644 plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOEditPlugin.java
delete mode 100644 plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceEditPlugin.java
create mode 100644 plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/AnnotationItemProvider.java
create mode 100644 plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/EtypesItemProviderAdapterFactory.java
create mode 100644 plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/ModelElementItemProvider.java
(limited to 'plugins')
diff --git a/plugins/org.eclipse.emf.cdo.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.edit/META-INF/MANIFEST.MF
index 77eeac90ab..c0a283bc57 100644
--- a/plugins/org.eclipse.emf.cdo.edit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.edit/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.eclipse.emf.cdo.eresource.provider.EresourceEditPlugin$Implementation
+Bundle-Activator: org.eclipse.emf.cdo.edit.CDOEditPlugin$Implementation
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
@@ -16,4 +16,5 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
Export-Package: org.eclipse.emf.cdo.edit;version="4.0.0",
org.eclipse.emf.cdo.eresource.provider;version="4.0.0",
+ org.eclipse.emf.cdo.etypes.provider;version="4.0.0",
org.eclipse.emf.cdo.internal.edit.messages;version="4.0.0";x-internal:=true
diff --git a/plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateAnnotation_details_EStringToStringMapEntry.gif b/plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateAnnotation_details_EStringToStringMapEntry.gif
new file mode 100644
index 0000000000..ecb89fffc7
Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateAnnotation_details_EStringToStringMapEntry.gif differ
diff --git a/plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateModelElement_annotations_Annotation.gif b/plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateModelElement_annotations_Annotation.gif
new file mode 100644
index 0000000000..588cca4118
Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateModelElement_annotations_Annotation.gif differ
diff --git a/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/Annotation.gif b/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/Annotation.gif
new file mode 100644
index 0000000000..0df81a30b2
Binary files /dev/null and b/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/Annotation.gif differ
diff --git a/plugins/org.eclipse.emf.cdo.edit/plugin.properties b/plugins/org.eclipse.emf.cdo.edit/plugin.properties
index ab735be95f..e48aafa356 100644
--- a/plugins/org.eclipse.emf.cdo.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.edit/plugin.properties
@@ -42,3 +42,9 @@ _UI_CDOResourceNode_name_feature = Name
_UI_CDOResourceNode_path_feature = Path
_UI_CDOResourceFolder_contents_feature = Contents
_UI_CDOResourceFolder_nodes_feature = Nodes
+_UI_ModelElement_type = Model Element
+_UI_Annotation_type = Annotation
+_UI_ModelElement_annotations_feature = Annotations
+_UI_Annotation_source_feature = Source
+_UI_Annotation_details_feature = Details
+_UI_Annotation_modelElement_feature = Model Element
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOEditPlugin.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOEditPlugin.java
new file mode 100644
index 0000000000..b708e140be
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOEditPlugin.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.edit;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+
+/**
+ * This is the central singleton for the Etypes edit plugin.
+ *
+ * @since 4.0
+ * @generated
+ */
+public final class CDOEditPlugin extends EMFPlugin
+{
+ /**
+ * Keep track of the singleton.
+ *
+ * @generated
+ */
+ public static final CDOEditPlugin INSTANCE = new CDOEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ *
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ *
+ * @generated
+ */
+ public CDOEditPlugin()
+ {
+ super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator()
+ {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin()
+ {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse Plugin.
+ *
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin
+ {
+ /**
+ * Creates an instance.
+ *
+ * @generated
+ */
+ public Implementation()
+ {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
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
deleted file mode 100644
index 6b63a1296a..0000000000
--- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceEditPlugin.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.eresource.provider;
-
-import org.eclipse.emf.common.EMFPlugin;
-import org.eclipse.emf.common.util.ResourceLocator;
-import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
-
-/**
- * This is the central singleton for the Eresource edit plugin.
- *
- * @generated
- */
-public final class EresourceEditPlugin extends EMFPlugin
-{
- /**
- * Keep track of the singleton.
- *
- * @generated
- */
- public static final EresourceEditPlugin INSTANCE = new EresourceEditPlugin();
-
- /**
- * Keep track of the singleton.
- *
- * @generated
- */
- private static Implementation plugin;
-
- /**
- * Create the instance.
- *
- * @generated
- */
- public EresourceEditPlugin()
- {
- super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, });
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- *
- * @return the singleton instance.
- * @generated
- */
- @Override
- public ResourceLocator getPluginResourceLocator()
- {
- return plugin;
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- *
- * @return the singleton instance.
- * @generated
- */
- public static Implementation getPlugin()
- {
- return plugin;
- }
-
- /**
- * The actual implementation of the Eclipse Plugin.
- *
- * @generated
- */
- public static class Implementation extends EclipsePlugin
- {
- /**
- * Creates an instance.
- *
- * @generated
- */
- public Implementation()
- {
- super();
-
- // Remember the static instance.
- //
- plugin = this;
- }
- }
-
-}
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 bb62c92d03..5190675e83 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
@@ -10,6 +10,7 @@
*/
package org.eclipse.emf.cdo.eresource.provider;
+import org.eclipse.emf.cdo.edit.CDOEditPlugin;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
import org.eclipse.emf.cdo.eresource.util.EresourceAdapterFactory;
@@ -74,7 +75,7 @@ public class EresourceItemProviderAdapterFactory extends EresourceAdapterFactory
* @generated
*/
protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager(
- EresourceEditPlugin.INSTANCE, EresourcePackage.eNS_URI);
+ CDOEditPlugin.INSTANCE, EresourcePackage.eNS_URI);
/**
* This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ *
+ * @since 4.0
+ * @generated
+ */
+public class AnnotationItemProvider extends ModelElementItemProvider implements IEditingDomainItemProvider,
+ IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource,
+ ITableItemLabelProvider, ITableItemColorProvider, ITableItemFontProvider, IItemColorProvider, IItemFontProvider
+{
+ /**
+ * This constructs an instance from a factory and a notifier.
+ *
+ * @generated
+ */
+ public AnnotationItemProvider(AdapterFactory adapterFactory)
+ {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ *
+ * @generated
+ */
+ @Override
+ public List getPropertyDescriptors(Object object)
+ {
+ if (itemPropertyDescriptors == null)
+ {
+ super.getPropertyDescriptors(object);
+
+ addSourcePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Source feature.
+ *
+ * @generated
+ */
+ protected void addSourcePropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Annotation_source_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_Annotation_source_feature", "_UI_Annotation_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ EtypesPackage.Literals.ANNOTATION__SOURCE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * 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
+ public Collection extends EStructuralFeature> getChildrenFeatures(Object object)
+ {
+ if (childrenFeatures == null)
+ {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(EtypesPackage.Literals.ANNOTATION__DETAILS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child)
+ {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Annotation.gif.
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object)
+ {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Annotation")); //$NON-NLS-1$
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object)
+ {
+ String label = ((Annotation)object).getSource();
+ return label == null || label.length() == 0 ? getString("_UI_Annotation_type") : //$NON-NLS-1$
+ getString("_UI_Annotation_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * 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
+ public void notifyChanged(Notification notification)
+ {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Annotation.class))
+ {
+ case EtypesPackage.ANNOTATION__SOURCE:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case EtypesPackage.ANNOTATION__DETAILS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under
+ * this object.
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection