Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2006-05-10 11:13:06 +0000
committerdstadnik2006-05-10 11:13:06 +0000
commitce3d47a386f8a6af0427044193abb9fff348cd49 (patch)
treef8e651c91d563bee819966af23d7906a7e3e2002 /plugins/org.eclipse.gmf.codegen.edit
parent1aa6e69668a81ad8c1396df1d696cce517a937eb (diff)
downloadorg.eclipse.gmf-tooling-ce3d47a386f8a6af0427044193abb9fff348cd49.tar.gz
org.eclipse.gmf-tooling-ce3d47a386f8a6af0427044193abb9fff348cd49.tar.xz
org.eclipse.gmf-tooling-ce3d47a386f8a6af0427044193abb9fff348cd49.zip
#133836 Creating a child node without a label causes error
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen.edit')
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenChildLabelNode_labelModelFacet_CompositeFeatureLabelModelFacet.gifbin0 -> 223 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenChildLabelNode_labelModelFacet_FeatureLabelModelFacet.gifbin0 -> 223 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenDiagram_childNodes_GenChildLabelNode.gifbin0 -> 223 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/icons/full/obj16/GenChildLabelNode.gifbin0 -> 129 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/plugin.properties3
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java23
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenChildLabelNodeItemProvider.java183
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenDiagramItemProvider.java5
8 files changed, 214 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenChildLabelNode_labelModelFacet_CompositeFeatureLabelModelFacet.gif b/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenChildLabelNode_labelModelFacet_CompositeFeatureLabelModelFacet.gif
new file mode 100644
index 000000000..e2ee3160f
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenChildLabelNode_labelModelFacet_CompositeFeatureLabelModelFacet.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenChildLabelNode_labelModelFacet_FeatureLabelModelFacet.gif b/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenChildLabelNode_labelModelFacet_FeatureLabelModelFacet.gif
new file mode 100644
index 000000000..4a47641d8
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenChildLabelNode_labelModelFacet_FeatureLabelModelFacet.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenDiagram_childNodes_GenChildLabelNode.gif b/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenDiagram_childNodes_GenChildLabelNode.gif
new file mode 100644
index 000000000..6d27c0fbe
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.edit/icons/full/ctool16/CreateGenDiagram_childNodes_GenChildLabelNode.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.edit/icons/full/obj16/GenChildLabelNode.gif b/plugins/org.eclipse.gmf.codegen.edit/icons/full/obj16/GenChildLabelNode.gif
new file mode 100644
index 000000000..c8d381f0b
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.edit/icons/full/obj16/GenChildLabelNode.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.edit/plugin.properties b/plugins/org.eclipse.gmf.codegen.edit/plugin.properties
index 13bf5218e..16a416eb8 100644
--- a/plugins/org.eclipse.gmf.codegen.edit/plugin.properties
+++ b/plugins/org.eclipse.gmf.codegen.edit/plugin.properties
@@ -105,6 +105,9 @@ _UI_GenCommonBase_diagramRunTimeClass_feature = Diagram Run Time Class
_UI_GenCommonBase_visualID_feature = Visual ID
_UI_GenCommonBase_editPartClassName_feature = Edit Part Class Name
_UI_GenLink_diagram_feature = Diagram
+_UI_GenChildLabelNode_type = Gen Child Label Node
+_UI_GenChildLabelNode_labelReadOnly_feature = Label Read Only
+_UI_GenChildLabelNode_labelModelFacet_feature = Label Model Facet
_UI_Viewmap_type = Viewmap
_UI_Viewmap_attributes_feature = Attributes
diff --git a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java
index 6b33b22e9..e0bf7e1fa 100644
--- a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java
+++ b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java
@@ -206,6 +206,28 @@ public class GMFGenItemProviderAdapterFactory extends GMFGenAdapterFactory imple
}
/**
+ * This keeps track of the one adapter used for all {@link org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GenChildLabelNodeItemProvider genChildLabelNodeItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Adapter createGenChildLabelNodeAdapter() {
+ if (genChildLabelNodeItemProvider == null) {
+ genChildLabelNodeItemProvider = new GenChildLabelNodeItemProvider(this);
+ }
+
+ return genChildLabelNodeItemProvider;
+ }
+
+ /**
* This keeps track of the one adapter used for all {@link org.eclipse.gmf.codegen.gmfgen.GenCompartment} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1253,6 +1275,7 @@ public class GMFGenItemProviderAdapterFactory extends GMFGenAdapterFactory imple
if (genPluginItemProvider != null) genPluginItemProvider.dispose();
if (genTopLevelNodeItemProvider != null) genTopLevelNodeItemProvider.dispose();
if (genChildNodeItemProvider != null) genChildNodeItemProvider.dispose();
+ if (genChildLabelNodeItemProvider != null) genChildLabelNodeItemProvider.dispose();
if (genCompartmentItemProvider != null) genCompartmentItemProvider.dispose();
if (genLinkItemProvider != null) genLinkItemProvider.dispose();
if (genNodeLabelItemProvider != null) genNodeLabelItemProvider.dispose();
diff --git a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenChildLabelNodeItemProvider.java b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenChildLabelNodeItemProvider.java
new file mode 100644
index 000000000..d09936532
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenChildLabelNodeItemProvider.java
@@ -0,0 +1,183 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.codegen.gmfgen.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+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.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.eclipse.gmf.codegen.gmfgen.GMFGenFactory;
+import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
+import org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode;
+
+import org.eclipse.gmf.codegen.gmfgen.presentation.EditorPlugin;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GenChildLabelNodeItemProvider
+ extends GenChildNodeItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GenChildLabelNodeItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addLabelReadOnlyPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Label Read Only feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addLabelReadOnlyPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_GenChildLabelNode_labelReadOnly_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_GenChildLabelNode_labelReadOnly_feature", "_UI_GenChildLabelNode_type"),
+ GMFGenPackage.eINSTANCE.getGenChildLabelNode_LabelReadOnly(),
+ true,
+ ItemPropertyDescriptor.BOOLEAN_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
+ */
+ public Collection getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(GMFGenPackage.eINSTANCE.getGenChildLabelNode_LabelModelFacet());
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * This returns GenChildLabelNode.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/GenChildLabelNode"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getText(Object object) {
+ String label = ((GenChildLabelNode)object).getEditPartClassName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_GenChildLabelNode_type") :
+ getString("_UI_GenChildLabelNode_type") + " " + label;
+ }
+
+ /**
+ * 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
+ */
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(GenChildLabelNode.class)) {
+ case GMFGenPackage.GEN_CHILD_LABEL_NODE__LABEL_READ_ONLY:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case GMFGenPackage.GEN_CHILD_LABEL_NODE__LABEL_MODEL_FACET:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing all of the children that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (GMFGenPackage.eINSTANCE.getGenChildLabelNode_LabelModelFacet(),
+ GMFGenFactory.eINSTANCE.createFeatureLabelModelFacet()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (GMFGenPackage.eINSTANCE.getGenChildLabelNode_LabelModelFacet(),
+ GMFGenFactory.eINSTANCE.createCompositeFeatureLabelModelFacet()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ResourceLocator getResourceLocator() {
+ return EditorPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenDiagramItemProvider.java b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenDiagramItemProvider.java
index 03d5f2b55..7bd311c82 100644
--- a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenDiagramItemProvider.java
+++ b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenDiagramItemProvider.java
@@ -1545,6 +1545,11 @@ public class GenDiagramItemProvider
newChildDescriptors.add
(createChildParameter
+ (GMFGenPackage.eINSTANCE.getGenDiagram_ChildNodes(),
+ GMFGenFactory.eINSTANCE.createGenChildLabelNode()));
+
+ newChildDescriptors.add
+ (createChildParameter
(GMFGenPackage.eINSTANCE.getGenDiagram_TopLevelNodes(),
GMFGenFactory.eINSTANCE.createGenTopLevelNode()));

Back to the top