1
|
/**
|
2
|
* Copyright (C) 2014 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.editor.view.descriptive.handler;
|
10
|
|
11
|
import org.eclipse.core.commands.AbstractHandler;
|
12
|
import org.eclipse.core.commands.ExecutionEvent;
|
13
|
import org.eclipse.core.commands.ExecutionException;
|
14
|
import org.eclipse.ui.IWorkbenchPart;
|
15
|
import org.eclipse.ui.handlers.HandlerUtil;
|
16
|
|
17
|
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
|
18
|
|
19
|
/**
|
20
|
* @author pplitzner
|
21
|
* @date Nov 25, 2014
|
22
|
*
|
23
|
*/
|
24
|
public class ToggleShowOnlyIndividualAssociationsHandler extends AbstractHandler {
|
25
|
|
26
|
/* (non-Javadoc)
|
27
|
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
|
28
|
*/
|
29
|
@Override
|
30
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
31
|
IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
|
32
|
if(activePart instanceof DescriptiveViewPart){
|
33
|
DescriptiveViewPart descriptiveViewPart = (DescriptiveViewPart)activePart;
|
34
|
descriptiveViewPart.toggleShowOnlyIndividualAssociations();
|
35
|
}
|
36
|
return null;
|
37
|
}
|
38
|
|
39
|
}
|