1
|
/**
|
2
|
* Copyright (C) 2018 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
|
package eu.etaxonomy.taxeditor.view.webimport.termimport;
|
10
|
|
11
|
import org.eclipse.jface.viewers.ListViewer;
|
12
|
import org.eclipse.jface.viewers.TreeViewer;
|
13
|
import org.eclipse.swt.SWT;
|
14
|
import org.eclipse.swt.layout.GridData;
|
15
|
import org.eclipse.swt.layout.GridLayout;
|
16
|
import org.eclipse.swt.widgets.Button;
|
17
|
import org.eclipse.swt.widgets.Composite;
|
18
|
import org.eclipse.swt.widgets.Label;
|
19
|
import org.eclipse.swt.widgets.List;
|
20
|
import org.eclipse.swt.widgets.Text;
|
21
|
import org.eclipse.swt.widgets.Tree;
|
22
|
import org.eclipse.wb.swt.SWTResourceManager;
|
23
|
|
24
|
import eu.etaxonomy.cdm.api.service.IVocabularyService;
|
25
|
import eu.etaxonomy.cdm.model.common.TermVocabulary;
|
26
|
import eu.etaxonomy.taxeditor.model.ImageResources;
|
27
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
28
|
import eu.etaxonomy.taxeditor.ui.combo.termvocabulary.TermVocabularyComboViewer;
|
29
|
|
30
|
/**
|
31
|
* @author pplitzner
|
32
|
* @since Apr 23, 2018
|
33
|
*
|
34
|
*/
|
35
|
public class GfBioTerminologyImportComposite extends Composite{
|
36
|
private TreeViewer treeTermHierarchy;
|
37
|
private Text txtSearch;
|
38
|
private Button btnSearch;
|
39
|
private Composite composite;
|
40
|
private Composite composite_1;
|
41
|
private Composite composite_2;
|
42
|
private Label lblNewLabel;
|
43
|
private Label lblNewLabel_1;
|
44
|
private Label lblNewLabel_2;
|
45
|
private Text txtLabel;
|
46
|
private Text txtUri;
|
47
|
private Text txtDescription;
|
48
|
private Label lblNewLabel_3;
|
49
|
private Composite composite_3;
|
50
|
private Label lblNewLabel_4;
|
51
|
private Button btnRemoveVocabulary;
|
52
|
private TermVocabularyComboViewer termVocabularyComboViewer;
|
53
|
private List list;
|
54
|
private ListViewer listSynonyms;
|
55
|
private Composite composite_4;
|
56
|
private Label lblNewLabel_5;
|
57
|
private Composite composite_5;
|
58
|
private Label lblResultCount;
|
59
|
private Label lblNewLabel_6;
|
60
|
private Text textOntologies;
|
61
|
private Button btnChooseOntology;
|
62
|
|
63
|
public GfBioTerminologyImportComposite(Composite parent, int style) {
|
64
|
super(parent, style);
|
65
|
setLayout(new GridLayout(1, false));
|
66
|
|
67
|
composite = new Composite(this, SWT.NONE);
|
68
|
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
|
69
|
composite.setLayout(new GridLayout(2, false));
|
70
|
|
71
|
txtSearch = new Text(composite, SWT.BORDER);
|
72
|
txtSearch.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
|
73
|
|
74
|
btnSearch = new Button(composite, SWT.NONE);
|
75
|
btnSearch.setText("Search");
|
76
|
|
77
|
composite_3 = new Composite(this, SWT.NONE);
|
78
|
composite_3.setLayout(new GridLayout(6, false));
|
79
|
composite_3.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
|
80
|
|
81
|
lblNewLabel_6 = new Label(composite_3, SWT.NONE);
|
82
|
lblNewLabel_6.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
|
83
|
lblNewLabel_6.setText("Ontology");
|
84
|
|
85
|
textOntologies = new Text(composite_3, SWT.BORDER);
|
86
|
textOntologies.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
|
87
|
|
88
|
btnChooseOntology = new Button(composite_3, SWT.NONE);
|
89
|
btnChooseOntology.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
|
90
|
|
91
|
lblNewLabel_4 = new Label(composite_3, SWT.NONE);
|
92
|
lblNewLabel_4.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
|
93
|
lblNewLabel_4.setText("Import Vocabulary");
|
94
|
|
95
|
termVocabularyComboViewer = new TermVocabularyComboViewer(composite_3, SWT.NONE);
|
96
|
termVocabularyComboViewer.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1));
|
97
|
termVocabularyComboViewer.setInput(CdmStore.getService(IVocabularyService.class).list(TermVocabulary.class, null, null, null, null));
|
98
|
|
99
|
btnRemoveVocabulary = new Button(composite_3, SWT.NONE);
|
100
|
btnRemoveVocabulary.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
|
101
|
btnRemoveVocabulary.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
|
102
|
|
103
|
composite_2 = new Composite(this, SWT.NONE);
|
104
|
composite_2.setLayout(new GridLayout(2, false));
|
105
|
composite_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
106
|
|
107
|
composite_4 = new Composite(composite_2, SWT.NONE);
|
108
|
composite_4.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
109
|
composite_4.setLayout(new GridLayout(1, false));
|
110
|
|
111
|
treeTermHierarchy = new TreeViewer(composite_4, SWT.BORDER);
|
112
|
Tree tree = treeTermHierarchy.getTree();
|
113
|
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
114
|
|
115
|
composite_5 = new Composite(composite_4, SWT.NONE);
|
116
|
composite_5.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
|
117
|
composite_5.setLayout(new GridLayout(2, false));
|
118
|
|
119
|
lblNewLabel_5 = new Label(composite_5, SWT.NONE);
|
120
|
lblNewLabel_5.setText("Results found:");
|
121
|
|
122
|
lblResultCount = new Label(composite_5, SWT.NONE);
|
123
|
lblResultCount.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
|
124
|
|
125
|
composite_1 = new Composite(composite_2, SWT.NONE);
|
126
|
composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
127
|
composite_1.setLayout(new GridLayout(2, false));
|
128
|
|
129
|
lblNewLabel = new Label(composite_1, SWT.NONE);
|
130
|
lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
|
131
|
lblNewLabel.setText("Label");
|
132
|
|
133
|
txtLabel = new Text(composite_1, SWT.NONE);
|
134
|
txtLabel.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
|
135
|
txtLabel.setEditable(false);
|
136
|
txtLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
|
137
|
|
138
|
lblNewLabel_1 = new Label(composite_1, SWT.NONE);
|
139
|
lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
|
140
|
lblNewLabel_1.setText("URI");
|
141
|
|
142
|
txtUri = new Text(composite_1, SWT.NONE);
|
143
|
txtUri.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
|
144
|
txtUri.setEditable(false);
|
145
|
txtUri.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
|
146
|
|
147
|
lblNewLabel_2 = new Label(composite_1, SWT.NONE);
|
148
|
lblNewLabel_2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
|
149
|
lblNewLabel_2.setText("Description");
|
150
|
|
151
|
txtDescription = new Text(composite_1, SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
|
152
|
txtDescription.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
|
153
|
txtDescription.setEditable(false);
|
154
|
txtDescription.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
155
|
|
156
|
lblNewLabel_3 = new Label(composite_1, SWT.NONE);
|
157
|
lblNewLabel_3.setText("Synonyms");
|
158
|
|
159
|
listSynonyms = new ListViewer(composite_1, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
|
160
|
list = listSynonyms.getList();
|
161
|
list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
162
|
list.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
|
163
|
}
|
164
|
public TreeViewer getTreeTermHierarchy() {
|
165
|
return treeTermHierarchy;
|
166
|
}
|
167
|
public Button getBtnSearch() {
|
168
|
return btnSearch;
|
169
|
}
|
170
|
public Text getTxtSearch() {
|
171
|
return txtSearch;
|
172
|
}
|
173
|
public Text getLblDescription() {
|
174
|
return txtDescription;
|
175
|
}
|
176
|
public Text getLblUri() {
|
177
|
return txtUri;
|
178
|
}
|
179
|
public Text getLblLabel() {
|
180
|
return txtLabel;
|
181
|
}
|
182
|
public ListViewer getListSynonyms() {
|
183
|
return listSynonyms;
|
184
|
}
|
185
|
public TermVocabularyComboViewer getTermVocabularyComboViewer() {
|
186
|
return termVocabularyComboViewer;
|
187
|
}
|
188
|
public Button getBtnRemoveVocabulary() {
|
189
|
return btnRemoveVocabulary;
|
190
|
}
|
191
|
public Label getLblResultCount() {
|
192
|
return lblResultCount;
|
193
|
}
|
194
|
public Text getTextOntologies() {
|
195
|
return textOntologies;
|
196
|
}
|
197
|
public Button getBtnChooseOntology() {
|
198
|
return btnChooseOntology;
|
199
|
}
|
200
|
}
|