Project

General

Profile

Download (1.44 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.media;
12

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

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

    
24
/**
25
 * <p>MediaViewPart class.</p>
26
 *
27
 * @author n.hoffmann
28
 * @created Jun 15, 2010
29
 * @version 1.0
30
 */
31
public class MediaViewPartImpl extends MediaViewPart {
32
	private static final Logger logger = Logger.getLogger(MediaViewPartImpl.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 MultiPageTaxonEditor){
42
			IEditorInput input = ((IEditorPart) part).getEditorInput();
43
			showViewer(part, new StructuredSelection(input));
44
		}
45

    
46
		if(part instanceof BulkEditor && selection instanceof IStructuredSelection){
47
			showViewer(part, (IStructuredSelection) selection);
48
		}
49
	}
50
}
    (1-1/1)