Bug 516466 - Model spy throws NotDefinedException

Change-Id: I6d70e5fc5949e11b47e296567ef0b2e15f323821
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/fragment.e4xmi b/bundles/org.eclipse.e4.tools.emf.ui/fragment.e4xmi
index 9c5b109..edea1fe 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/fragment.e4xmi
+++ b/bundles/org.eclipse.e4.tools.emf.ui/fragment.e4xmi
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="ASCII"?>
 <fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmi:id="_GxnD8Ly2EeOxWJvPH-7sUQ">
-  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_Kmj8QLy2EeOxWJvPH-7sUQ" featurename="commands" parentElementId="org.eclipse.e4.legacy.ide.application">
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_Kmj8QLy2EeOxWJvPH-7sUQ" featurename="commands" parentElementId="xpath:/">
     <elements xsi:type="commands:Command" xmi:id="_RRp7QLy2EeOxWJvPH-7sUQ" elementId="org.eclipse.e4.tools.emf.ui.command.mark_duplicate_ids" commandName="Mark Duplicate Model Element Ids" description="Marks Duplicate Model Element Ids"/>
     <elements xsi:type="commands:Command" xmi:id="_9ITpgL2IEeOqSr2XZwfnmA" elementId="org.eclipse.e4.tools.emf.ui.command.mark_duplicate_labels" commandName="Mark Duplicate Model Labels" description="Marks Duplicate Model Labels"/>
     <elements xsi:type="commands:Command" xmi:id="_RObi4L2MEeOqSr2XZwfnmA" elementId="org.eclipse.e4.tools.emf.ui.command.mark_duplicate_attributes" commandName="Mark Duplicate Model Attributes..." description="Marks Duplicate Model Attributes"/>
@@ -9,7 +9,7 @@
     <elements xsi:type="commands:Command" xmi:id="_jd7xgO5mEeOQXaYP-M2JBA" elementId="org.eclipse.e4.tools.emf.ui.command.autosizeColumns" commandName="Autosize Columns" description="Autosizes all columns to their content"/>
     <elements xsi:type="commands:Command" xmi:id="_vsQXAPFwEeOSJuCPb-hb7A" elementId="org.eclipse.e4.tools.emf.ui.command.resetToDefault" commandName="Reset To Default" description="Resets the table to default values"/>
   </fragments>
-  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_jtmcsLy3EeOxWJvPH-7sUQ" featurename="handlers" parentElementId="org.eclipse.e4.legacy.ide.application">
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_jtmcsLy3EeOxWJvPH-7sUQ" featurename="handlers" parentElementId="xpath:/">
     <elements xsi:type="commands:Handler" xmi:id="_p45hULy3EeOxWJvPH-7sUQ" elementId="org.eclipse.e4.tools.emf.ui.handler.mark_duplicate_ids" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.MarkDuplicateElementIdsHandler" command="_RRp7QLy2EeOxWJvPH-7sUQ"/>
     <elements xsi:type="commands:Handler" xmi:id="_AOEgkL2JEeOqSr2XZwfnmA" elementId="org.eclipse.e4.tools.emf.ui.handler.mark_duplicate_labels" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.MarkDuplicateLabelsHandler" command="_9ITpgL2IEeOqSr2XZwfnmA"/>
     <elements xsi:type="commands:Handler" xmi:id="_TgJt4L2MEeOqSr2XZwfnmA" elementId="org.eclipse.e4.tools.emf.ui.handler.mark_duplicate_attributes" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.MarkDuplicateAttributesHandler" command="_RObi4L2MEeOqSr2XZwfnmA"/>
@@ -18,22 +18,4 @@
     <elements xsi:type="commands:Handler" xmi:id="_hZcKMO5mEeOQXaYP-M2JBA" elementId="org.eclipse.e4.tools.emf.ui.handler.autosizeColumns" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.AutosizeColumnsHandler" command="_jd7xgO5mEeOQXaYP-M2JBA"/>
     <elements xsi:type="commands:Handler" xmi:id="_8AHVUPFwEeOSJuCPb-hb7A" elementId="org.eclipse.e4.tools.emf.ui.handler.resetToDefault" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.ResetToDefaultHandler" command="_vsQXAPFwEeOSJuCPb-hb7A"/>
   </fragments>
