Project

General

Profile

Download (1.51 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2007 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

    
11
package eu.etaxonomy.taxeditor.singlesource.editor.view.descriptive;
12

    
13
import org.apache.log4j.Logger;
14
import org.eclipse.jface.viewers.ISelection;
15
import org.eclipse.jface.viewers.StructuredSelection;
16
import org.eclipse.ui.IEditorInput;
17
import org.eclipse.ui.IEditorPart;
18
import org.eclipse.ui.IWorkbenchPart;
19

    
20
import eu.etaxonomy.taxeditor.editor.EditorUtil;
21
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
22
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
23

    
24
/**
25
 * <p>DescriptiveViewPart class.</p>
26
 *
27
 * @author n.hoffmann
28
 * @created Jun 9, 2010
29
 * @version 1.0
30
 */
31
public class DescriptiveViewPartImpl extends DescriptiveViewPart {
32
	private static final Logger logger = Logger.getLogger(DescriptiveViewPartImpl.class);
33

    
34
	/** {@inheritDoc} */
35
	public void selectionChanged(IWorkbenchPart part, ISelection selection) {
36
		if(EditorUtil.getActiveEditor() == null){
37
			showEmptyPage();
38
			return;
39
		}
40
		
41
		if(part instanceof AbstractGraphKeyEditor){
42
			showEmptyPage();
43
			return;
44
		}
45
		
46
		if(part instanceof MultiPageTaxonEditor){
47
			if(! part.equals(this.part)){
48
				IEditorInput input = ((IEditorPart) part).getEditorInput();
49
				featureNodeContainerCache.clear();
50
				showViewer(part, new StructuredSelection(input));
51
			}
52
			showViewer();
53
		}
54
	}
55
}
(2-2/2)