Revision 0f993a84
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.navigation/fragment.e4xmi | ||
---|---|---|
39 | 39 |
<command href="../eu.etaxonomy.taxeditor.editor/fragment.e4xmi#_j2cfsJMmEeeR4YRjNqCKeA"/> |
40 | 40 |
</handlers> |
41 | 41 |
<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"/> |
42 |
<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"/> |
|
43 | 42 |
<menus xsi:type="menu:PopupMenu" xmi:id="_XNXnkJIvEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigator.popupmenu.taxonnavigator"> |
44 | 43 |
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_5ydggKkeEeejedk4mZQIGw" coreExpressionId="isCdmStoreConnected"/> |
45 | 44 |
<children xsi:type="menu:Menu" xmi:id="_yzFmYJIvEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.menu.new" label="%menu.label"> |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorE4.java | ||
---|---|---|
85 | 85 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
86 | 86 |
import eu.etaxonomy.taxeditor.store.LoginManager; |
87 | 87 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants; |
88 |
import eu.etaxonomy.taxeditor.workbench.part.ICollapsable; |
|
88 | 89 |
|
89 | 90 |
/** |
90 | 91 |
* |
... | ... | |
94 | 95 |
*/ |
95 | 96 |
public class TaxonNavigatorE4 implements |
96 | 97 |
IPostOperationEnabled, IConversationEnabled, Observer, |
97 |
ICdmEntitySessionEnabled, ICdmChangeListener, IContextListener { |
|
98 |
ICdmEntitySessionEnabled, ICdmChangeListener, IContextListener, |
|
99 |
ICollapsable { |
|
98 | 100 |
|
99 | 101 |
private static final String RESTORING_TAXON_NAVIGATOR = Messages.TaxonNavigator_RESTORE; |
100 | 102 |
|
... | ... | |
374 | 376 |
return new TreePath(pathList.toArray()); |
375 | 377 |
} |
376 | 378 |
|
379 |
/** |
|
380 |
* {@inheritDoc} |
|
381 |
*/ |
|
382 |
@Override |
|
383 |
public void collapse() { |
|
384 |
viewer.collapseAll(); |
|
385 |
} |
|
386 |
|
|
377 | 387 |
@Override |
378 | 388 |
public ConversationHolder getConversationHolder() { |
379 | 389 |
return conversation; |
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 | ||
---|---|---|
119 | 119 |
<elements xsi:type="commands:Handler" xmi:id="_nSIiECUKEeeHw5lTgGMs1Q" elementId="eu.etaxonomy.taxeditor.handler.OpenImportPreferenceHandler" command="_fdEqUCUKEeeHw5lTgGMs1Q"/> |
120 | 120 |
<elements xsi:type="commands:Handler" xmi:id="_2fnUYCZ0EeeQLpuomSmVoQ" elementId="eu.etaxonomy.taxeditor.workbench.OpenPartHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.OpenPartHandler" command="_hMjgECZsEeer_rabtodzWA"/> |
121 | 121 |
<elements xsi:type="commands:Handler" xmi:id="_dBGosFp0Eee4PsIXei-TMg" elementId="eu.etaxonomy.taxeditor.workbench.SaveHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.SaveHandler" command="_X-56IFp0Eee4PsIXei-TMg"/> |
122 |
<elements xsi:type="commands:Handler" xmi:id="_UvfiQL2lEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.handler.0" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.handler.CollapseHandler" command="_S00XkL2gEeeyWfw0n8-ICQ"/> |
|
122 | 123 |
</fragments> |
123 | 124 |
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_Z4f0kFsaEeebk7BsM35KOg" featurename="children" parentElementId="org.eclipse.ui.contexts.dialogAndWindow"> |
124 | 125 |
<elements xsi:type="commands:BindingContext" xmi:id="_5pEDMFsaEeebk7BsM35KOg" elementId="eu.etaxonomy.taxeditor.workbench.bindingcontext" name="Taxonomic Editor Keybinding Context"/> |
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/handler/CollapseHandler.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2017 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.workbench.handler; |
|
10 |
|
|
11 |
import javax.inject.Named; |
|
12 |
|
|
13 |
import org.eclipse.e4.core.di.annotations.Execute; |
|
14 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
|
15 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
16 |
|
|
17 |
import eu.etaxonomy.taxeditor.workbench.part.ICollapsable; |
|
18 |
|
|
19 |
/** |
|
20 |
* @author pplitzner |
|
21 |
* @since Oct 30, 2017 |
|
22 |
* |
|
23 |
*/ |
|
24 |
public class CollapseHandler { |
|
25 |
|
|
26 |
@Execute |
|
27 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) { |
|
28 |
Object object = activePart.getObject(); |
|
29 |
if(object instanceof ICollapsable){ |
|
30 |
((ICollapsable) object).collapse(); |
|
31 |
} |
|
32 |
} |
|
33 |
|
|
34 |
} |
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/ICollapsable.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2017 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.workbench.part; |
|
10 |
|
|
11 |
/** |
|
12 |
* Implementing classes should provide a tree viewer (or something alike) |
|
13 |
* which can be collapsed) |
|
14 |
* @author pplitzner |
|
15 |
* @since Oct 30, 2017 |
|
16 |
* |
|
17 |
*/ |
|
18 |
public interface ICollapsable { |
|
19 |
|
|
20 |
public void collapse(); |
|
21 |
|
|
22 |
} |
Also available in: Unified diff
ref #6925 Implemente generic CollapseHandler