commit 04d9b6cb9fa0242cbeb8b166f0074068fadf347c
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Mon Oct 30 19:36:27 2017 +0100

    ref #6909 Add "Collapse" toolbar item to navigator

diff --git a/eu.etaxonomy.taxeditor.navigation/fragment.e4xmi b/eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
index 93c6078a8..5d52d8ea1 100644
--- a/eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
+++ b/eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
@@ -17,6 +17,7 @@
   <imports xsi:type="commands:Command" xmi:id="_lMwZ8KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCsvName"/>
   <imports xsi:type="commands:Command" xmi:id="_mOC30KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCsvPrint"/>
   <imports xsi:type="commands:Command" xmi:id="_n1FHEKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCdmLight"/>
+  <imports xsi:type="commands:Command" xmi:id="_aN3BsL2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.command.collapse"/>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_oDvMsCTfEeeiN5lBIuqN3g" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.trimcontribution.mainToolbar">
     <elements xsi:type="menu:ToolControl" xmi:id="_7kZI4CTfEeeiN5lBIuqN3g" elementId="eu.etaxonomy.taxeditor.navigation.toolcontrol.search_bar" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.search.SearchBar"/>
   </fragments>
@@ -104,6 +105,7 @@
         <command href="../eu.etaxonomy.taxeditor.editor/fragment.e4xmi#_j2cfsJMmEeeR4YRjNqCKeA"/>
       </handlers>
       <handlers xmi:id="_-GirMLVbEeeZf_R8QJbACw" elementId="eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.LinkWithTaxonHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.LinkWithTaxonHandlerE4" command="_6iiY8LVbEeeZf_R8QJbACw"/>
+      <handlers xmi:id="_twgh8L2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.CollapseHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.CollapseHandler" command="_aN3BsL2gEeeyWfw0n8-ICQ"/>
       <menus xsi:type="menu:PopupMenu" xmi:id="_XNXnkJIvEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigator.popupmenu.taxonnavigator">
         <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_5ydggKkeEeejedk4mZQIGw" coreExpressionId="isCdmStoreConnected"/>
         <children xsi:type="menu:Menu" xmi:id="_yzFmYJIvEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.menu.new" label="%menu.label">
@@ -151,6 +153,7 @@
         <children xsi:type="menu:HandledMenuItem" xmi:id="_0FX4MJIwEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.refresh" label="%command.label.11" command="_ukhM0JIyEeeJAdt8ZUxyaw"/>
       </menus>
       <toolbar xmi:id="_2PnD8L2aEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.navigation.toolbar.0">
+        <children xsi:type="menu:HandledToolItem" xmi:id="_KoxjML2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.navigation.handledtoolitem.collapse" label="Collapse" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/collapseall.gif" command="_aN3BsL2gEeeyWfw0n8-ICQ"/>
         <children xsi:type="menu:HandledToolItem" xmi:id="_IO57EL2bEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.navigation.handledtoolitem.syncwithtaxonselectio" label="Sync with taxon selectio" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/synced.gif" type="Check" command="_6iiY8LVbEeeZf_R8QJbACw"/>
       </toolbar>
     </elements>
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/CollapseHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/CollapseHandler.java
new file mode 100644
index 000000000..abffcb9a9
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/CollapseHandler.java
@@ -0,0 +1,20 @@
+
+package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.services.IServiceConstants;
+
+import eu.etaxonomy.taxeditor.navigation.navigator.e4.TaxonNavigatorE4;
+
+public class CollapseHandler {
+
+    @Execute
+    public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
+        TaxonNavigatorE4 taxonNavigator = (TaxonNavigatorE4) activePart.getObject();
+		taxonNavigator.getViewer().collapseAll();
+	}
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.workbench/fragment.e4xmi b/eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
index 8f5880c48..f2a83ae4b 100644
--- a/eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
+++ b/eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
@@ -107,6 +107,7 @@
     <elements xsi:type="commands:Command" xmi:id="_hMjgECZsEeer_rabtodzWA" elementId="eu.etaxonomy.taxeditor.command.openPart" commandName="Open Part">
       <parameters xmi:id="_hMjgESZsEeer_rabtodzWA" elementId="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" name="partName" optional="false"/>
     </elements>
+    <elements xsi:type="commands:Command" xmi:id="_S00XkL2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.command.collapse" commandName="Collapse"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_WLNcQCQsEeeq76l4saMAFQ" featurename="handlers" parentElementId="org.eclipse.e4.legacy.ide.application">
     <elements xsi:type="commands:Handler" xmi:id="_WLNcQSQsEeeq76l4saMAFQ" elementId="eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.OpenExternalAboutPlatformHandler" command="_UZ2zYCQsEeeq76l4saMAFQ"/>
