ref #6907 Add "collapse" item to factual data part
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 30 Oct 2017 19:10:42 +0000 (20:10 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 30 Oct 2017 19:10:42 +0000 (20:10 +0100)
eu.etaxonomy.taxeditor.editor/fragment.e4xmi
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java

index 82a5a275889062639f5d3b84d5455eb2f97283ba..ff49166ee0aebbefaea76946199549f069d18d7c 100644 (file)
@@ -4,6 +4,7 @@
   <imports xsi:type="commands:Command" xmi:id="_Qz6EMD62EeekvPZafWEv7w" elementId="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity"/>
   <imports xsi:type="commands:Command" xmi:id="_majwMEaQEeeXMc6kSYO7Xg" elementId="org.eclipse.ui.file.save"/>
   <imports xsi:type="commands:Command" xmi:id="_oBEz8GhvEee3K4uKJljEYg" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.removeFeature"/>
+  <imports xsi:type="commands:Command" xmi:id="_0WYQcL2lEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.command.collapse"/>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_gSpRsDQDEeeTNOFVGI4q2w" featurename="descriptors" parentElementId="xpath:/">
     <elements xsi:type="basic:PartDescriptor" xmi:id="_gSpRsTQDEeeTNOFVGI4q2w" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView" label="%command.label.DERIVATIVE_EDITOR" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/derivate_view-16x16-32.png" tooltip="%command.label.DERIVATIVE_EDITOR" allowMultiple="true" category="" closeable="true" dirtyable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
       <tags>View</tags>
       </menus>
       <toolbar xmi:id="_sfp2sL2jEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.editor.toolbar.0">
         <children xsi:type="menu:HandledToolItem" xmi:id="_t7kbEL2jEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.editor.handledtoolitem.commandname41" label="%command.name.41" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/link_obj.gif" type="Check" command="_4eDWoIy0EeeQaL4TL8oz7Q"/>
+        <children xsi:type="menu:HandledToolItem" xmi:id="_1ltxYL2lEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.editor.handledtoolitem.collapse" label="Collapse" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/collapseall.gif" command="_0WYQcL2lEeeyWfw0n8-ICQ"/>
       </toolbar>
     </elements>
     <elements xsi:type="basic:PartDescriptor" xmi:id="_KJxRIIZ4EeeOc9DZcjNN7g" elementId="eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4" label="%view.name.2" iconURI="" closeable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4">
index 71b440a8a93559fe0a2a2687f5b76d1f036b11ed..3854556c3f463f3ec4a89a8fb9298dfb1e18e215 100644 (file)
@@ -66,6 +66,7 @@ import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
 import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
 import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
+import eu.etaxonomy.taxeditor.workbench.part.ICollapsable;
 
 /**
  * @author pplitzner
@@ -73,7 +74,8 @@ import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
  *
  */
 public class FactualDataPartE4 extends AbstractCdmEditorPartE4
-        implements IPartContentHasDetails, IPartContentHasSupplementalData, ICdmEntitySessionEnabled {
+        implements IPartContentHasDetails, IPartContentHasSupplementalData, ICdmEntitySessionEnabled,
+        ICollapsable {
 
     /**
      * Maps {@link FeatureNodeContainerTree} to their corresponding {@link TaxonDescritpion}.<br>
@@ -272,6 +274,16 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
         super.changed(object);
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void collapse() {
+        if(viewer instanceof TreeViewer) {
+            ((TreeViewer) viewer).collapseAll();
+        }
+    }
+
     public void toggleShowOnlyIndividualAssociations(){
         //FIXME E4 migrate toggle menu icon
         provider.toggleShowOnlyIndividualAssociations();