d10192048cf915942b0a56bdf347032b9188312f
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / vocabulary / TermTranslationWizard.java
1 // $Id$
2 /**
3 * Copyright (C) 2016 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.taxeditor.ui.section.vocabulary;
11
12 import org.eclipse.jface.wizard.Wizard;
13
14 import eu.etaxonomy.cdm.model.common.Representation;
15 import eu.etaxonomy.cdm.model.common.TermBase;
16 import eu.etaxonomy.taxeditor.ui.translation.TermTranslationWizardPage;
17
18 /**
19 * @author k.luther
20 * @date 22.06.2016
21 *
22 */
23 public class TermTranslationWizard extends Wizard {
24 private TermTranslationWizardPage page;
25
26 private final TermBase term;
27
28 /**
29 * <p>Constructor for TranslationWizard.</p>
30 *
31 * @param multilanguageText a {@link java.util.Map} object.
32 */
33 public TermTranslationWizard(TermBase term) {
34 setWindowTitle("Translation Editor");
35 this.term = term;
36 setNeedsProgressMonitor(true);
37 }
38
39 /* (non-Javadoc)
40 * @see org.eclipse.jface.wizard.Wizard#addPages()
41 */
42 /** {@inheritDoc} */
43 @Override
44 public void addPages() {
45 page = new TermTranslationWizardPage(term);
46 addPage(page);
47 }
48
49 /* (non-Javadoc)
50 * @see org.eclipse.jface.wizard.Wizard#performFinish()
51 */
52 /** {@inheritDoc} */
53 @Override
54 public boolean performFinish() {
55 Representation representation = page.getTargetRepresentation();
56
57 if (!representation.getText().equals("") || !representation.getLabel().equals("") || !representation.getAbbreviatedLabel().equals("")) {
58 term.addRepresentation(representation);
59 }
60
61 return true;
62 }
63 }