2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.featuretree
;
12 import java
.util
.ArrayList
;
13 import java
.util
.List
;
15 import org
.eclipse
.jface
.wizard
.WizardPage
;
16 import org
.eclipse
.swt
.SWT
;
17 import org
.eclipse
.swt
.widgets
.Composite
;
19 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
20 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
;
30 public class TermChooseWizardPage
extends WizardPage
{
32 private TermSearchController controller
;
33 private TermType termType
;
35 protected TermChooseWizardPage(TermType termType
) {
36 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 this.termType
= termType
;
43 public void createControl(Composite parent
) {
44 SearchComposite searchComposite
= new SearchComposite(parent
, SWT
.NONE
);
45 controller
= new TermSearchController(searchComposite
, termType
);
46 setControl(searchComposite
);
49 public List
<TermDto
> getSelectedTerms() {
50 List
<TermDto
> termDtos
= new ArrayList
<>();
51 controller
.getSelectedSearchResults().forEach(result
->termDtos
.add(result
.getContent()));