Project

General

Profile

Download (1.59 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
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.termtree;
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
import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
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;
23

    
24
/**
25
 * @author pplitzner
26
 * @since Feb 14, 2019
27
 */
28
public class TermChooseWizardPage extends WizardPage {
29

    
30
    private TermSearchController controller;
31
    private TermDto term;
32

    
33
	protected TermChooseWizardPage(TermDto term) {
34
		super("Term Choose Wizard");
35
		setTitle("Choose Parent");
36
		setDescription("Please search and select the parent term or vocabulary (if you want to move the term as root).");
37
		this.term = term;
38
	}
39

    
40
	@Override
41
	public void createControl(Composite parent) {
42
        SearchComposite searchComposite = new SearchComposite(parent, SWT.NONE);
43
        controller = new TermSearchController(searchComposite, term, this);
44
		setControl(searchComposite);
45
	}
46

    
47
	public List<AbstractTermDto> getSelectedTerms() {
48
	    List<AbstractTermDto> termDtos = new ArrayList<>();
49
	    controller.getSelectedSearchResults().forEach(result->termDtos.add(result.getContent()));
50
	    return termDtos;
51
	}
52
}
(6-6/11)