Project

General

Profile

Download (8.12 KB) Statistics
| Branch: | Tag: | Revision:
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.term.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.TOP, false, false, 1, 1));
149
        lblNewLabel_2.setText("Description");
150

    
151
        txtDescription = new Text(composite_1, SWT.BORDER | 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.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
158
        lblNewLabel_3.setText("Synonyms");
159

    
160
        listSynonyms = new ListViewer(composite_1, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
161
        list = listSynonyms.getList();
162
        list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
163
        list.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
164
    }
165
    public TreeViewer getTreeTermHierarchy() {
166
        return treeTermHierarchy;
167
    }
168
    public Button getBtnSearch() {
169
        return btnSearch;
170
    }
171
    public Text getTxtSearch() {
172
        return txtSearch;
173
    }
174
    public Text getLblDescription() {
175
        return txtDescription;
176
    }
177
    public Text getLblUri() {
178
        return txtUri;
179
    }
180
    public Text getLblLabel() {
181
        return txtLabel;
182
    }
183
    public ListViewer getListSynonyms() {
184
        return listSynonyms;
185
    }
186
    public TermVocabularyComboViewer getTermVocabularyComboViewer() {
187
        return termVocabularyComboViewer;
188
    }
189
    public Button getBtnRemoveVocabulary() {
190
        return btnRemoveVocabulary;
191
    }
192
    public Label getLblResultCount() {
193
        return lblResultCount;
194
    }
195
    public Text getTextOntologies() {
196
        return textOntologies;
197
    }
198
    public Button getBtnChooseOntology() {
199
        return btnChooseOntology;
200
    }
201
}
(1-1/7)