1 |
08267c16
|
Patrick Plitzner
|
/**
|
2 |
|
|
* Copyright (C) 2007 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 |
|
|
|
10 |
|
|
package eu.etaxonomy.taxeditor.featuretree;
|
11 |
|
|
|
12 |
|
|
import java.util.ArrayList;
|
13 |
|
|
import java.util.List;
|
14 |
|
|
|
15 |
|
|
import org.eclipse.jface.wizard.WizardPage;
|
16 |
|
|
import org.eclipse.swt.SWT;
|
17 |
|
|
import org.eclipse.swt.widgets.Composite;
|
18 |
|
|
|
19 |
b9dc6bb1
|
Andreas Müller
|
import eu.etaxonomy.cdm.model.term.TermType;
|
20 |
08267c16
|
Patrick Plitzner
|
import eu.etaxonomy.cdm.persistence.dto.TermDto;
|
21 |
|
|
import eu.etaxonomy.taxeditor.view.search.facet.SearchComposite;
|
22 |
|
|
import eu.etaxonomy.taxeditor.view.search.facet.term.TermSearchController;
|
23 |
|
|
|
24 |
|
|
/**
|
25 |
|
|
*
|
26 |
|
|
* @author pplitzner
|
27 |
|
|
* @since Feb 14, 2019
|
28 |
|
|
*
|
29 |
|
|
*/
|
30 |
|
|
public class TermChooseWizardPage extends WizardPage {
|
31 |
|
|
|
32 |
|
|
private TermSearchController controller;
|
33 |
de69ffd8
|
Patrick Plitzner
|
private TermType termType;
|
34 |
08267c16
|
Patrick Plitzner
|
|
35 |
de69ffd8
|
Patrick Plitzner
|
protected TermChooseWizardPage(TermType termType) {
|
36 |
08267c16
|
Patrick Plitzner
|
super("Term Choose Wizard");
|
37 |
|
|
setTitle("Term Choose Wizard");
|
38 |
|
|
setDescription("Please search and select the terms you want to add to the tree.");
|
39 |
de69ffd8
|
Patrick Plitzner
|
this.termType = termType;
|
40 |
08267c16
|
Patrick Plitzner
|
}
|
41 |
|
|
|
42 |
|
|
@Override
|
43 |
|
|
public void createControl(Composite parent) {
|
44 |
|
|
SearchComposite searchComposite = new SearchComposite(parent, SWT.NONE);
|
45 |
de69ffd8
|
Patrick Plitzner
|
controller = new TermSearchController(searchComposite, termType);
|
46 |
08267c16
|
Patrick Plitzner
|
setControl(searchComposite);
|
47 |
|
|
}
|
48 |
|
|
|
49 |
|
|
public List<TermDto> getSelectedTerms() {
|
50 |
|
|
List<TermDto> termDtos = new ArrayList<>();
|
51 |
|
|
controller.getSelectedSearchResults().forEach(result->termDtos.add(result.getContent()));
|
52 |
|
|
return termDtos;
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
}
|