1 |
3fb05254
|
n.hoffmann
|
/**
|
2 |
|
|
* Copyright (C) 2007 EDIT
|
3 |
|
|
* European Distributed Institute of Taxonomy
|
4 |
|
|
* http://www.e-taxonomy.eu
|
5 |
|
|
*
|
6 |
|
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
|
|
package eu.etaxonomy.taxeditor.preference.menu;
|
11 |
|
|
|
12 |
|
|
import java.util.Collection;
|
13 |
|
|
|
14 |
|
|
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
15 |
|
|
import org.eclipse.jface.viewers.Viewer;
|
16 |
|
|
|
17 |
|
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
18 |
|
|
|
19 |
|
|
/**
|
20 |
3be6ef3e
|
n.hoffmann
|
* <p>DefinedTermBaseContentProvider class.</p>
|
21 |
|
|
*
|
22 |
3fb05254
|
n.hoffmann
|
* @author n.hoffmann
|
23 |
|
|
* @created Aug 5, 2010
|
24 |
|
|
* @version 1.0
|
25 |
|
|
*/
|
26 |
|
|
public class DefinedTermBaseContentProvider implements
|
27 |
|
|
IStructuredContentProvider {
|
28 |
|
|
|
29 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
30 |
3fb05254
|
n.hoffmann
|
public Object[] getElements(Object inputElement) {
|
31 |
|
|
if(inputElement instanceof Collection){
|
32 |
|
|
return ((Collection<DefinedTermBase>) inputElement).toArray(new DefinedTermBase[0]);
|
33 |
|
|
}
|
34 |
|
|
return new Object[]{};
|
35 |
|
|
}
|
36 |
|
|
|
37 |
3be6ef3e
|
n.hoffmann
|
/**
|
38 |
|
|
* <p>dispose</p>
|
39 |
|
|
*/
|
40 |
3fb05254
|
n.hoffmann
|
public void dispose() {}
|
41 |
|
|
|
42 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
43 |
3fb05254
|
n.hoffmann
|
public void inputChanged(Viewer viewer, Object oldInput,
|
44 |
|
|
Object newInput) {}
|
45 |
|
|
}
|