Project

General

Profile

« Previous | Next » 

Revision 49aad4b2

Added by Patrick Plitzner over 6 years ago

ref #7086 Add term combo viewer to working set editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/WorkingSetComposite.java
9 9
package eu.etaxonomy.taxeditor.editor.workingSet;
10 10

  
11 11
import org.eclipse.jface.viewers.ComboViewer;
12
import org.eclipse.jface.viewers.LabelProvider;
13 12
import org.eclipse.jface.viewers.TreeViewer;
14 13
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.graphics.Image;
16 14
import org.eclipse.swt.layout.FillLayout;
17 15
import org.eclipse.swt.layout.GridData;
18 16
import org.eclipse.swt.layout.GridLayout;
......
22 20
import org.eclipse.swt.widgets.Text;
23 21
import org.eclipse.swt.widgets.Tree;
24 22

  
23
import eu.etaxonomy.cdm.model.common.TermType;
24
import eu.etaxonomy.taxeditor.ui.combo.TermUuidComboViewer;
25

  
25 26
/**
26 27
 * @author pplitzner
27 28
 * @since Nov 21, 2017
28 29
 *
29 30
 */
30 31
public class WorkingSetComposite extends Composite {
31
    private static class ViewerLabelProvider extends LabelProvider {
32
        @Override
33
        public Image getImage(Object element) {
34
            return super.getImage(element);
35
        }
36
        @Override
37
        public String getText(Object element) {
38
            return super.getText(element);
39
        }
40
    }
41 32
    private Text txt_label;
42 33

  
43
    /**
44
     * Create the composite.
45
     * @param parent
46
     * @param style
47
     */
48 34
    public WorkingSetComposite(Composite parent, int style) {
49 35
        super(parent, style);
50 36
        setLayout(new GridLayout(3, false));
......
62 48
        lblNewLabel_2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
63 49
        lblNewLabel_2.setText("Rank min");
64 50

  
65
        Combo combo = new Combo(this, SWT.NONE);
66
        combo.setItems(new String[] {"Genus", "Species", "Subspecies"});
51
        TermUuidComboViewer combo = new TermUuidComboViewer(this, SWT.NONE);
52
        combo.setInput(TermType.Rank);
53
        //        Combo combo = new Combo(this, SWT.NONE);
54
        //        combo.setItems(new String[] {"Genus", "Species", "Subspecies"});
67 55
        combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
68 56

  
69 57
        Composite composite = new Composite(this, SWT.NONE);
......
77 65
        lblNewLabel_3.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
78 66
        lblNewLabel_3.setText("Rank max");
79 67

  
80
        Combo combo_1 = new Combo(this, SWT.NONE);
81
        combo_1.setItems(new String[] {"Genus", "Species", "Subspecies"});
68
//        Combo combo_1 = new Combo(this, SWT.NONE);
69
        TermUuidComboViewer combo_1 = new TermUuidComboViewer(this, SWT.NONE);
70
//        combo_1.setItems(new String[] {"Genus", "Species", "Subspecies"});
82 71
        combo_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
83 72

  
84 73
        Label lblNewLabel_4 = new Label(this, SWT.NONE);

Also available in: Unified diff