Project

General

Profile

Download (1.49 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.bulkeditor.BulkEditor;
22
import eu.etaxonomy.taxeditor.editor.EditorUtil;
23
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
24

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

    
35
	/** {@inheritDoc} */
36
	public void selectionChanged(IWorkbenchPart part, ISelection selection) {
37
		if(EditorUtil.getActiveEditor() == null){
38
			showEmptyPage();
39
			return;
40
		}
41
		
42
		if(part instanceof MultiPageTaxonEditor){
43
			IEditorInput input = ((IEditorPart) part).getEditorInput();
44
			showViewer(part, new StructuredSelection(input));
45
		}
46

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