Revision 739cbae5
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/WorkingSetComposite.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.taxeditor.editor.workingSet; |
10 | 10 |
|
11 |
import java.util.List; |
|
12 |
|
|
13 |
import org.eclipse.jface.viewers.ITreeSelection; |
|
14 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
15 | 11 |
import org.eclipse.jface.viewers.TreeViewer; |
16 | 12 |
import org.eclipse.swt.SWT; |
17 | 13 |
import org.eclipse.swt.layout.GridData; |
... | ... | |
21 | 17 |
import org.eclipse.swt.widgets.Text; |
22 | 18 |
import org.eclipse.swt.widgets.Tree; |
23 | 19 |
|
24 |
import eu.etaxonomy.cdm.api.service.IClassificationService; |
|
25 | 20 |
import eu.etaxonomy.cdm.model.common.TermType; |
26 | 21 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
27 | 22 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
28 | 23 |
import eu.etaxonomy.cdm.model.name.Rank; |
29 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
30 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
|
31 | 24 |
import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditorComposite; |
32 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
33 | 25 |
import eu.etaxonomy.taxeditor.ui.combo.TermUuidComboViewer; |
34 | 26 |
import eu.etaxonomy.taxeditor.util.TaxonTreeNodeContentProvider; |
35 | 27 |
import eu.etaxonomy.taxeditor.util.TaxonTreeNodeLabelProvider; |
... | ... | |
51 | 43 |
public WorkingSetComposite(Composite parent, int style) { |
52 | 44 |
super(parent, style); |
53 | 45 |
|
54 |
List<Classification> list = CdmStore.getService(IClassificationService.class).list(Classification.class, null, null, null, null); |
|
55 |
|
|
56 | 46 |
setLayout(new GridLayout(3, false)); |
57 | 47 |
|
58 | 48 |
Label lblNewLabel = new Label(this, SWT.NONE); |
... | ... | |
78 | 68 |
|
79 | 69 |
taxonNodeTree.setContentProvider(new TaxonTreeNodeContentProvider()); |
80 | 70 |
taxonNodeTree.setLabelProvider(new TaxonTreeNodeLabelProvider()); |
81 |
taxonNodeTree.setInput(list); |
|
82 | 71 |
|
83 | 72 |
Label lblNewLabel_3 = new Label(this, SWT.NONE); |
84 | 73 |
lblNewLabel_3.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); |
... | ... | |
134 | 123 |
featureTreeEditorComposite.setSelectedTree(characters, null); |
135 | 124 |
} |
136 | 125 |
|
137 |
public TaxonNode getTaxonNode(){ |
|
138 |
ITreeSelection selection = (ITreeSelection) taxonNodeTree.getSelection(); |
|
139 |
if(selection!=null && selection.getFirstElement() instanceof TaxonNode){ |
|
140 |
return (TaxonNode) selection.getFirstElement(); |
|
141 |
} |
|
142 |
return null; |
|
143 |
} |
|
144 |
public void setTaxonNode(TaxonNode taxonNode){ |
|
145 |
taxonNodeTree.setSelection(new StructuredSelection(taxonNode), true); |
|
126 |
public TreeViewer getTaxonNodeTree() { |
|
127 |
return taxonNodeTree; |
|
146 | 128 |
} |
147 | 129 |
|
148 | 130 |
public NamedArea getArea(){ |
Also available in: Unified diff
ref #7086 Allow drag and drop for taxon filter from taxon navigator