Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgolubev2012-05-15 12:11:40 +0000
committermgolubev2012-05-15 12:11:40 +0000
commitdcf75b44092b5f6dad20cd7030fe116519e234b9 (patch)
treeb9524e00a00455a01f0f3d4c83e5a73bdedebcac
parentf86f3d78b1ba0e99e7592e76af42f659040cdf6a (diff)
downloadorg.eclipse.gmf-tooling-dcf75b44092b5f6dad20cd7030fe116519e234b9.tar.gz
org.eclipse.gmf-tooling-dcf75b44092b5f6dad20cd7030fe116519e234b9.tar.xz
org.eclipse.gmf-tooling-dcf75b44092b5f6dad20cd7030fe116519e234b9.zip
Simple model to support injected diagram subsetting/layering
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/.classpath7
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/.project28
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/META-INF/MANIFEST.MF17
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/build.properties14
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_layers_Layer.gifbin0 -> 223 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_mainDiagram_SubDiagramSpec.gifbin0 -> 223 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_subDiagrams_SubDiagramSpec.gifbin0 -> 223 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSpec_diagramLayers_LayerEnablement.gifbin0 -> 223 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_layers_Layer.gifbin0 -> 223 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_mainDiagram_SubDiagramSpec.gifbin0 -> 223 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_subDiagrams_SubDiagramSpec.gifbin0 -> 223 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/Layer.gifbin0 -> 129 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/LayerDefinitions.gifbin0 -> 129 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/LayerEnablement.gifbin0 -> 129 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/SubDiagramSpec.gifbin0 -> 129 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/SubDiagramSupport.gifbin0 -> 129 bytes
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/plugin.properties44
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/plugin.xml25
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerEditPlugin.java96
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerEnablementItemProvider.java179
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerItemProvider.java205
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayersItemProviderAdapterFactory.java273
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/SubDiagramSpecItemProvider.java245
-rw-r--r--examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/SubDiagramSupportItemProvider.java204
-rw-r--r--examples/org.eclipse.gmf.examples.layers/.classpath7
-rw-r--r--examples/org.eclipse.gmf.examples.layers/.project28
-rw-r--r--examples/org.eclipse.gmf.examples.layers/META-INF/MANIFEST.MF16
-rw-r--r--examples/org.eclipse.gmf.examples.layers/build.properties14
-rw-r--r--examples/org.eclipse.gmf.examples.layers/model/layer.ecore39
-rw-r--r--examples/org.eclipse.gmf.examples.layers/model/layer.emf37
-rw-r--r--examples/org.eclipse.gmf.examples.layers/model/layer.genmodel39
-rw-r--r--examples/org.eclipse.gmf.examples.layers/plugin.properties8
-rw-r--r--examples/org.eclipse.gmf.examples.layers/plugin.xml20
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/Layer.java99
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayerEnablement.java81
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayersFactory.java73
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayersPackage.java579
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/SubDiagramSpec.java135
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/SubDiagramSupport.java114
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayerEnablementImpl.java226
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayerImpl.java258
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayersFactoryImpl.java134
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayersPackageImpl.java382
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/SubDiagramSpecImpl.java355
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/SubDiagramSupportImpl.java322
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/util/LayersAdapterFactory.java179
-rw-r--r--examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/util/LayersSwitch.java179
47 files changed, 4661 insertions, 0 deletions
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/.classpath b/examples/org.eclipse.gmf.examples.layers.edit/.classpath
new file mode 100644
index 000000000..ed2bc1287
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/.project b/examples/org.eclipse.gmf.examples.layers.edit/.project
new file mode 100644
index 000000000..39885e9a1
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.gmf.examples.layers.edit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/META-INF/MANIFEST.MF b/examples/org.eclipse.gmf.examples.layers.edit/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..9327a6840
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.gmf.examples.layers.edit;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.gmf.examples.layers.provider.LayerEditPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.gmf.examples.layers.provider
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.gmf.examples.layers;visibility:=reexport,
+ org.eclipse.emf.edit;visibility:=reexport,
+ org.eclipse.emf.ecore.edit;visibility:=reexport,
+ org.eclipse.gmf.runtime.notation.edit;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/build.properties b/examples/org.eclipse.gmf.examples.layers.edit/build.properties
new file mode 100644
index 000000000..400b20ae2
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/build.properties
@@ -0,0 +1,14 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_layers_Layer.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_layers_Layer.gif
new file mode 100644
index 000000000..2e9e40157
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_layers_Layer.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_mainDiagram_SubDiagramSpec.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_mainDiagram_SubDiagramSpec.gif
new file mode 100644
index 000000000..14d8d5f68
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_mainDiagram_SubDiagramSpec.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_subDiagrams_SubDiagramSpec.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_subDiagrams_SubDiagramSpec.gif
new file mode 100644
index 000000000..14d8d5f68
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateLayerDefinitions_subDiagrams_SubDiagramSpec.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSpec_diagramLayers_LayerEnablement.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSpec_diagramLayers_LayerEnablement.gif
new file mode 100644
index 000000000..43035507e
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSpec_diagramLayers_LayerEnablement.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_layers_Layer.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_layers_Layer.gif
new file mode 100644
index 000000000..c60711d77
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_layers_Layer.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_mainDiagram_SubDiagramSpec.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_mainDiagram_SubDiagramSpec.gif
new file mode 100644
index 000000000..b8f0160a6
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_mainDiagram_SubDiagramSpec.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_subDiagrams_SubDiagramSpec.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_subDiagrams_SubDiagramSpec.gif
new file mode 100644
index 000000000..b8f0160a6
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/ctool16/CreateSubDiagramSupport_subDiagrams_SubDiagramSpec.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/Layer.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/Layer.gif
new file mode 100644
index 000000000..45731fe28
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/Layer.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/LayerDefinitions.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/LayerDefinitions.gif
new file mode 100644
index 000000000..420eee177
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/LayerDefinitions.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/LayerEnablement.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/LayerEnablement.gif
new file mode 100644
index 000000000..498364f1c
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/LayerEnablement.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/SubDiagramSpec.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/SubDiagramSpec.gif
new file mode 100644
index 000000000..c3370c7dd
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/SubDiagramSpec.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/SubDiagramSupport.gif b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/SubDiagramSupport.gif
new file mode 100644
index 000000000..c4fb30e96
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/icons/full/obj16/SubDiagramSupport.gif
Binary files differ
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/plugin.properties b/examples/org.eclipse.gmf.examples.layers.edit/plugin.properties
new file mode 100644
index 000000000..6110a618c
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/plugin.properties
@@ -0,0 +1,44 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+pluginName = Layer Edit Support
+providerName = www.example.org
+
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+
+_UI_PropertyDescriptor_description = The {0} of the {1}
+
+_UI_LayerDefinitions_type = Layer Definitions
+_UI_Layer_type = Layer
+_UI_SubDiagramSpec_type = Sub Diagram Spec
+_UI_LayerEnablement_type = Layer Enablement
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_LayerDefinitions_layers_feature = Layers
+_UI_LayerDefinitions_mainDiagram_feature = Main Diagram
+_UI_LayerDefinitions_subDiagrams_feature = Sub Diagrams
+_UI_Layer_name_feature = Name
+_UI_Layer_colorDef_feature = Color Def
+_UI_Layer_participants_feature = Participants
+_UI_SubDiagramSpec_name_feature = Name
+_UI_SubDiagramSpec_showing_feature = Showing
+_UI_SubDiagramSpec_diagramLayers_feature = Diagram Layers
+_UI_LayerEnablement_layer_feature = Layer
+_UI_LayerEnablement_visible_feature = Visible
+_UI_Unknown_feature = Unspecified
+
+_UI_SubDiagramSupport_type = Sub Diagram Support
+_UI_SubDiagramSupport_layers_feature = Layers
+_UI_SubDiagramSupport_mainDiagram_feature = Main Diagram
+_UI_SubDiagramSupport_subDiagrams_feature = Sub Diagrams
+_UI_SubDiagramSpec_diagram_feature = Diagram
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/plugin.xml b/examples/org.eclipse.gmf.examples.layers.edit/plugin.xml
new file mode 100644
index 000000000..72994cc5a
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/plugin.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ <copyright>
+ </copyright>
+
+ $Id$
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <factory
+ uri="http://www.eclipse.org/examples/gmf/visibility-layers"
+ class="org.eclipse.gmf.examples.layers.provider.LayersItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+</plugin>
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerEditPlugin.java b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerEditPlugin.java
new file mode 100644
index 000000000..57b7e1aa1
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerEditPlugin.java
@@ -0,0 +1,96 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+import org.eclipse.gmf.runtime.notation.NotationEditPlugin;
+
+/**
+ * This is the central singleton for the Layer edit plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class LayerEditPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final LayerEditPlugin INSTANCE = new LayerEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayerEditPlugin() {
+ super
+ (new ResourceLocator [] {
+ EcoreEditPlugin.INSTANCE,
+ NotationEditPlugin.INSTANCE,
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerEnablementItemProvider.java b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerEnablementItemProvider.java
new file mode 100644
index 000000000..7757407a4
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerEnablementItemProvider.java
@@ -0,0 +1,179 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.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.IItemPropertyDescriptor;
+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.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.gmf.examples.layers.LayerEnablement;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.gmf.examples.layers.LayerEnablement} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LayerEnablementItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayerEnablementItemProvider(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);
+
+ addLayerPropertyDescriptor(object);
+ addVisiblePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Layer feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addLayerPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_LayerEnablement_layer_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_LayerEnablement_layer_feature", "_UI_LayerEnablement_type"),
+ LayersPackage.Literals.LAYER_ENABLEMENT__LAYER,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Visible feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addVisiblePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_LayerEnablement_visible_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_LayerEnablement_visible_feature", "_UI_LayerEnablement_type"),
+ LayersPackage.Literals.LAYER_ENABLEMENT__VISIBLE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns LayerEnablement.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/LayerEnablement"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ LayerEnablement layerEnablement = (LayerEnablement)object;
+ return getString("_UI_LayerEnablement_type") + " " + layerEnablement.isVisible();
+ }
+
+ /**
+ * 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(LayerEnablement.class)) {
+ case LayersPackage.LAYER_ENABLEMENT__VISIBLE:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ 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);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return LayerEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerItemProvider.java b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerItemProvider.java
new file mode 100644
index 000000000..2d9ff5428
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayerItemProvider.java
@@ -0,0 +1,205 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.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.IItemPropertyDescriptor;
+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.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.gmf.examples.layers.Layer} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LayerItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayerItemProvider(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);
+
+ addNamePropertyDescriptor(object);
+ addColorDefPropertyDescriptor(object);
+ addParticipantsPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Layer_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Layer_name_feature", "_UI_Layer_type"),
+ LayersPackage.Literals.LAYER__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Color Def feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addColorDefPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Layer_colorDef_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Layer_colorDef_feature", "_UI_Layer_type"),
+ LayersPackage.Literals.LAYER__COLOR_DEF,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Participants feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addParticipantsPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Layer_participants_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Layer_participants_feature", "_UI_Layer_type"),
+ LayersPackage.Literals.LAYER__PARTICIPANTS,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns Layer.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Layer"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Layer)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_Layer_type") :
+ getString("_UI_Layer_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
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Layer.class)) {
+ case LayersPackage.LAYER__NAME:
+ case LayersPackage.LAYER__COLOR_DEF:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ 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);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return LayerEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayersItemProviderAdapterFactory.java b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayersItemProviderAdapterFactory.java
new file mode 100644
index 000000000..96cbeff6a
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/LayersItemProviderAdapterFactory.java
@@ -0,0 +1,273 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+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.edit.provider.ChangeNotifier;
+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.IDisposable;
+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.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.gmf.examples.layers.util.LayersAdapterFactory;
+
+/**
+ * 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 -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LayersItemProviderAdapterFactory extends LayersAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * 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 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 LayersItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.gmf.examples.layers.SubDiagramSupport} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected SubDiagramSupportItemProvider subDiagramSupportItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.gmf.examples.layers.SubDiagramSupport}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createSubDiagramSupportAdapter() {
+ if (subDiagramSupportItemProvider == null) {
+ subDiagramSupportItemProvider = new SubDiagramSupportItemProvider(this);
+ }
+
+ return subDiagramSupportItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.gmf.examples.layers.Layer} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LayerItemProvider layerItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.gmf.examples.layers.Layer}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createLayerAdapter() {
+ if (layerItemProvider == null) {
+ layerItemProvider = new LayerItemProvider(this);
+ }
+
+ return layerItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.gmf.examples.layers.SubDiagramSpec} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected SubDiagramSpecItemProvider subDiagramSpecItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.gmf.examples.layers.SubDiagramSpec}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createSubDiagramSpecAdapter() {
+ if (subDiagramSpecItemProvider == null) {
+ subDiagramSpecItemProvider = new SubDiagramSpecItemProvider(this);
+ }
+
+ return subDiagramSpecItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.gmf.examples.layers.LayerEnablement} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LayerEnablementItemProvider layerEnablementItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.gmf.examples.layers.LayerEnablement}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createLayerEnablementAdapter() {
+ if (layerEnablementItemProvider == null) {
+ layerEnablementItemProvider = new LayerEnablementItemProvider(this);
+ }
+
+ return layerEnablementItemProvider;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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 (subDiagramSupportItemProvider != null) subDiagramSupportItemProvider.dispose();
+ if (layerItemProvider != null) layerItemProvider.dispose();
+ if (subDiagramSpecItemProvider != null) subDiagramSpecItemProvider.dispose();
+ if (layerEnablementItemProvider != null) layerEnablementItemProvider.dispose();
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/SubDiagramSpecItemProvider.java b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/SubDiagramSpecItemProvider.java
new file mode 100644
index 000000000..59b510fb1
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/SubDiagramSpecItemProvider.java
@@ -0,0 +1,245 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.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.ecore.EStructuralFeature;
+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.IItemPropertyDescriptor;
+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.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.gmf.examples.layers.LayersFactory;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+import org.eclipse.gmf.examples.layers.SubDiagramSpec;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.gmf.examples.layers.SubDiagramSpec} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SubDiagramSpecItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SubDiagramSpecItemProvider(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);
+
+ addNamePropertyDescriptor(object);
+ addShowingPropertyDescriptor(object);
+ addDiagramPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_SubDiagramSpec_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_SubDiagramSpec_name_feature", "_UI_SubDiagramSpec_type"),
+ LayersPackage.Literals.SUB_DIAGRAM_SPEC__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Showing feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addShowingPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_SubDiagramSpec_showing_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_SubDiagramSpec_showing_feature", "_UI_SubDiagramSpec_type"),
+ LayersPackage.Literals.SUB_DIAGRAM_SPEC__SHOWING,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Diagram feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addDiagramPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_SubDiagramSpec_diagram_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_SubDiagramSpec_diagram_feature", "_UI_SubDiagramSpec_type"),
+ LayersPackage.Literals.SUB_DIAGRAM_SPEC__DIAGRAM,
+ true,
+ false,
+ true,
+ null,
+ 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(LayersPackage.Literals.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS);
+ }
+ 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 SubDiagramSpec.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/SubDiagramSpec"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((SubDiagramSpec)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_SubDiagramSpec_type") :
+ getString("_UI_SubDiagramSpec_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
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(SubDiagramSpec.class)) {
+ case LayersPackage.SUB_DIAGRAM_SPEC__NAME:
+ case LayersPackage.SUB_DIAGRAM_SPEC__SHOWING:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS:
+ 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
+ (LayersPackage.Literals.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS,
+ LayersFactory.eINSTANCE.createLayerEnablement()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return LayerEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/SubDiagramSupportItemProvider.java b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/SubDiagramSupportItemProvider.java
new file mode 100644
index 000000000..e55f4f93a
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers.edit/src/org/eclipse/gmf/examples/layers/provider/SubDiagramSupportItemProvider.java
@@ -0,0 +1,204 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.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.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+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.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.gmf.examples.layers.LayersFactory;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+import org.eclipse.gmf.examples.layers.SubDiagramSupport;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.gmf.examples.layers.SubDiagramSupport} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SubDiagramSupportItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SubDiagramSupportItemProvider(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(LayersPackage.Literals.SUB_DIAGRAM_SUPPORT__LAYERS);
+ childrenFeatures.add(LayersPackage.Literals.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM);
+ childrenFeatures.add(LayersPackage.Literals.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS);
+ }
+ 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 SubDiagramSupport.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/SubDiagramSupport"));
+ }
+
+ /**
+ * 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_SubDiagramSupport_type");
+ }
+
+ /**
+ * 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(SubDiagramSupport.class)) {
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__LAYERS:
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM:
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS:
+ 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
+ (LayersPackage.Literals.SUB_DIAGRAM_SUPPORT__LAYERS,
+ LayersFactory.eINSTANCE.createLayer()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LayersPackage.Literals.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM,
+ LayersFactory.eINSTANCE.createSubDiagramSpec()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (LayersPackage.Literals.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS,
+ LayersFactory.eINSTANCE.createSubDiagramSpec()));
+ }
+
+ /**
+ * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
+ Object childFeature = feature;
+ Object childObject = child;
+
+ boolean qualify =
+ childFeature == LayersPackage.Literals.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM ||
+ childFeature == LayersPackage.Literals.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS;
+
+ if (qualify) {
+ return getString
+ ("_UI_CreateChild_text2",
+ new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
+ }
+ return super.getCreateChildText(owner, feature, child, selection);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return LayerEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.layers/.classpath b/examples/org.eclipse.gmf.examples.layers/.classpath
new file mode 100644
index 000000000..ed2bc1287
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.gmf.examples.layers/.project b/examples/org.eclipse.gmf.examples.layers/.project
new file mode 100644
index 000000000..e948c0889
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.gmf.examples.layers</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.gmf.examples.layers/META-INF/MANIFEST.MF b/examples/org.eclipse.gmf.examples.layers/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..b71800a10
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.gmf.examples.layers;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.gmf.examples.layers,
+ org.eclipse.gmf.examples.layers.impl,
+ org.eclipse.gmf.examples.layers.util
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.gmf.runtime.notation;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/examples/org.eclipse.gmf.examples.layers/build.properties b/examples/org.eclipse.gmf.examples.layers/build.properties
new file mode 100644
index 000000000..1a3a48b22
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/build.properties
@@ -0,0 +1,14 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/examples/org.eclipse.gmf.examples.layers/model/layer.ecore b/examples/org.eclipse.gmf.examples.layers/model/layer.ecore
new file mode 100644
index 000000000..d2eb4a3d6
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/model/layer.ecore
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="layers"
+ nsURI="http://www.eclipse.org/examples/gmf/visibility-layers" nsPrefix="vlayers">
+ <eClassifiers xsi:type="ecore:EClass" name="SubDiagramSupport">
+ <eOperations name="getAllDiagrams" upperBound="-1" eType="#//SubDiagramSpec"/>
+ <eOperations name="findDiagramSpec" eType="#//SubDiagramSpec">
+ <eParameters name="diagram" eType="ecore:EClass platform:/plugin/org.eclipse.gmf.runtime.notation/model/notation.ecore#//Diagram"/>
+ </eOperations>
+ <eOperations name="ensureAllSubDiagramsHaveEnablementForAllLayers"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="layers" upperBound="-1"
+ eType="#//Layer" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="mainDiagram" eType="#//SubDiagramSpec"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="subDiagrams" upperBound="-1"
+ eType="#//SubDiagramSpec" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Layer">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="colorDef" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="participants" upperBound="-1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="SubDiagramSpec">
+ <eOperations name="findLayerEnablement" eType="#//LayerEnablement">
+ <eParameters name="layer" eType="#//Layer"/>
+ </eOperations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="showing" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="diagramLayers" upperBound="-1"
+ eType="#//LayerEnablement" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="diagram" eType="ecore:EClass platform:/plugin/org.eclipse.gmf.runtime.notation/model/notation.ecore#//Diagram"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="LayerEnablement">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="layer" eType="#//Layer"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="visible" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/examples/org.eclipse.gmf.examples.layers/model/layer.emf b/examples/org.eclipse.gmf.examples.layers/model/layer.emf
new file mode 100644
index 000000000..c5fce7cc0
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/model/layer.emf
@@ -0,0 +1,37 @@
+@namespace(uri="http://www.eclipse.org/examples/gmf/visibility-layers", prefix="vlayers")
+package layers;
+
+import "platform:/plugin/org.eclipse.gmf.runtime.notation/model/notation.ecore";
+import "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore";
+
+class SubDiagramSupport {
+ val Layer[*] layers;
+
+ val SubDiagramSpec mainDiagram;
+ val SubDiagramSpec[*] subDiagrams;
+
+ op SubDiagramSpec[*] getAllDiagrams();
+ op SubDiagramSpec findDiagramSpec(notation.Diagram diagram);
+
+ op void ensureAllSubDiagramsHaveEnablementForAllLayers();
+}
+
+class Layer {
+ attr String name;
+ attr String colorDef;
+ ref ecore.EObject[*] participants;
+}
+
+class SubDiagramSpec {
+ attr String name;
+ attr boolean showing;
+ val LayerEnablement[*] diagramLayers;
+ ref notation.Diagram diagram;
+
+ op LayerEnablement findLayerEnablement(Layer layer);
+}
+
+class LayerEnablement {
+ ref Layer layer;
+ attr boolean visible;
+}
diff --git a/examples/org.eclipse.gmf.examples.layers/model/layer.genmodel b/examples/org.eclipse.gmf.examples.layers/model/layer.genmodel
new file mode 100644
index 000000000..6c921ea81
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/model/layer.genmodel
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.gmf.examples.layers/src"
+ modelPluginID="org.eclipse.gmf.examples.layers" modelName="Layer" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="6.0" copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore platform:/plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation">
+ <foreignModel>layer.ecore</foreignModel>
+ <genPackages prefix="Layers" basePackage="org.eclipse.gmf.examples" disposableProviderFactory="true"
+ ecorePackage="layer.ecore#/">
+ <genClasses ecoreClass="layer.ecore#//SubDiagramSupport">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference layer.ecore#//SubDiagramSupport/layers"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference layer.ecore#//SubDiagramSupport/mainDiagram"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference layer.ecore#//SubDiagramSupport/subDiagrams"/>
+ <genOperations ecoreOperation="layer.ecore#//SubDiagramSupport/getAllDiagrams"/>
+ <genOperations ecoreOperation="layer.ecore#//SubDiagramSupport/findDiagramSpec">
+ <genParameters ecoreParameter="layer.ecore#//SubDiagramSupport/findDiagramSpec/diagram"/>
+ </genOperations>
+ <genOperations ecoreOperation="layer.ecore#//SubDiagramSupport/ensureAllSubDiagramsHaveEnablementForAllLayers"/>
+ </genClasses>
+ <genClasses ecoreClass="layer.ecore#//Layer">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute layer.ecore#//Layer/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute layer.ecore#//Layer/colorDef"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference layer.ecore#//Layer/participants"/>
+ </genClasses>
+ <genClasses ecoreClass="layer.ecore#//SubDiagramSpec">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute layer.ecore#//SubDiagramSpec/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute layer.ecore#//SubDiagramSpec/showing"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference layer.ecore#//SubDiagramSpec/diagramLayers"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference layer.ecore#//SubDiagramSpec/diagram"/>
+ <genOperations ecoreOperation="layer.ecore#//SubDiagramSpec/findLayerEnablement">
+ <genParameters ecoreParameter="layer.ecore#//SubDiagramSpec/findLayerEnablement/layer"/>
+ </genOperations>
+ </genClasses>
+ <genClasses ecoreClass="layer.ecore#//LayerEnablement">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference layer.ecore#//LayerEnablement/layer"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute layer.ecore#//LayerEnablement/visible"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/examples/org.eclipse.gmf.examples.layers/plugin.properties b/examples/org.eclipse.gmf.examples.layers/plugin.properties
new file mode 100644
index 000000000..07c068116
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/plugin.properties
@@ -0,0 +1,8 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+pluginName = Layer Model
+providerName = www.example.org
diff --git a/examples/org.eclipse.gmf.examples.layers/plugin.xml b/examples/org.eclipse.gmf.examples.layers/plugin.xml
new file mode 100644
index 000000000..344e6caf3
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/plugin.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ <copyright>
+ </copyright>
+
+ $Id$
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri="http://www.eclipse.org/examples/gmf/visibility-layers"
+ class="org.eclipse.gmf.examples.layers.LayersPackage"
+ genModel="model/layer.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/Layer.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/Layer.java
new file mode 100644
index 000000000..1da39e610
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/Layer.java
@@ -0,0 +1,99 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Layer</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.examples.layers.Layer#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.Layer#getColorDef <em>Color Def</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.Layer#getParticipants <em>Participants</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getLayer()
+ * @model
+ * @generated
+ */
+public interface Layer extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getLayer_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.examples.layers.Layer#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Color Def</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Color Def</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Color Def</em>' attribute.
+ * @see #setColorDef(String)
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getLayer_ColorDef()
+ * @model
+ * @generated
+ */
+ String getColorDef();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.examples.layers.Layer#getColorDef <em>Color Def</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Color Def</em>' attribute.
+ * @see #getColorDef()
+ * @generated
+ */
+ void setColorDef(String value);
+
+ /**
+ * Returns the value of the '<em><b>Participants</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.ecore.EObject}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Participants</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Participants</em>' reference list.
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getLayer_Participants()
+ * @model
+ * @generated
+ */
+ EList<EObject> getParticipants();
+
+} // Layer
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayerEnablement.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayerEnablement.java
new file mode 100644
index 000000000..14b2e1b3b
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayerEnablement.java
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Layer Enablement</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.examples.layers.LayerEnablement#getLayer <em>Layer</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.LayerEnablement#isVisible <em>Visible</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getLayerEnablement()
+ * @model
+ * @generated
+ */
+public interface LayerEnablement extends EObject {
+ /**
+ * Returns the value of the '<em><b>Layer</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Layer</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Layer</em>' reference.
+ * @see #setLayer(Layer)
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getLayerEnablement_Layer()
+ * @model
+ * @generated
+ */
+ Layer getLayer();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.examples.layers.LayerEnablement#getLayer <em>Layer</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Layer</em>' reference.
+ * @see #getLayer()
+ * @generated
+ */
+ void setLayer(Layer value);
+
+ /**
+ * Returns the value of the '<em><b>Visible</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Visible</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Visible</em>' attribute.
+ * @see #setVisible(boolean)
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getLayerEnablement_Visible()
+ * @model
+ * @generated
+ */
+ boolean isVisible();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.examples.layers.LayerEnablement#isVisible <em>Visible</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Visible</em>' attribute.
+ * @see #isVisible()
+ * @generated
+ */
+ void setVisible(boolean value);
+
+} // LayerEnablement
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayersFactory.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayersFactory.java
new file mode 100644
index 000000000..9c20ea04d
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayersFactory.java
@@ -0,0 +1,73 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.LayersPackage
+ * @generated
+ */
+public interface LayersFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ LayersFactory eINSTANCE = org.eclipse.gmf.examples.layers.impl.LayersFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Sub Diagram Support</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Sub Diagram Support</em>'.
+ * @generated
+ */
+ SubDiagramSupport createSubDiagramSupport();
+
+ /**
+ * Returns a new object of class '<em>Layer</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Layer</em>'.
+ * @generated
+ */
+ Layer createLayer();
+
+ /**
+ * Returns a new object of class '<em>Sub Diagram Spec</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Sub Diagram Spec</em>'.
+ * @generated
+ */
+ SubDiagramSpec createSubDiagramSpec();
+
+ /**
+ * Returns a new object of class '<em>Layer Enablement</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Layer Enablement</em>'.
+ * @generated
+ */
+ LayerEnablement createLayerEnablement();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ LayersPackage getLayersPackage();
+
+} //LayersFactory
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayersPackage.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayersPackage.java
new file mode 100644
index 000000000..68e4fa33d
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/LayersPackage.java
@@ -0,0 +1,579 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.LayersFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface LayersPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "layers";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/examples/gmf/visibility-layers";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "vlayers";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ LayersPackage eINSTANCE = org.eclipse.gmf.examples.layers.impl.LayersPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSupportImpl <em>Sub Diagram Support</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.impl.SubDiagramSupportImpl
+ * @see org.eclipse.gmf.examples.layers.impl.LayersPackageImpl#getSubDiagramSupport()
+ * @generated
+ */
+ int SUB_DIAGRAM_SUPPORT = 0;
+
+ /**
+ * The feature id for the '<em><b>Layers</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SUPPORT__LAYERS = 0;
+
+ /**
+ * The feature id for the '<em><b>Main Diagram</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM = 1;
+
+ /**
+ * The feature id for the '<em><b>Sub Diagrams</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS = 2;
+
+ /**
+ * The number of structural features of the '<em>Sub Diagram Support</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SUPPORT_FEATURE_COUNT = 3;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.gmf.examples.layers.impl.LayerImpl <em>Layer</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.impl.LayerImpl
+ * @see org.eclipse.gmf.examples.layers.impl.LayersPackageImpl#getLayer()
+ * @generated
+ */
+ int LAYER = 1;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYER__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Color Def</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYER__COLOR_DEF = 1;
+
+ /**
+ * The feature id for the '<em><b>Participants</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYER__PARTICIPANTS = 2;
+
+ /**
+ * The number of structural features of the '<em>Layer</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYER_FEATURE_COUNT = 3;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSpecImpl <em>Sub Diagram Spec</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.impl.SubDiagramSpecImpl
+ * @see org.eclipse.gmf.examples.layers.impl.LayersPackageImpl#getSubDiagramSpec()
+ * @generated
+ */
+ int SUB_DIAGRAM_SPEC = 2;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SPEC__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Showing</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SPEC__SHOWING = 1;
+
+ /**
+ * The feature id for the '<em><b>Diagram Layers</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS = 2;
+
+ /**
+ * The feature id for the '<em><b>Diagram</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SPEC__DIAGRAM = 3;
+
+ /**
+ * The number of structural features of the '<em>Sub Diagram Spec</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SUB_DIAGRAM_SPEC_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.gmf.examples.layers.impl.LayerEnablementImpl <em>Layer Enablement</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.impl.LayerEnablementImpl
+ * @see org.eclipse.gmf.examples.layers.impl.LayersPackageImpl#getLayerEnablement()
+ * @generated
+ */
+ int LAYER_ENABLEMENT = 3;
+
+ /**
+ * The feature id for the '<em><b>Layer</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYER_ENABLEMENT__LAYER = 0;
+
+ /**
+ * The feature id for the '<em><b>Visible</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYER_ENABLEMENT__VISIBLE = 1;
+
+ /**
+ * The number of structural features of the '<em>Layer Enablement</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYER_ENABLEMENT_FEATURE_COUNT = 2;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gmf.examples.layers.SubDiagramSupport <em>Sub Diagram Support</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Sub Diagram Support</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSupport
+ * @generated
+ */
+ EClass getSubDiagramSupport();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.gmf.examples.layers.SubDiagramSupport#getLayers <em>Layers</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Layers</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSupport#getLayers()
+ * @see #getSubDiagramSupport()
+ * @generated
+ */
+ EReference getSubDiagramSupport_Layers();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.gmf.examples.layers.SubDiagramSupport#getMainDiagram <em>Main Diagram</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Main Diagram</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSupport#getMainDiagram()
+ * @see #getSubDiagramSupport()
+ * @generated
+ */
+ EReference getSubDiagramSupport_MainDiagram();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.gmf.examples.layers.SubDiagramSupport#getSubDiagrams <em>Sub Diagrams</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Sub Diagrams</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSupport#getSubDiagrams()
+ * @see #getSubDiagramSupport()
+ * @generated
+ */
+ EReference getSubDiagramSupport_SubDiagrams();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gmf.examples.layers.Layer <em>Layer</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Layer</em>'.
+ * @see org.eclipse.gmf.examples.layers.Layer
+ * @generated
+ */
+ EClass getLayer();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.examples.layers.Layer#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.gmf.examples.layers.Layer#getName()
+ * @see #getLayer()
+ * @generated
+ */
+ EAttribute getLayer_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.examples.layers.Layer#getColorDef <em>Color Def</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Color Def</em>'.
+ * @see org.eclipse.gmf.examples.layers.Layer#getColorDef()
+ * @see #getLayer()
+ * @generated
+ */
+ EAttribute getLayer_ColorDef();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.gmf.examples.layers.Layer#getParticipants <em>Participants</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Participants</em>'.
+ * @see org.eclipse.gmf.examples.layers.Layer#getParticipants()
+ * @see #getLayer()
+ * @generated
+ */
+ EReference getLayer_Participants();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec <em>Sub Diagram Spec</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Sub Diagram Spec</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSpec
+ * @generated
+ */
+ EClass getSubDiagramSpec();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSpec#getName()
+ * @see #getSubDiagramSpec()
+ * @generated
+ */
+ EAttribute getSubDiagramSpec_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#isShowing <em>Showing</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Showing</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSpec#isShowing()
+ * @see #getSubDiagramSpec()
+ * @generated
+ */
+ EAttribute getSubDiagramSpec_Showing();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#getDiagramLayers <em>Diagram Layers</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Diagram Layers</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSpec#getDiagramLayers()
+ * @see #getSubDiagramSpec()
+ * @generated
+ */
+ EReference getSubDiagramSpec_DiagramLayers();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#getDiagram <em>Diagram</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Diagram</em>'.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSpec#getDiagram()
+ * @see #getSubDiagramSpec()
+ * @generated
+ */
+ EReference getSubDiagramSpec_Diagram();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gmf.examples.layers.LayerEnablement <em>Layer Enablement</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Layer Enablement</em>'.
+ * @see org.eclipse.gmf.examples.layers.LayerEnablement
+ * @generated
+ */
+ EClass getLayerEnablement();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.gmf.examples.layers.LayerEnablement#getLayer <em>Layer</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Layer</em>'.
+ * @see org.eclipse.gmf.examples.layers.LayerEnablement#getLayer()
+ * @see #getLayerEnablement()
+ * @generated
+ */
+ EReference getLayerEnablement_Layer();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.examples.layers.LayerEnablement#isVisible <em>Visible</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Visible</em>'.
+ * @see org.eclipse.gmf.examples.layers.LayerEnablement#isVisible()
+ * @see #getLayerEnablement()
+ * @generated
+ */
+ EAttribute getLayerEnablement_Visible();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ LayersFactory getLayersFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSupportImpl <em>Sub Diagram Support</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.impl.SubDiagramSupportImpl
+ * @see org.eclipse.gmf.examples.layers.impl.LayersPackageImpl#getSubDiagramSupport()
+ * @generated
+ */
+ EClass SUB_DIAGRAM_SUPPORT = eINSTANCE.getSubDiagramSupport();
+
+ /**
+ * The meta object literal for the '<em><b>Layers</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference SUB_DIAGRAM_SUPPORT__LAYERS = eINSTANCE.getSubDiagramSupport_Layers();
+
+ /**
+ * The meta object literal for the '<em><b>Main Diagram</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM = eINSTANCE.getSubDiagramSupport_MainDiagram();
+
+ /**
+ * The meta object literal for the '<em><b>Sub Diagrams</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS = eINSTANCE.getSubDiagramSupport_SubDiagrams();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.gmf.examples.layers.impl.LayerImpl <em>Layer</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.impl.LayerImpl
+ * @see org.eclipse.gmf.examples.layers.impl.LayersPackageImpl#getLayer()
+ * @generated
+ */
+ EClass LAYER = eINSTANCE.getLayer();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute LAYER__NAME = eINSTANCE.getLayer_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Color Def</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute LAYER__COLOR_DEF = eINSTANCE.getLayer_ColorDef();
+
+ /**
+ * The meta object literal for the '<em><b>Participants</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference LAYER__PARTICIPANTS = eINSTANCE.getLayer_Participants();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSpecImpl <em>Sub Diagram Spec</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.impl.SubDiagramSpecImpl
+ * @see org.eclipse.gmf.examples.layers.impl.LayersPackageImpl#getSubDiagramSpec()
+ * @generated
+ */
+ EClass SUB_DIAGRAM_SPEC = eINSTANCE.getSubDiagramSpec();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SUB_DIAGRAM_SPEC__NAME = eINSTANCE.getSubDiagramSpec_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Showing</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SUB_DIAGRAM_SPEC__SHOWING = eINSTANCE.getSubDiagramSpec_Showing();
+
+ /**
+ * The meta object literal for the '<em><b>Diagram Layers</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS = eINSTANCE.getSubDiagramSpec_DiagramLayers();
+
+ /**
+ * The meta object literal for the '<em><b>Diagram</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference SUB_DIAGRAM_SPEC__DIAGRAM = eINSTANCE.getSubDiagramSpec_Diagram();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.gmf.examples.layers.impl.LayerEnablementImpl <em>Layer Enablement</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.impl.LayerEnablementImpl
+ * @see org.eclipse.gmf.examples.layers.impl.LayersPackageImpl#getLayerEnablement()
+ * @generated
+ */
+ EClass LAYER_ENABLEMENT = eINSTANCE.getLayerEnablement();
+
+ /**
+ * The meta object literal for the '<em><b>Layer</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference LAYER_ENABLEMENT__LAYER = eINSTANCE.getLayerEnablement_Layer();
+
+ /**
+ * The meta object literal for the '<em><b>Visible</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute LAYER_ENABLEMENT__VISIBLE = eINSTANCE.getLayerEnablement_Visible();
+
+ }
+
+} //LayersPackage
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/SubDiagramSpec.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/SubDiagramSpec.java
new file mode 100644
index 000000000..f88b6c02a
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/SubDiagramSpec.java
@@ -0,0 +1,135 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Sub Diagram Spec</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#isShowing <em>Showing</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#getDiagramLayers <em>Diagram Layers</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#getDiagram <em>Diagram</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSpec()
+ * @model
+ * @generated
+ */
+public interface SubDiagramSpec extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSpec_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Showing</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Showing</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Showing</em>' attribute.
+ * @see #setShowing(boolean)
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSpec_Showing()
+ * @model
+ * @generated
+ */
+ boolean isShowing();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#isShowing <em>Showing</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Showing</em>' attribute.
+ * @see #isShowing()
+ * @generated
+ */
+ void setShowing(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Diagram Layers</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.gmf.examples.layers.LayerEnablement}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Diagram Layers</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Diagram Layers</em>' containment reference list.
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSpec_DiagramLayers()
+ * @model containment="true"
+ * @generated
+ */
+ EList<LayerEnablement> getDiagramLayers();
+
+ /**
+ * Returns the value of the '<em><b>Diagram</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Diagram</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Diagram</em>' reference.
+ * @see #setDiagram(Diagram)
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSpec_Diagram()
+ * @model
+ * @generated
+ */
+ Diagram getDiagram();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec#getDiagram <em>Diagram</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Diagram</em>' reference.
+ * @see #getDiagram()
+ * @generated
+ */
+ void setDiagram(Diagram value);
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model
+ * @generated
+ */
+ LayerEnablement findLayerEnablement(Layer layer);
+
+} // SubDiagramSpec
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/SubDiagramSupport.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/SubDiagramSupport.java
new file mode 100644
index 000000000..5474b602c
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/SubDiagramSupport.java
@@ -0,0 +1,114 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Sub Diagram Support</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.examples.layers.SubDiagramSupport#getLayers <em>Layers</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.SubDiagramSupport#getMainDiagram <em>Main Diagram</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.SubDiagramSupport#getSubDiagrams <em>Sub Diagrams</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSupport()
+ * @model
+ * @generated
+ */
+public interface SubDiagramSupport extends EObject {
+ /**
+ * Returns the value of the '<em><b>Layers</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.gmf.examples.layers.Layer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Layers</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Layers</em>' containment reference list.
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSupport_Layers()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Layer> getLayers();
+
+ /**
+ * Returns the value of the '<em><b>Main Diagram</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Main Diagram</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Main Diagram</em>' containment reference.
+ * @see #setMainDiagram(SubDiagramSpec)
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSupport_MainDiagram()
+ * @model containment="true"
+ * @generated
+ */
+ SubDiagramSpec getMainDiagram();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.examples.layers.SubDiagramSupport#getMainDiagram <em>Main Diagram</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Main Diagram</em>' containment reference.
+ * @see #getMainDiagram()
+ * @generated
+ */
+ void setMainDiagram(SubDiagramSpec value);
+
+ /**
+ * Returns the value of the '<em><b>Sub Diagrams</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.gmf.examples.layers.SubDiagramSpec}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Sub Diagrams</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Sub Diagrams</em>' containment reference list.
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#getSubDiagramSupport_SubDiagrams()
+ * @model containment="true"
+ * @generated
+ */
+ EList<SubDiagramSpec> getSubDiagrams();
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model kind="operation"
+ * @generated
+ */
+ EList<SubDiagramSpec> getAllDiagrams();
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model
+ * @generated
+ */
+ SubDiagramSpec findDiagramSpec(Diagram diagram);
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model
+ * @generated
+ */
+ void ensureAllSubDiagramsHaveEnablementForAllLayers();
+
+} // SubDiagramSupport
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayerEnablementImpl.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayerEnablementImpl.java
new file mode 100644
index 000000000..136fb03ee
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayerEnablementImpl.java
@@ -0,0 +1,226 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayerEnablement;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Layer Enablement</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.LayerEnablementImpl#getLayer <em>Layer</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.LayerEnablementImpl#isVisible <em>Visible</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class LayerEnablementImpl extends EObjectImpl implements LayerEnablement {
+ /**
+ * The cached value of the '{@link #getLayer() <em>Layer</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLayer()
+ * @generated
+ * @ordered
+ */
+ protected Layer layer;
+
+ /**
+ * The default value of the '{@link #isVisible() <em>Visible</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isVisible()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean VISIBLE_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isVisible() <em>Visible</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isVisible()
+ * @generated
+ * @ordered
+ */
+ protected boolean visible = VISIBLE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LayerEnablementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LayersPackage.Literals.LAYER_ENABLEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Layer getLayer() {
+ if (layer != null && layer.eIsProxy()) {
+ InternalEObject oldLayer = (InternalEObject)layer;
+ layer = (Layer)eResolveProxy(oldLayer);
+ if (layer != oldLayer) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, LayersPackage.LAYER_ENABLEMENT__LAYER, oldLayer, layer));
+ }
+ }
+ return layer;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Layer basicGetLayer() {
+ return layer;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLayer(Layer newLayer) {
+ Layer oldLayer = layer;
+ layer = newLayer;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.LAYER_ENABLEMENT__LAYER, oldLayer, layer));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isVisible() {
+ return visible;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVisible(boolean newVisible) {
+ boolean oldVisible = visible;
+ visible = newVisible;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.LAYER_ENABLEMENT__VISIBLE, oldVisible, visible));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LayersPackage.LAYER_ENABLEMENT__LAYER:
+ if (resolve) return getLayer();
+ return basicGetLayer();
+ case LayersPackage.LAYER_ENABLEMENT__VISIBLE:
+ return isVisible();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LayersPackage.LAYER_ENABLEMENT__LAYER:
+ setLayer((Layer)newValue);
+ return;
+ case LayersPackage.LAYER_ENABLEMENT__VISIBLE:
+ setVisible((Boolean)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LayersPackage.LAYER_ENABLEMENT__LAYER:
+ setLayer((Layer)null);
+ return;
+ case LayersPackage.LAYER_ENABLEMENT__VISIBLE:
+ setVisible(VISIBLE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LayersPackage.LAYER_ENABLEMENT__LAYER:
+ return layer != null;
+ case LayersPackage.LAYER_ENABLEMENT__VISIBLE:
+ return visible != VISIBLE_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (visible: ");
+ result.append(visible);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LayerEnablementImpl
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayerImpl.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayerImpl.java
new file mode 100644
index 000000000..70376f3a8
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayerImpl.java
@@ -0,0 +1,258 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Layer</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.LayerImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.LayerImpl#getColorDef <em>Color Def</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.LayerImpl#getParticipants <em>Participants</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class LayerImpl extends EObjectImpl implements Layer {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getColorDef() <em>Color Def</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColorDef()
+ * @generated
+ * @ordered
+ */
+ protected static final String COLOR_DEF_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getColorDef() <em>Color Def</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColorDef()
+ * @generated
+ * @ordered
+ */
+ protected String colorDef = COLOR_DEF_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getParticipants() <em>Participants</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getParticipants()
+ * @generated
+ * @ordered
+ */
+ protected EList<EObject> participants;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LayerImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LayersPackage.Literals.LAYER;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.LAYER__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getColorDef() {
+ return colorDef;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setColorDef(String newColorDef) {
+ String oldColorDef = colorDef;
+ colorDef = newColorDef;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.LAYER__COLOR_DEF, oldColorDef, colorDef));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<EObject> getParticipants() {
+ if (participants == null) {
+ participants = new EObjectResolvingEList<EObject>(EObject.class, this, LayersPackage.LAYER__PARTICIPANTS);
+ }
+ return participants;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LayersPackage.LAYER__NAME:
+ return getName();
+ case LayersPackage.LAYER__COLOR_DEF:
+ return getColorDef();
+ case LayersPackage.LAYER__PARTICIPANTS:
+ return getParticipants();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LayersPackage.LAYER__NAME:
+ setName((String)newValue);
+ return;
+ case LayersPackage.LAYER__COLOR_DEF:
+ setColorDef((String)newValue);
+ return;
+ case LayersPackage.LAYER__PARTICIPANTS:
+ getParticipants().clear();
+ getParticipants().addAll((Collection<? extends EObject>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LayersPackage.LAYER__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case LayersPackage.LAYER__COLOR_DEF:
+ setColorDef(COLOR_DEF_EDEFAULT);
+ return;
+ case LayersPackage.LAYER__PARTICIPANTS:
+ getParticipants().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LayersPackage.LAYER__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case LayersPackage.LAYER__COLOR_DEF:
+ return COLOR_DEF_EDEFAULT == null ? colorDef != null : !COLOR_DEF_EDEFAULT.equals(colorDef);
+ case LayersPackage.LAYER__PARTICIPANTS:
+ return participants != null && !participants.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(", colorDef: ");
+ result.append(colorDef);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LayerImpl
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayersFactoryImpl.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayersFactoryImpl.java
new file mode 100644
index 000000000..659efb600
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayersFactoryImpl.java
@@ -0,0 +1,134 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayerEnablement;
+import org.eclipse.gmf.examples.layers.LayersFactory;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+import org.eclipse.gmf.examples.layers.SubDiagramSpec;
+import org.eclipse.gmf.examples.layers.SubDiagramSupport;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LayersFactoryImpl extends EFactoryImpl implements LayersFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static LayersFactory init() {
+ try {
+ LayersFactory theLayersFactory = (LayersFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/examples/gmf/visibility-layers");
+ if (theLayersFactory != null) {
+ return theLayersFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new LayersFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayersFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case LayersPackage.SUB_DIAGRAM_SUPPORT: return createSubDiagramSupport();
+ case LayersPackage.LAYER: return createLayer();
+ case LayersPackage.SUB_DIAGRAM_SPEC: return createSubDiagramSpec();
+ case LayersPackage.LAYER_ENABLEMENT: return createLayerEnablement();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SubDiagramSupport createSubDiagramSupport() {
+ SubDiagramSupportImpl subDiagramSupport = new SubDiagramSupportImpl();
+ return subDiagramSupport;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Layer createLayer() {
+ LayerImpl layer = new LayerImpl();
+ return layer;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SubDiagramSpec createSubDiagramSpec() {
+ SubDiagramSpecImpl subDiagramSpec = new SubDiagramSpecImpl();
+ return subDiagramSpec;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayerEnablement createLayerEnablement() {
+ LayerEnablementImpl layerEnablement = new LayerEnablementImpl();
+ return layerEnablement;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayersPackage getLayersPackage() {
+ return (LayersPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static LayersPackage getPackage() {
+ return LayersPackage.eINSTANCE;
+ }
+
+} //LayersFactoryImpl
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayersPackageImpl.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayersPackageImpl.java
new file mode 100644
index 000000000..e79ea1daf
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/LayersPackageImpl.java
@@ -0,0 +1,382 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayerEnablement;
+import org.eclipse.gmf.examples.layers.LayersFactory;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+import org.eclipse.gmf.examples.layers.SubDiagramSpec;
+import org.eclipse.gmf.examples.layers.SubDiagramSupport;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass subDiagramSupportEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass layerEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass subDiagramSpecEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass layerEnablementEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.gmf.examples.layers.LayersPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private LayersPackageImpl() {
+ super(eNS_URI, LayersFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link LayersPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static LayersPackage init() {
+ if (isInited) return (LayersPackage)EPackage.Registry.INSTANCE.getEPackage(LayersPackage.eNS_URI);
+
+ // Obtain or create and register package
+ LayersPackageImpl theLayersPackage = (LayersPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof LayersPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new LayersPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ NotationPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theLayersPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theLayersPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theLayersPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(LayersPackage.eNS_URI, theLayersPackage);
+ return theLayersPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getSubDiagramSupport() {
+ return subDiagramSupportEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getSubDiagramSupport_Layers() {
+ return (EReference)subDiagramSupportEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getSubDiagramSupport_MainDiagram() {
+ return (EReference)subDiagramSupportEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getSubDiagramSupport_SubDiagrams() {
+ return (EReference)subDiagramSupportEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getLayer() {
+ return layerEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getLayer_Name() {
+ return (EAttribute)layerEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getLayer_ColorDef() {
+ return (EAttribute)layerEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getLayer_Participants() {
+ return (EReference)layerEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getSubDiagramSpec() {
+ return subDiagramSpecEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getSubDiagramSpec_Name() {
+ return (EAttribute)subDiagramSpecEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getSubDiagramSpec_Showing() {
+ return (EAttribute)subDiagramSpecEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getSubDiagramSpec_DiagramLayers() {
+ return (EReference)subDiagramSpecEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getSubDiagramSpec_Diagram() {
+ return (EReference)subDiagramSpecEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getLayerEnablement() {
+ return layerEnablementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getLayerEnablement_Layer() {
+ return (EReference)layerEnablementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getLayerEnablement_Visible() {
+ return (EAttribute)layerEnablementEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayersFactory getLayersFactory() {
+ return (LayersFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @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.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ subDiagramSupportEClass = createEClass(SUB_DIAGRAM_SUPPORT);
+ createEReference(subDiagramSupportEClass, SUB_DIAGRAM_SUPPORT__LAYERS);
+ createEReference(subDiagramSupportEClass, SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM);
+ createEReference(subDiagramSupportEClass, SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS);
+
+ layerEClass = createEClass(LAYER);
+ createEAttribute(layerEClass, LAYER__NAME);
+ createEAttribute(layerEClass, LAYER__COLOR_DEF);
+ createEReference(layerEClass, LAYER__PARTICIPANTS);
+
+ subDiagramSpecEClass = createEClass(SUB_DIAGRAM_SPEC);
+ createEAttribute(subDiagramSpecEClass, SUB_DIAGRAM_SPEC__NAME);
+ createEAttribute(subDiagramSpecEClass, SUB_DIAGRAM_SPEC__SHOWING);
+ createEReference(subDiagramSpecEClass, SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS);
+ createEReference(subDiagramSpecEClass, SUB_DIAGRAM_SPEC__DIAGRAM);
+
+ layerEnablementEClass = createEClass(LAYER_ENABLEMENT);
+ createEReference(layerEnablementEClass, LAYER_ENABLEMENT__LAYER);
+ createEAttribute(layerEnablementEClass, LAYER_ENABLEMENT__VISIBLE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @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.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ NotationPackage theNotationPackage = (NotationPackage)EPackage.Registry.INSTANCE.getEPackage(NotationPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(subDiagramSupportEClass, SubDiagramSupport.class, "SubDiagramSupport", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getSubDiagramSupport_Layers(), this.getLayer(), null, "layers", null, 0, -1, SubDiagramSupport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getSubDiagramSupport_MainDiagram(), this.getSubDiagramSpec(), null, "mainDiagram", null, 0, 1, SubDiagramSupport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getSubDiagramSupport_SubDiagrams(), this.getSubDiagramSpec(), null, "subDiagrams", null, 0, -1, SubDiagramSupport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ addEOperation(subDiagramSupportEClass, this.getSubDiagramSpec(), "getAllDiagrams", 0, -1, IS_UNIQUE, IS_ORDERED);
+
+ EOperation op = addEOperation(subDiagramSupportEClass, this.getSubDiagramSpec(), "findDiagramSpec", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theNotationPackage.getDiagram(), "diagram", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ addEOperation(subDiagramSupportEClass, null, "ensureAllSubDiagramsHaveEnablementForAllLayers", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(layerEClass, Layer.class, "Layer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLayer_Name(), ecorePackage.getEString(), "name", null, 0, 1, Layer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getLayer_ColorDef(), ecorePackage.getEString(), "colorDef", null, 0, 1, Layer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getLayer_Participants(), ecorePackage.getEObject(), null, "participants", null, 0, -1, Layer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(subDiagramSpecEClass, SubDiagramSpec.class, "SubDiagramSpec", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getSubDiagramSpec_Name(), ecorePackage.getEString(), "name", null, 0, 1, SubDiagramSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getSubDiagramSpec_Showing(), ecorePackage.getEBoolean(), "showing", null, 0, 1, SubDiagramSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getSubDiagramSpec_DiagramLayers(), this.getLayerEnablement(), null, "diagramLayers", null, 0, -1, SubDiagramSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getSubDiagramSpec_Diagram(), theNotationPackage.getDiagram(), null, "diagram", null, 0, 1, SubDiagramSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ op = addEOperation(subDiagramSpecEClass, this.getLayerEnablement(), "findLayerEnablement", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, this.getLayer(), "layer", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(layerEnablementEClass, LayerEnablement.class, "LayerEnablement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getLayerEnablement_Layer(), this.getLayer(), null, "layer", null, 0, 1, LayerEnablement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getLayerEnablement_Visible(), ecorePackage.getEBoolean(), "visible", null, 0, 1, LayerEnablement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //LayersPackageImpl
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/SubDiagramSpecImpl.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/SubDiagramSpecImpl.java
new file mode 100644
index 000000000..6a27d2f61
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/SubDiagramSpecImpl.java
@@ -0,0 +1,355 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayerEnablement;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+import org.eclipse.gmf.examples.layers.SubDiagramSpec;
+import org.eclipse.gmf.runtime.notation.Diagram;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Sub Diagram Spec</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSpecImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSpecImpl#isShowing <em>Showing</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSpecImpl#getDiagramLayers <em>Diagram Layers</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSpecImpl#getDiagram <em>Diagram</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class SubDiagramSpecImpl extends EObjectImpl implements SubDiagramSpec {
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isShowing() <em>Showing</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isShowing()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean SHOWING_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isShowing() <em>Showing</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isShowing()
+ * @generated
+ * @ordered
+ */
+ protected boolean showing = SHOWING_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getDiagramLayers() <em>Diagram Layers</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDiagramLayers()
+ * @generated
+ * @ordered
+ */
+ protected EList<LayerEnablement> diagramLayers;
+
+ /**
+ * The cached value of the '{@link #getDiagram() <em>Diagram</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDiagram()
+ * @generated
+ * @ordered
+ */
+ protected Diagram diagram;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected SubDiagramSpecImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LayersPackage.Literals.SUB_DIAGRAM_SPEC;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.SUB_DIAGRAM_SPEC__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isShowing() {
+ return showing;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setShowing(boolean newShowing) {
+ boolean oldShowing = showing;
+ showing = newShowing;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.SUB_DIAGRAM_SPEC__SHOWING, oldShowing, showing));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<LayerEnablement> getDiagramLayers() {
+ if (diagramLayers == null) {
+ diagramLayers = new EObjectContainmentEList<LayerEnablement>(LayerEnablement.class, this, LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS);
+ }
+ return diagramLayers;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagram getDiagram() {
+ if (diagram != null && diagram.eIsProxy()) {
+ InternalEObject oldDiagram = (InternalEObject)diagram;
+ diagram = (Diagram)eResolveProxy(oldDiagram);
+ if (diagram != oldDiagram) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM, oldDiagram, diagram));
+ }
+ }
+ return diagram;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagram basicGetDiagram() {
+ return diagram;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDiagram(Diagram newDiagram) {
+ Diagram oldDiagram = diagram;
+ diagram = newDiagram;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM, oldDiagram, diagram));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public LayerEnablement findLayerEnablement(Layer layer) {
+ if (layer == null) {
+ return null;
+ }
+ for (LayerEnablement next : getDiagramLayers()) {
+ if (next.getLayer() == layer) {
+ return next;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS:
+ return ((InternalEList<?>)getDiagramLayers()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SPEC__NAME:
+ return getName();
+ case LayersPackage.SUB_DIAGRAM_SPEC__SHOWING:
+ return isShowing();
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS:
+ return getDiagramLayers();
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM:
+ if (resolve) return getDiagram();
+ return basicGetDiagram();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SPEC__NAME:
+ setName((String)newValue);
+ return;
+ case LayersPackage.SUB_DIAGRAM_SPEC__SHOWING:
+ setShowing((Boolean)newValue);
+ return;
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS:
+ getDiagramLayers().clear();
+ getDiagramLayers().addAll((Collection<? extends LayerEnablement>)newValue);
+ return;
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM:
+ setDiagram((Diagram)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SPEC__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case LayersPackage.SUB_DIAGRAM_SPEC__SHOWING:
+ setShowing(SHOWING_EDEFAULT);
+ return;
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS:
+ getDiagramLayers().clear();
+ return;
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM:
+ setDiagram((Diagram)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SPEC__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case LayersPackage.SUB_DIAGRAM_SPEC__SHOWING:
+ return showing != SHOWING_EDEFAULT;
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM_LAYERS:
+ return diagramLayers != null && !diagramLayers.isEmpty();
+ case LayersPackage.SUB_DIAGRAM_SPEC__DIAGRAM:
+ return diagram != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(", showing: ");
+ result.append(showing);
+ result.append(')');
+ return result.toString();
+ }
+
+} //SubDiagramSpecImpl
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/SubDiagramSupportImpl.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/SubDiagramSupportImpl.java
new file mode 100644
index 000000000..888f5c127
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/impl/SubDiagramSupportImpl.java
@@ -0,0 +1,322 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayerEnablement;
+import org.eclipse.gmf.examples.layers.LayersFactory;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+import org.eclipse.gmf.examples.layers.SubDiagramSpec;
+import org.eclipse.gmf.examples.layers.SubDiagramSupport;
+import org.eclipse.gmf.runtime.notation.Diagram;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Sub Diagram Support</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSupportImpl#getLayers <em>Layers</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSupportImpl#getMainDiagram <em>Main Diagram</em>}</li>
+ * <li>{@link org.eclipse.gmf.examples.layers.impl.SubDiagramSupportImpl#getSubDiagrams <em>Sub Diagrams</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class SubDiagramSupportImpl extends EObjectImpl implements SubDiagramSupport {
+
+ /**
+ * The cached value of the '{@link #getLayers() <em>Layers</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLayers()
+ * @generated
+ * @ordered
+ */
+ protected EList<Layer> layers;
+
+ /**
+ * The cached value of the '{@link #getMainDiagram() <em>Main Diagram</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMainDiagram()
+ * @generated
+ * @ordered
+ */
+ protected SubDiagramSpec mainDiagram;
+
+ /**
+ * The cached value of the '{@link #getSubDiagrams() <em>Sub Diagrams</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSubDiagrams()
+ * @generated
+ * @ordered
+ */
+ protected EList<SubDiagramSpec> subDiagrams;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected SubDiagramSupportImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LayersPackage.Literals.SUB_DIAGRAM_SUPPORT;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Layer> getLayers() {
+ if (layers == null) {
+ layers = new EObjectContainmentEList<Layer>(Layer.class, this, LayersPackage.SUB_DIAGRAM_SUPPORT__LAYERS);
+ }
+ return layers;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SubDiagramSpec getMainDiagram() {
+ return mainDiagram;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetMainDiagram(SubDiagramSpec newMainDiagram, NotificationChain msgs) {
+ SubDiagramSpec oldMainDiagram = mainDiagram;
+ mainDiagram = newMainDiagram;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM, oldMainDiagram, newMainDiagram);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setMainDiagram(SubDiagramSpec newMainDiagram) {
+ if (newMainDiagram != mainDiagram) {
+ NotificationChain msgs = null;
+ if (mainDiagram != null)
+ msgs = ((InternalEObject)mainDiagram).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM, null, msgs);
+ if (newMainDiagram != null)
+ msgs = ((InternalEObject)newMainDiagram).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM, null, msgs);
+ msgs = basicSetMainDiagram(newMainDiagram, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM, newMainDiagram, newMainDiagram));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<SubDiagramSpec> getSubDiagrams() {
+ if (subDiagrams == null) {
+ subDiagrams = new EObjectContainmentEList<SubDiagramSpec>(SubDiagramSpec.class, this, LayersPackage.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS);
+ }
+ return subDiagrams;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public EList<SubDiagramSpec> getAllDiagrams() {
+ BasicEList<SubDiagramSpec> result = new BasicEList<SubDiagramSpec>();
+ if (getMainDiagram() != null){
+ result.add(getMainDiagram());
+ }
+ result.addAll(getSubDiagrams());
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public SubDiagramSpec findDiagramSpec(Diagram diagram) {
+ if (diagram == null) {
+ return null;
+ }
+ if (getMainDiagram() != null && getMainDiagram().getDiagram() == diagram) {
+ return getMainDiagram();
+ }
+ for (SubDiagramSpec next : getSubDiagrams()) {
+ if (next.getDiagram() == diagram) {
+ return next;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void ensureAllSubDiagramsHaveEnablementForAllLayers() {
+ List<SubDiagramSpec> allDiagrams = new ArrayList<SubDiagramSpec>(getSubDiagrams().size() + 1);
+ if (getMainDiagram() != null) {
+ allDiagrams.add(getMainDiagram());
+ }
+ allDiagrams.addAll(getSubDiagrams());
+
+ for (Layer nextLayer : getLayers()) {
+ for (SubDiagramSpec nextDiagram : allDiagrams) {
+ LayerEnablement enablement = nextDiagram.findLayerEnablement(nextLayer);
+ if (enablement == null) {
+ enablement = LayersFactory.eINSTANCE.createLayerEnablement();
+ enablement.setLayer(nextLayer);
+ enablement.setVisible(false);
+ nextDiagram.getDiagramLayers().add(enablement);
+ }
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__LAYERS:
+ return ((InternalEList<?>)getLayers()).basicRemove(otherEnd, msgs);
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM:
+ return basicSetMainDiagram(null, msgs);
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS:
+ return ((InternalEList<?>)getSubDiagrams()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__LAYERS:
+ return getLayers();
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM:
+ return getMainDiagram();
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS:
+ return getSubDiagrams();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__LAYERS:
+ getLayers().clear();
+ getLayers().addAll((Collection<? extends Layer>)newValue);
+ return;
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM:
+ setMainDiagram((SubDiagramSpec)newValue);
+ return;
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS:
+ getSubDiagrams().clear();
+ getSubDiagrams().addAll((Collection<? extends SubDiagramSpec>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__LAYERS:
+ getLayers().clear();
+ return;
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM:
+ setMainDiagram((SubDiagramSpec)null);
+ return;
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS:
+ getSubDiagrams().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__LAYERS:
+ return layers != null && !layers.isEmpty();
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__MAIN_DIAGRAM:
+ return mainDiagram != null;
+ case LayersPackage.SUB_DIAGRAM_SUPPORT__SUB_DIAGRAMS:
+ return subDiagrams != null && !subDiagrams.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //SubDiagramSupportImpl
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/util/LayersAdapterFactory.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/util/LayersAdapterFactory.java
new file mode 100644
index 000000000..09ac02d66
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/util/LayersAdapterFactory.java
@@ -0,0 +1,179 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayerEnablement;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+import org.eclipse.gmf.examples.layers.SubDiagramSpec;
+import org.eclipse.gmf.examples.layers.SubDiagramSupport;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.LayersPackage
+ * @generated
+ */
+public class LayersAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static LayersPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayersAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = LayersPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LayersSwitch<Adapter> modelSwitch =
+ new LayersSwitch<Adapter>() {
+ @Override
+ public Adapter caseSubDiagramSupport(SubDiagramSupport object) {
+ return createSubDiagramSupportAdapter();
+ }
+ @Override
+ public Adapter caseLayer(Layer object) {
+ return createLayerAdapter();
+ }
+ @Override
+ public Adapter caseSubDiagramSpec(SubDiagramSpec object) {
+ return createSubDiagramSpecAdapter();
+ }
+ @Override
+ public Adapter caseLayerEnablement(LayerEnablement object) {
+ return createLayerEnablementAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gmf.examples.layers.SubDiagramSupport <em>Sub Diagram Support</em>}'.
+ * <!-- begin-user-doc -->
+ * 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.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSupport
+ * @generated
+ */
+ public Adapter createSubDiagramSupportAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gmf.examples.layers.Layer <em>Layer</em>}'.
+ * <!-- begin-user-doc -->
+ * 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.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gmf.examples.layers.Layer
+ * @generated
+ */
+ public Adapter createLayerAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gmf.examples.layers.SubDiagramSpec <em>Sub Diagram Spec</em>}'.
+ * <!-- begin-user-doc -->
+ * 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.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gmf.examples.layers.SubDiagramSpec
+ * @generated
+ */
+ public Adapter createSubDiagramSpecAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gmf.examples.layers.LayerEnablement <em>Layer Enablement</em>}'.
+ * <!-- begin-user-doc -->
+ * 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.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gmf.examples.layers.LayerEnablement
+ * @generated
+ */
+ public Adapter createLayerEnablementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //LayersAdapterFactory
diff --git a/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/util/LayersSwitch.java b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/util/LayersSwitch.java
new file mode 100644
index 000000000..4e78d2fad
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.layers/src/org/eclipse/gmf/examples/layers/util/LayersSwitch.java
@@ -0,0 +1,179 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.examples.layers.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.Switch;
+import org.eclipse.gmf.examples.layers.Layer;
+import org.eclipse.gmf.examples.layers.LayerEnablement;
+import org.eclipse.gmf.examples.layers.LayersPackage;
+import org.eclipse.gmf.examples.layers.SubDiagramSpec;
+import org.eclipse.gmf.examples.layers.SubDiagramSupport;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> 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.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.examples.layers.LayersPackage
+ * @generated
+ */
+public class LayersSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static LayersPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LayersSwitch() {
+ if (modelPackage == null) {
+ modelPackage = LayersPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case LayersPackage.SUB_DIAGRAM_SUPPORT: {
+ SubDiagramSupport subDiagramSupport = (SubDiagramSupport)theEObject;
+ T result = caseSubDiagramSupport(subDiagramSupport);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case LayersPackage.LAYER: {
+ Layer layer = (Layer)theEObject;
+ T result = caseLayer(layer);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case LayersPackage.SUB_DIAGRAM_SPEC: {
+ SubDiagramSpec subDiagramSpec = (SubDiagramSpec)theEObject;
+ T result = caseSubDiagramSpec(subDiagramSpec);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case LayersPackage.LAYER_ENABLEMENT: {
+ LayerEnablement layerEnablement = (LayerEnablement)theEObject;
+ T result = caseLayerEnablement(layerEnablement);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Sub Diagram Support</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Sub Diagram Support</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseSubDiagramSupport(SubDiagramSupport object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Layer</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Layer</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLayer(Layer object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Sub Diagram Spec</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Sub Diagram Spec</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseSubDiagramSpec(SubDiagramSpec object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Layer Enablement</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Layer Enablement</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLayerEnablement(LayerEnablement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //LayersSwitch

Back to the top