Project

General

Profile

Download (7.95 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.ComboViewer;
12
import org.eclipse.jface.viewers.ListViewer;
13
import org.eclipse.jface.viewers.TreeViewer;
14
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.layout.GridData;
16
import org.eclipse.swt.layout.GridLayout;
17
import org.eclipse.swt.widgets.Button;
18
import org.eclipse.swt.widgets.Combo;
19
import org.eclipse.swt.widgets.Composite;
20
import org.eclipse.swt.widgets.Label;
21
import org.eclipse.swt.widgets.List;
22
import org.eclipse.swt.widgets.Text;
23
import org.eclipse.swt.widgets.Tree;
24
import org.eclipse.wb.swt.SWTResourceManager;
25

    
26
import eu.etaxonomy.cdm.api.service.IVocabularyService;
27
import eu.etaxonomy.cdm.model.common.TermVocabulary;
28
import eu.etaxonomy.taxeditor.model.ImageResources;
29
import eu.etaxonomy.taxeditor.store.CdmStore;
30
import eu.etaxonomy.taxeditor.ui.combo.termvocabulary.TermVocabularyComboViewer;
31

    
32
/**
33
 * @author pplitzner
34
 * @since Apr 23, 2018
35
 *
36
 */
37
public class GfBioTerminologyImportComposite extends Composite{
38
    private TreeViewer treeTermHierarchy;
39
    private Text txtSearch;
40
    private Button btnSearch;
41
    private Composite composite;
42
    private Button btnRemoveTerminology;
43
    private ComboViewer comboTerminologies;
44
    private Composite composite_1;
45
    private Composite composite_2;
46
    private Label lblNewLabel;
47
    private Label lblNewLabel_1;
48
    private Label lblNewLabel_2;
49
    private Text txtLabel;
50
    private Text txtUri;
51
    private Text txtDescription;
52
    private Label lblNewLabel_3;
53
    private Composite composite_3;
54
    private Label lblNewLabel_4;
55
    private Button btnRemoveVocabulary;
56
    private TermVocabularyComboViewer termVocabularyComboViewer;
57
    private List list;
58
    private ListViewer listSynonyms;
59
    private Composite composite_4;
60
    private Label lblNewLabel_5;
61
    private Composite composite_5;
62
    private Label lblResultCount;
63

    
64
    public GfBioTerminologyImportComposite(Composite parent, int style) {
65
        super(parent, style);
66
        setLayout(new GridLayout(1, false));
67

    
68
        composite = new Composite(this, SWT.NONE);
69
        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
70
        composite.setLayout(new GridLayout(4, false));
71

    
72
        txtSearch = new Text(composite, SWT.BORDER);
73
        txtSearch.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
74

    
75
        comboTerminologies = new ComboViewer(composite, SWT.NONE);
76
        Combo combo = comboTerminologies.getCombo();
77
        combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
78

    
79
        btnRemoveTerminology = new Button(composite, SWT.NONE);
80
        btnRemoveTerminology.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
81

    
82
        btnSearch = new Button(composite, SWT.NONE);
83
        btnSearch.setText("Search");
84

    
85
        composite_3 = new Composite(this, SWT.NONE);
86
        composite_3.setLayout(new GridLayout(3, false));
87
        composite_3.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false, 1, 1));
88

    
89
        lblNewLabel_4 = new Label(composite_3, SWT.NONE);
90
        lblNewLabel_4.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
91
        lblNewLabel_4.setText("Import Vocabulary");
92

    
93
        termVocabularyComboViewer = new TermVocabularyComboViewer(composite_3, SWT.NONE);
94
        termVocabularyComboViewer.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1));
95
        termVocabularyComboViewer.setInput(CdmStore.getService(IVocabularyService.class).list(TermVocabulary.class, null, null, null, null));
96

    
97
        btnRemoveVocabulary = new Button(composite_3, SWT.NONE);
98
        btnRemoveVocabulary.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
99
        btnRemoveVocabulary.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
100

    
101
        composite_2 = new Composite(this, SWT.NONE);
102
        composite_2.setLayout(new GridLayout(2, false));
103
        composite_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
104

    
105
        composite_4 = new Composite(composite_2, SWT.NONE);
106
        composite_4.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
107
        composite_4.setLayout(new GridLayout(1, false));
108

    
109
        treeTermHierarchy = new TreeViewer(composite_4, SWT.BORDER);
110
        Tree tree = treeTermHierarchy.getTree();
111
        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
112

    
113
        composite_5 = new Composite(composite_4, SWT.NONE);
114
        composite_5.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
115
        composite_5.setLayout(new GridLayout(2, false));
116

    
117
        lblNewLabel_5 = new Label(composite_5, SWT.NONE);
118
        lblNewLabel_5.setText("Results found:");
119

    
120
        lblResultCount = new Label(composite_5, SWT.NONE);
121
        lblResultCount.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
122

    
123
        composite_1 = new Composite(composite_2, SWT.NONE);
124
        composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
125
        composite_1.setLayout(new GridLayout(2, false));
126

    
127
        lblNewLabel = new Label(composite_1, SWT.NONE);
128
        lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
129
        lblNewLabel.setText("Label");
130

    
131
        txtLabel = new Text(composite_1, SWT.NONE);
132
        txtLabel.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
133
        txtLabel.setEditable(false);
134
        txtLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
135

    
136
        lblNewLabel_1 = new Label(composite_1, SWT.NONE);
137
        lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
138
        lblNewLabel_1.setText("URI");
139

    
140
        txtUri = new Text(composite_1, SWT.NONE);
141
        txtUri.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
142
        txtUri.setEditable(false);
143
        txtUri.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
144

    
145
        lblNewLabel_2 = new Label(composite_1, SWT.NONE);
146
        lblNewLabel_2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
147
        lblNewLabel_2.setText("Description");
148

    
149
        txtDescription = new Text(composite_1, SWT.WRAP);
150
        txtDescription.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
151
        txtDescription.setEditable(false);
152
        txtDescription.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
153

    
154
        lblNewLabel_3 = new Label(composite_1, SWT.NONE);
155
        lblNewLabel_3.setText("Synonyms");
156

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