Bug 551749 - [Tools] Application model editor doesn’t allow to create
CompositePart inside snippets in Application.xmi

Add Action for adding CompositePart in context menu and overview

Change-Id: I867295d554f5e5bc94085cd380c2e4f58d4cc3ac
Signed-off-by: Benedikt Kuntz <benedikt.kuntz@airbus.com>
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
index 5190449..33ff515 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.java
@@ -557,6 +557,7 @@
 	public String VWindowControlEditor_AddPartSashContainer;
 	public String VWindowControlEditor_AddPartStack;
 	public String VWindowControlEditor_AddPart;
+	public String VWindowControlEditor_AddCompositePart;
 	public String VWindowControlEditor_AddArea;
 
 	public String VWindowEditor_TreeLabel;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
index d0c8650..6b6f145 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Messages.properties
@@ -532,6 +532,7 @@
 VWindowControlEditor_AddPartSashContainer=Part Sash Container
 VWindowControlEditor_AddPartStack=Part Stack
 VWindowControlEditor_AddPart=Part
+VWindowControlEditor_AddCompositePart=Composite Part
 VWindowControlEditor_AddArea=Area
 
 VWindowEditor_TreeLabel=Windows
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/virtual/VSnippetsEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/virtual/VSnippetsEditor.java
index 32d68aa..eb5b43b 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/virtual/VSnippetsEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/virtual/VSnippetsEditor.java
@@ -46,8 +46,8 @@
 	/** Define the classes available to create snippets */
 	public static final EClass[] SNIPPET_CHILDREN = new EClass[] { AdvancedPackageImpl.Literals.AREA, BasicPackageImpl.Literals.PART,
 			BasicPackageImpl.Literals.PART_SASH_CONTAINER, BasicPackageImpl.Literals.PART_STACK,
-			AdvancedPackageImpl.Literals.PERSPECTIVE, AdvancedPackageImpl.Literals.PERSPECTIVE_STACK,
-			MenuPackageImpl.Literals.TRIM_CONTRIBUTION,
+			BasicPackageImpl.Literals.COMPOSITE_PART, AdvancedPackageImpl.Literals.PERSPECTIVE,
+			AdvancedPackageImpl.Literals.PERSPECTIVE_STACK, MenuPackageImpl.Literals.TRIM_CONTRIBUTION,
 			BasicPackageImpl.Literals.TRIMMED_WINDOW, BasicPackageImpl.Literals.WINDOW,
 			BasicPackageImpl.Literals.TRIM_BAR };
 
@@ -82,6 +82,14 @@
 			}
 		});
 
+		actions.add(new Action(Messages.VWindowControlEditor_AddCompositePart,
+				createImageDescriptor(ResourceProvider.IMG_PartSashContainer)) {
+			@Override
+			public void run() {
+				handleAdd(BasicPackageImpl.Literals.COMPOSITE_PART);
+			}
+		});
+
 		actions.add(new Action(Messages.VWindowControlEditor_AddPartSashContainer,
 				createImageDescriptor(ResourceProvider.IMG_PartSashContainer_vertical)) {
 			@Override