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.editor.key.polytomous;
|
12
|
|
13
|
import org.eclipse.jface.viewers.ISelection;
|
14
|
import org.eclipse.jface.viewers.Viewer;
|
15
|
import org.eclipse.swt.SWT;
|
16
|
import org.eclipse.swt.layout.GridData;
|
17
|
import org.eclipse.swt.widgets.Composite;
|
18
|
import org.eclipse.swt.widgets.Control;
|
19
|
import org.eclipse.ui.forms.widgets.ScrolledForm;
|
20
|
|
21
|
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
|
22
|
|
23
|
/**
|
24
|
* @author n.hoffmann
|
25
|
* @created Apr 4, 2011
|
26
|
* @version 1.0
|
27
|
*/
|
28
|
public class PolytomousKeyListViewer extends Viewer {
|
29
|
|
30
|
private Object input;
|
31
|
private ISelection selection;
|
32
|
|
33
|
private Control control;
|
34
|
|
35
|
private final CdmFormFactory formFactory;
|
36
|
|
37
|
private final ScrolledForm form;
|
38
|
|
39
|
public PolytomousKeyListViewer(Composite parent) {
|
40
|
formFactory = new CdmFormFactory(parent.getDisplay());
|
41
|
form = formFactory.createScrolledForm(parent);
|
42
|
form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
43
|
}
|
44
|
|
45
|
/*
|
46
|
* (non-Javadoc)
|
47
|
*
|
48
|
* @see org.eclipse.jface.viewers.Viewer#getControl()
|
49
|
*/
|
50
|
@Override
|
51
|
public Control getControl() {
|
52
|
return control;
|
53
|
}
|
54
|
|
55
|
/*
|
56
|
* (non-Javadoc)
|
57
|
*
|
58
|
* @see org.eclipse.jface.viewers.Viewer#getInput()
|
59
|
*/
|
60
|
@Override
|
61
|
public Object getInput() {
|
62
|
return input;
|
63
|
}
|
64
|
|
65
|
/*
|
66
|
* (non-Javadoc)
|
67
|
*
|
68
|
* @see org.eclipse.jface.viewers.Viewer#getSelection()
|
69
|
*/
|
70
|
@Override
|
71
|
public ISelection getSelection() {
|
72
|
return selection;
|
73
|
}
|
74
|
|
75
|
/*
|
76
|
* (non-Javadoc)
|
77
|
*
|
78
|
* @see org.eclipse.jface.viewers.Viewer#refresh()
|
79
|
*/
|
80
|
@Override
|
81
|
public void refresh() {
|
82
|
|
83
|
}
|
84
|
|
85
|
/*
|
86
|
* (non-Javadoc)
|
87
|
*
|
88
|
* @see org.eclipse.jface.viewers.Viewer#setInput(java.lang.Object)
|
89
|
*/
|
90
|
@Override
|
91
|
public void setInput(Object input) {
|
92
|
this.input = input;
|
93
|
}
|
94
|
|
95
|
/*
|
96
|
* (non-Javadoc)
|
97
|
*
|
98
|
* @see
|
99
|
* org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
|
100
|
* .ISelection, boolean)
|
101
|
*/
|
102
|
@Override
|
103
|
public void setSelection(ISelection selection, boolean reveal) {
|
104
|
this.selection = selection;
|
105
|
}
|
106
|
|
107
|
}
|