Project

General

Profile

« Previous | Next » 

Revision 04d9b6cb

Added by Patrick Plitzner almost 5 years ago

ref #6909 Add "Collapse" toolbar item to navigator

View differences:

eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
17 17
  <imports xsi:type="commands:Command" xmi:id="_lMwZ8KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCsvName"/>
18 18
  <imports xsi:type="commands:Command" xmi:id="_mOC30KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCsvPrint"/>
19 19
  <imports xsi:type="commands:Command" xmi:id="_n1FHEKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCdmLight"/>
20
  <imports xsi:type="commands:Command" xmi:id="_aN3BsL2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.command.collapse"/>
20 21
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_oDvMsCTfEeeiN5lBIuqN3g" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.trimcontribution.mainToolbar">
21 22
    <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"/>
22 23
  </fragments>
......
104 105
        <command href="../eu.etaxonomy.taxeditor.editor/fragment.e4xmi#_j2cfsJMmEeeR4YRjNqCKeA"/>
105 106
      </handlers>
106 107
      <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"/>
108
      <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"/>
107 109
      <menus xsi:type="menu:PopupMenu" xmi:id="_XNXnkJIvEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigator.popupmenu.taxonnavigator">
108 110
        <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_5ydggKkeEeejedk4mZQIGw" coreExpressionId="isCdmStoreConnected"/>
109 111
        <children xsi:type="menu:Menu" xmi:id="_yzFmYJIvEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.menu.new" label="%menu.label">
......
151 153
        <children xsi:type="menu:HandledMenuItem" xmi:id="_0FX4MJIwEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.refresh" label="%command.label.11" command="_ukhM0JIyEeeJAdt8ZUxyaw"/>
152 154
      </menus>
153 155
      <toolbar xmi:id="_2PnD8L2aEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.navigation.toolbar.0">
156
        <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"/>
154 157
        <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"/>
155 158
      </toolbar>
156 159
    </elements>
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/CollapseHandler.java
1

  
2
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler;
3

  
4
import javax.inject.Named;
5

  
6
import org.eclipse.e4.core.di.annotations.Execute;
7
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
8
import org.eclipse.e4.ui.services.IServiceConstants;
9

  
10
import eu.etaxonomy.taxeditor.navigation.navigator.e4.TaxonNavigatorE4;
11

  
12
public class CollapseHandler {
13

  
14
    @Execute
15
    public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
16
        TaxonNavigatorE4 taxonNavigator = (TaxonNavigatorE4) activePart.getObject();
17
		taxonNavigator.getViewer().collapseAll();
18
	}
19

  
20
}
eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
107 107
    <elements xsi:type="commands:Command" xmi:id="_hMjgECZsEeer_rabtodzWA" elementId="eu.etaxonomy.taxeditor.command.openPart" commandName="Open Part">
108 108
      <parameters xmi:id="_hMjgESZsEeer_rabtodzWA" elementId="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" name="partName" optional="false"/>
109 109
    </elements>
110
    <elements xsi:type="commands:Command" xmi:id="_S00XkL2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.command.collapse" commandName="Collapse"/>
110 111
  </fragments>
111 112
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_WLNcQCQsEeeq76l4saMAFQ" featurename="handlers" parentElementId="org.eclipse.e4.legacy.ide.application">
112 113
    <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"/>

Also available in: Unified diff