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.preference.menu;
|
12
|
|
13
|
import java.util.Collection;
|
14
|
|
15
|
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
16
|
import org.eclipse.jface.viewers.Viewer;
|
17
|
|
18
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
19
|
|
20
|
/**
|
21
|
* <p>DefinedTermBaseContentProvider class.</p>
|
22
|
*
|
23
|
* @author n.hoffmann
|
24
|
* @created Aug 5, 2010
|
25
|
* @version 1.0
|
26
|
*/
|
27
|
public class DefinedTermBaseContentProvider implements
|
28
|
IStructuredContentProvider {
|
29
|
|
30
|
/** {@inheritDoc} */
|
31
|
public Object[] getElements(Object inputElement) {
|
32
|
if(inputElement instanceof Collection){
|
33
|
return ((Collection<DefinedTermBase>) inputElement).toArray(new DefinedTermBase[0]);
|
34
|
}
|
35
|
return new Object[]{};
|
36
|
}
|
37
|
|
38
|
/**
|
39
|
* <p>dispose</p>
|
40
|
*/
|
41
|
public void dispose() {}
|
42
|
|
43
|
/** {@inheritDoc} */
|
44
|
public void inputChanged(Viewer viewer, Object oldInput,
|
45
|
Object newInput) {}
|
46
|
}
|