Project

General

Profile

Download (7.48 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.custom.ScrolledComposite;
16
import org.eclipse.swt.layout.GridData;
17
import org.eclipse.swt.layout.GridLayout;
18
import org.eclipse.swt.widgets.Button;
19
import org.eclipse.swt.widgets.Combo;
20
import org.eclipse.swt.widgets.Composite;
21
import org.eclipse.swt.widgets.Label;
22
import org.eclipse.swt.widgets.List;
23
import org.eclipse.swt.widgets.Text;
24
import org.eclipse.swt.widgets.Tree;
25
import org.eclipse.wb.swt.SWTResourceManager;
26

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

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

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

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

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

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

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

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

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

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

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

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

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

    
103
        treeTermHierarchy = new TreeViewer(composite_2, SWT.BORDER);
104
        Tree tree = treeTermHierarchy.getTree();
105
        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
106

    
107
        composite_1 = new Composite(composite_2, SWT.NONE);
108
        composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
109
        composite_1.setLayout(new GridLayout(2, false));
110
        new Label(composite_1, SWT.NONE);
111

    
112
        btnLoadDetails = new Button(composite_1, SWT.NONE);
113
        btnLoadDetails.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
114
        btnLoadDetails.setText("Load Details");
115

    
116
        lblNewLabel = new Label(composite_1, SWT.NONE);
117
        lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
118
        lblNewLabel.setText("Label");
119

    
120
        txtLabel = new Text(composite_1, SWT.NONE);
121
        txtLabel.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
122
        txtLabel.setEditable(false);
123
        txtLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
124

    
125
        lblNewLabel_1 = new Label(composite_1, SWT.NONE);
126
        lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
127
        lblNewLabel_1.setText("URI");
128

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

    
134
        lblNewLabel_2 = new Label(composite_1, SWT.NONE);
135
        lblNewLabel_2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
136
        lblNewLabel_2.setText("Description");
137

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

    
143
        lblNewLabel_3 = new Label(composite_1, SWT.NONE);
144
        lblNewLabel_3.setText("Synonyms");
145

    
146
        listSynonyms = new ListViewer(composite_1, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
147
        list = listSynonyms.getList();
148
        list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
149
        list.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
150
    }
151
    public TreeViewer getTreeTermHierarchy() {
152
        return treeTermHierarchy;
153
    }
154
    public Button getBtnSearch() {
155
        return btnSearch;
156
    }
157
    public Text getTxtSearch() {
158
        return txtSearch;
159
    }
160
    public Button getBtnRemoveTerminology() {
161
        return btnRemoveTerminology;
162
    }
163
    public ComboViewer getComboTerminologies() {
164
        return comboTerminologies;
165
    }
166
    public Text getLblDescription() {
167
        return txtDescription;
168
    }
169
    public Text getLblUri() {
170
        return txtUri;
171
    }
172
    public Text getLblLabel() {
173
        return txtLabel;
174
    }
175
    public Button getBtnLoadDetails() {
176
        return btnLoadDetails;
177
    }
178
    public ListViewer getListSynonyms() {
179
        return listSynonyms;
180
    }
181
    public TermVocabularyComboViewer getTermVocabularyComboViewer() {
182
        return termVocabularyComboViewer;
183
    }
184
    public Button getBtnRemoveVocabulary() {
185
        return btnRemoveVocabulary;
186
    }
187
}
(1-1/6)