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.concept;
|
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.bulkeditor.BulkEditor;
|
21
|
import eu.etaxonomy.taxeditor.editor.EditorUtil;
|
22
|
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
|
23
|
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
|
24
|
|
25
|
/**
|
26
|
* @author n.hoffmann
|
27
|
* @created Jan 24, 2011
|
28
|
* @version 1.0
|
29
|
*/
|
30
|
public class ConceptViewPartImpl extends ConceptViewPart {
|
31
|
private static final Logger logger = Logger.getLogger(ConceptViewPartImpl.class);
|
32
|
|
33
|
|
34
|
/* (non-Javadoc)
|
35
|
* @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
|
36
|
*/
|
37
|
@Override
|
38
|
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
|
39
|
if(EditorUtil.getActiveEditor() == null){
|
40
|
showEmptyPage();
|
41
|
return;
|
42
|
}
|
43
|
|
44
|
if(part instanceof BulkEditor){
|
45
|
showEmptyPage();
|
46
|
return;
|
47
|
}
|
48
|
|
49
|
if(part instanceof AbstractGraphKeyEditor){
|
50
|
showEmptyPage();
|
51
|
return;
|
52
|
}
|
53
|
|
54
|
if(part instanceof MultiPageTaxonEditor){
|
55
|
if(! part.equals(this.part)){
|
56
|
IEditorInput input = ((IEditorPart) part).getEditorInput();
|
57
|
showViewer(part, new StructuredSelection(input));
|
58
|
}
|
59
|
showViewer();
|
60
|
}
|
61
|
|
62
|
}
|
63
|
}
|