ref 9337: rename all termtree related classes
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / io / e4 / out / owl / OwlTermExportComposite.java
1 /**
2 * Copyright (C) 2019 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.io.e4.out.owl;
10
11 import org.eclipse.swt.SWT;
12 import org.eclipse.swt.layout.GridData;
13 import org.eclipse.swt.layout.GridLayout;
14 import org.eclipse.swt.widgets.Button;
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Text;
17
18 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermSorter;
19 import eu.etaxonomy.taxeditor.editor.definedterm.FeatureTreeViewerComparator;
20 import eu.etaxonomy.taxeditor.editor.definedterm.RootElementsOnlyTreeContentProvider;
21 import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoLabelProvider;
22 import eu.etaxonomy.taxeditor.featuretree.TermTreeLabelProvider;
23 import eu.etaxonomy.taxeditor.model.ImageResources;
24 import eu.etaxonomy.taxeditor.preference.wizard.CheckBoxTreeComposite;
25
26 /**
27 * @author pplitzner
28 * @since May 23, 2019
29 *
30 */
31 public class OwlTermExportComposite extends Composite {
32
33 private CheckBoxTreeComposite selectVocabularyComposite;
34 private CheckBoxTreeComposite selectFeatureTreeComposite;
35 private Text txtExportDirectory;
36 private Button btnSelectDirectory;
37
38 public OwlTermExportComposite(Composite parent, int style) {
39 super(parent, style);
40 setLayout(new GridLayout(2, false));
41
42 GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
43 layoutData.heightHint = 200;
44 selectVocabularyComposite = new CheckBoxTreeComposite(this, new RootElementsOnlyTreeContentProvider(), new TermDtoLabelProvider(), SWT.NONE);
45 selectVocabularyComposite.setAllowTopLevelSelection(true);
46 selectVocabularyComposite.getViewer().setComparator(new DefinedTermSorter());
47 selectVocabularyComposite.setLayoutData(layoutData);
48
49 selectFeatureTreeComposite = new CheckBoxTreeComposite(this, new RootElementsOnlyTreeContentProvider(), new TermTreeLabelProvider(), SWT.NONE);
50 selectFeatureTreeComposite.setAllowTopLevelSelection(true);
51 selectFeatureTreeComposite.getViewer().setComparator(new FeatureTreeViewerComparator());
52 selectFeatureTreeComposite.setLayoutData(layoutData);
53
54 txtExportDirectory = new Text(this, style);
55 txtExportDirectory.setEditable(false);
56 txtExportDirectory.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
57
58 btnSelectDirectory = new Button(this, style);
59 btnSelectDirectory.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
60 btnSelectDirectory.setToolTipText("Choose export directory");
61 btnSelectDirectory.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
62
63 }
64
65 Text getTxtExportDirectory() {
66 return txtExportDirectory;
67 }
68
69 Button getBtnSelectDirectory() {
70 return btnSelectDirectory;
71 }
72
73 CheckBoxTreeComposite getSelectFeatureTreeComposite() {
74 return selectFeatureTreeComposite;
75 }
76
77 CheckBoxTreeComposite getSelectVocabularyComposite() {
78 return selectVocabularyComposite;
79 }
80
81 String getExportDirectory(){
82 return txtExportDirectory.getText();
83 }
84
85 }