-  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_ph2FwAykEeS6HrzpXti93Q" featurename="commands" parentElementId="org.eclipse.e4.ide.application">
-    <elements xsi:type="commands:Command" xmi:id="_ph2FwQykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.command.mark_duplicate_ids" commandName="Mark Duplicate Model Element Ids" description="Marks Duplicate Model Element Ids"/>
-    <elements xsi:type="commands:Command" xmi:id="_ph2FwgykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.command.mark_duplicate_labels" commandName="Mark Duplicate Model Labels" description="Marks Duplicate Model Labels"/>
-    <elements xsi:type="commands:Command" xmi:id="_ph2FwwykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.command.mark_duplicate_attributes" commandName="Mark Duplicate Model Attributes..." description="Marks Duplicate Model Attributes"/>
-    <elements xsi:type="commands:Command" xmi:id="_ph2FxAykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.command.repair_duplicate_ids" commandName="Repair Duplicate Model Element IDs" description="Repairs Duplicate Model Element IDs"/>
-    <elements xsi:type="commands:Command" xmi:id="_ph2FxQykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.command.unmark" commandName="Unmark Model Items" description="Unmarks All Model Items"/>
-    <elements xsi:type="commands:Command" xmi:id="_ph2FxgykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.command.autosizeColumns" commandName="Autosize Columns" description="Autosizes all columns to their content"/>
-    <elements xsi:type="commands:Command" xmi:id="_ph2FxwykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.command.resetToDefault" commandName="Reset To Default" description="Resets the table to default values"/>
-  </fragments>
-  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_rSPFUAykEeS6HrzpXti93Q" featurename="handlers" parentElementId="org.eclipse.e4.ide.application">
-    <elements xsi:type="commands:Handler" xmi:id="_rSPFUQykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.handler.mark_duplicate_ids" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.MarkDuplicateElementIdsHandler" command="_RRp7QLy2EeOxWJvPH-7sUQ"/>
-    <elements xsi:type="commands:Handler" xmi:id="_rSPFUgykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.handler.mark_duplicate_labels" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.MarkDuplicateLabelsHandler" command="_9ITpgL2IEeOqSr2XZwfnmA"/>
-    <elements xsi:type="commands:Handler" xmi:id="_rSPFUwykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.handler.mark_duplicate_attributes" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.MarkDuplicateAttributesHandler" command="_RObi4L2MEeOqSr2XZwfnmA"/>
-    <elements xsi:type="commands:Handler" xmi:id="_rSPFVAykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.handler.repair_duplicate_ids" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.RepairDuplicateItemsHandler" command="_dySeYLzDEeO8eO1Rpb-rFA"/>
-    <elements xsi:type="commands:Handler" xmi:id="_rSPFVQykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.handler.unmark" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.UnmarkItemsHandler" command="_CFlw8L2LEeOqSr2XZwfnmA"/>
-    <elements xsi:type="commands:Handler" xmi:id="_rSPFVgykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.handler.autosizeColumns" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.AutosizeColumnsHandler" command="_jd7xgO5mEeOQXaYP-M2JBA"/>
-    <elements xsi:type="commands:Handler" xmi:id="_rSPFVwykEeS6HrzpXti93Q" elementId="org.eclipse.e4.tools.emf.ui.handler.resetToDefault" contributionURI="bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.ResetToDefaultHandler" command="_vsQXAPFwEeOSJuCPb-hb7A"/>
-  </fragments>
 </fragment:ModelFragments>
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/plugin.xml b/bundles/org.eclipse.e4.tools.emf.ui/plugin.xml
index aabe538..306ac2f 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/plugin.xml
+++ b/bundles/org.eclipse.e4.tools.emf.ui/plugin.xml
@@ -19,6 +19,7 @@
          id="id1"
          point="org.eclipse.e4.workbench.model">
       <fragment
+            apply="notexists"
             uri="fragment.e4xmi">
       </fragment>
    </extension>