Project

General

Profile

Download (2.6 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2017 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.editor.workingSet;
11

    
12
import java.util.UUID;
13

    
14
import javax.annotation.PostConstruct;
15
import javax.annotation.PreDestroy;
16

    
17
import org.eclipse.e4.ui.di.Focus;
18
import org.eclipse.jface.viewers.TreeViewer;
19
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.layout.FillLayout;
21
import org.eclipse.swt.widgets.Composite;
22

    
23
import eu.etaxonomy.cdm.api.service.IVocabularyService;
24
import eu.etaxonomy.cdm.model.common.TermVocabulary;
25
import eu.etaxonomy.taxeditor.store.CdmStore;
26

    
27
/**
28
 * @author pplitzner
29
 * @date 24.05.2017
30
 *
31
 */
32
public class FeatureTreeBuilderViewPart {
33

    
34
    private TreeViewer treeViewerCharacters;
35
    private TreeViewer treeViewerProperties;
36
    private TreeViewer treeViewerStructures;
37

    
38
    public FeatureTreeBuilderViewPart() {
39
    }
40

    
41
    /**
42
     * Create contents of the view part.
43
     */
44
    @PostConstruct
45
    public void createControls(Composite parent) {
46
        parent.setLayout(new FillLayout(SWT.HORIZONTAL));
47

    
48
        treeViewerStructures = new TreeViewer(parent, SWT.BORDER);
49
        treeViewerStructures.setColumnProperties(new String[] {});
50

    
51
        treeViewerProperties = new TreeViewer(parent, SWT.BORDER);
52

    
53
        treeViewerCharacters = new TreeViewer(parent, SWT.BORDER);
54

    
55
        init();
56
    }
57

    
58
    private void init(){
59
        TermVocabulary structureVoc = CdmStore.getService(IVocabularyService.class).load(UUID.fromString("51f3a28e-6c1a-40bf-b504-012a12d69112"));
60
        treeViewerStructures.setContentProvider(new StructureContentProvider());
61
        treeViewerStructures.setLabelProvider(new StructureLabelProvider());
62
        treeViewerStructures.setInput(structureVoc);
63

    
64
        TermVocabulary propertiesVoc = CdmStore.getService(IVocabularyService.class).load(UUID.fromString("c5ff574b-40a5-4046-b2a0-59bfbe6b6616"));
65
        treeViewerProperties.setContentProvider(new StructureContentProvider());
66
        treeViewerProperties.setLabelProvider(new StructureLabelProvider());
67
        treeViewerProperties.setInput(propertiesVoc);
68
    }
69

    
70
    @PreDestroy
71
    public void dispose() {
72
    }
73

    
74
    @Focus
75
    public void setFocus() {
76
    }
77

    
78
    public TreeViewer getTreeViewerCharacters() {
79
        return treeViewerCharacters;
80
    }
81
    public TreeViewer getTreeViewerProperties() {
82
        return treeViewerProperties;
83
    }
84
    public TreeViewer getTreeViewerStructures() {
85
        return treeViewerStructures;
86
    }
87

    
88
}
(1-1/3)