Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.edit')
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateAnnotation_details_EStringToStringMapEntry.gifbin0 -> 350 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateModelElement_annotations_Annotation.gifbin0 -> 585 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/Annotation.gifbin0 -> 554 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/plugin.properties6
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOEditPlugin.java (renamed from plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceEditPlugin.java)13
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/EresourceItemProviderAdapterFactory.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/AnnotationItemProvider.java187
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/EtypesItemProviderAdapterFactory.java275
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/ModelElementItemProvider.java177
10 files changed, 656 insertions, 8 deletions
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
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateAnnotation_details_EStringToStringMapEntry.gif
Binary files 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
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.edit/icons/full/ctool16/CreateModelElement_annotations_Annotation.gif
Binary files 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
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/Annotation.gif
Binary files 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/eresource/provider/EresourceEditPlugin.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/edit/CDOEditPlugin.java
index 6b63a1296a..b708e140be 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/edit/CDOEditPlugin.java
@@ -4,29 +4,30 @@
* 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;
+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 Eresource edit plugin. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * This is the central singleton for the Etypes edit plugin. <!-- begin-user-doc -->
*
+ * @since 4.0 <!-- end-user-doc -->
* @generated
*/
-public final class EresourceEditPlugin extends EMFPlugin
+public final class CDOEditPlugin extends EMFPlugin
{
/**
* Keep track of the singleton. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
- public static final EresourceEditPlugin INSTANCE = new EresourceEditPlugin();
+ public static final CDOEditPlugin INSTANCE = new CDOEditPlugin();
/**
* Keep track of the singleton. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -40,7 +41,7 @@ public final class EresourceEditPlugin extends EMFPlugin
*
* @generated
*/
- public EresourceEditPlugin()
+ public CDOEditPlugin()
{
super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, });
}
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}. <!--
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/AnnotationItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/AnnotationItemProvider.java
new file mode 100644
index 0000000000..0ec45211e5
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/AnnotationItemProvider.java
@@ -0,0 +1,187 @@
+/**
+ * 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.etypes.provider;
+
+import org.eclipse.emf.cdo.etypes.Annotation;
+import org.eclipse.emf.cdo.etypes.EtypesPackage;
+
+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.ecore.EcorePackage;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemColorProvider;
+import org.eclipse.emf.edit.provider.IItemFontProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITableItemColorProvider;
+import org.eclipse.emf.edit.provider.ITableItemFontProvider;
+import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.cdo.etypes.Annotation} object. <!-- begin-user-doc -->
+ *
+ * @since 4.0 <!-- end-user-doc -->
+ * @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. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public AnnotationItemProvider(AdapterFactory adapterFactory)
+ {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
+ {
+ if (itemPropertyDescriptors == null)
+ {
+ super.getPropertyDescriptors(object);
+
+ addSourcePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Source feature. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @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}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object)
+ {
+ if (childrenFeatures == null)
+ {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(EtypesPackage.Literals.ANNOTATION__DETAILS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @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. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @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. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @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}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @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. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
+ {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(EtypesPackage.Literals.ANNOTATION__DETAILS,
+ EcoreFactory.eINSTANCE.create(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY)));
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/EtypesItemProviderAdapterFactory.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/EtypesItemProviderAdapterFactory.java
new file mode 100644
index 0000000000..e8a3c03d93
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/EtypesItemProviderAdapterFactory.java
@@ -0,0 +1,275 @@
+/**
+ * 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.etypes.provider;
+
+import org.eclipse.emf.cdo.edit.CDOEditPlugin;
+import org.eclipse.emf.cdo.etypes.EtypesPackage;
+import org.eclipse.emf.cdo.etypes.util.EtypesAdapterFactory;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ChildCreationExtenderManager;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IChildCreationExtender;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemColorProvider;
+import org.eclipse.emf.edit.provider.IItemFontProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITableItemColorProvider;
+import org.eclipse.emf.edit.provider.ITableItemFontProvider;
+import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers. The adapters generated by this
+ * factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters
+ * also support Eclipse property sheets. Note that most of the adapters are shared among multiple instances. <!--
+ * begin-user-doc -->
+ *
+ * @since 4.0 <!-- end-user-doc -->
+ * @generated
+ */
+public class EtypesItemProviderAdapterFactory extends EtypesAdapterFactory implements ComposeableAdapterFactory,
+ IChangeNotifier, IDisposable, IChildCreationExtender
+{
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This helps manage the child creation extenders. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager(
+ CDOEditPlugin.INSTANCE, EtypesPackage.eNS_URI);
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EtypesItemProviderAdapterFactory()
+ {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ supportedTypes.add(ITableItemLabelProvider.class);
+ supportedTypes.add(ITableItemColorProvider.class);
+ supportedTypes.add(ITableItemFontProvider.class);
+ supportedTypes.add(IItemColorProvider.class);
+ supportedTypes.add(IItemFontProvider.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.cdo.etypes.Annotation} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected AnnotationItemProvider annotationItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.emf.cdo.etypes.Annotation}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createAnnotationAdapter()
+ {
+ if (annotationItemProvider == null)
+ {
+ annotationItemProvider = new AnnotationItemProvider(this);
+ }
+
+ return annotationItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory()
+ {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
+ {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type)
+ {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type)
+ {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type)
+ {
+ if (isFactoryForType(type))
+ {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || ((Class<?>)type).isInstance(adapter))
+ {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public List<IChildCreationExtender> getChildCreationExtenders()
+ {
+ return childCreationExtenderManager.getChildCreationExtenders();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Collection<?> getNewChildDescriptors(Object object, EditingDomain editingDomain)
+ {
+ return childCreationExtenderManager.getNewChildDescriptors(object, editingDomain);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ResourceLocator getResourceLocator()
+ {
+ return childCreationExtenderManager;
+ }
+
+ /**
+ * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener)
+ {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener)
+ {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification)
+ {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null)
+ {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void dispose()
+ {
+ if (annotationItemProvider != null)
+ {
+ annotationItemProvider.dispose();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/ModelElementItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/ModelElementItemProvider.java
new file mode 100644
index 0000000000..bdc97f81b3
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/etypes/provider/ModelElementItemProvider.java
@@ -0,0 +1,177 @@
+/**
+ * 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.etypes.provider;
+
+import org.eclipse.emf.cdo.etypes.EtypesFactory;
+import org.eclipse.emf.cdo.etypes.EtypesPackage;
+import org.eclipse.emf.cdo.etypes.ModelElement;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.IChildCreationExtender;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemColorProvider;
+import org.eclipse.emf.edit.provider.IItemFontProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITableItemColorProvider;
+import org.eclipse.emf.edit.provider.ITableItemFontProvider;
+import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.cdo.etypes.ModelElement} object. <!-- begin-user-doc
+ * -->
+ *
+ * @since 4.0 <!-- end-user-doc -->
+ * @generated
+ */
+public class ModelElementItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
+ IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource,
+ ITableItemLabelProvider, ITableItemColorProvider, ITableItemFontProvider, IItemColorProvider, IItemFontProvider
+{
+ /**
+ * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ModelElementItemProvider(AdapterFactory adapterFactory)
+ {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
+ {
+ if (itemPropertyDescriptors == null)
+ {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * 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}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object)
+ {
+ if (childrenFeatures == null)
+ {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(EtypesPackage.Literals.MODEL_ELEMENT__ANNOTATIONS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @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);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object)
+ {
+ return hasChildren(object, true);
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object)
+ {
+ return getString("_UI_ModelElement_type"); //$NON-NLS-1$
+ }
+
+ /**
+ * 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}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification)
+ {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ModelElement.class))
+ {
+ case EtypesPackage.MODEL_ELEMENT__ANNOTATIONS:
+ 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. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
+ {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(EtypesPackage.Literals.MODEL_ELEMENT__ANNOTATIONS,
+ EtypesFactory.eINSTANCE.createAnnotation()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator()
+ {
+ return ((IChildCreationExtender)adapterFactory).getResourceLocator();
+ }
+
+}

Back to the top