Project

General

Profile

Download (1.29 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2014 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.editor.view.descriptive.handler;
11

    
12
import org.eclipse.core.commands.AbstractHandler;
13
import org.eclipse.core.commands.ExecutionEvent;
14
import org.eclipse.core.commands.ExecutionException;
15
import org.eclipse.ui.IWorkbenchPart;
16
import org.eclipse.ui.handlers.HandlerUtil;
17

    
18
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
19

    
20
/**
21
 * @author pplitzner
22
 * @date Nov 25, 2014
23
 *
24
 */
25
public class ToggleShowOnlyIndividualAssociationsHandler extends AbstractHandler {
26

    
27
    /* (non-Javadoc)
28
     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
29
     */
30
    @Override
31
    public Object execute(ExecutionEvent event) throws ExecutionException {
32
        IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
33
        if(activePart instanceof DescriptiveViewPart){
34
            DescriptiveViewPart descriptiveViewPart = (DescriptiveViewPart)activePart;
35
            descriptiveViewPart.toggleShowOnlyIndividualAssociations();
36
        }
37
        return null;
38
    }
39

    
40
}
(8-8/8)