Merge branch 'release/4.6.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / databaseAdmin / wizard / DatabaseRepairTitleCacheUpdatePage.java
1 /**
2 * Copyright (C) 2016 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 package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
10
11 import java.util.List;
12
13 import org.eclipse.jface.wizard.WizardPage;
14 import org.eclipse.swt.SWT;
15 import org.eclipse.swt.events.SelectionAdapter;
16 import org.eclipse.swt.events.SelectionEvent;
17 import org.eclipse.swt.layout.GridLayout;
18 import org.eclipse.swt.widgets.Button;
19 import org.eclipse.swt.widgets.Composite;
20
21 import eu.etaxonomy.cdm.io.common.CacheUpdaterConfigurator;
22 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
23 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
24 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
25 import eu.etaxonomy.taxeditor.l10n.Messages;
26
27 /**
28 * @author k.luther
29 * @date 13.12.2016
30 *
31 */
32 public class DatabaseRepairTitleCacheUpdatePage extends WizardPage {
33
34 CacheUpdaterConfigurator config;
35
36 /**
37 * @param pageName
38 * @param configTitleCache
39 */
40 protected DatabaseRepairTitleCacheUpdatePage(String pageName, CacheUpdaterConfigurator configTitleCache) {
41 super(pageName);
42 config = configTitleCache;
43
44 }
45
46 /**
47 * {@inheritDoc}
48 */
49 @Override
50 public void createControl(Composite parent) {
51 final Composite composite = new Composite(parent, SWT.NULL);
52
53 GridLayout gridLayout = new GridLayout();
54 composite.setLayout(gridLayout);
55
56 setControl(composite);
57
58 Button checkBoxZoologicalName = new Button(composite, SWT.CHECK);
59 checkBoxZoologicalName.setSelection(config.getClassList().contains(TaxonBase.class));
60 checkBoxZoologicalName.setText(Messages.DatabaseRepairPage_TaxonBase);
61 checkBoxZoologicalName
62 .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonBase);
63 checkBoxZoologicalName.addSelectionListener(new SelectionAdapter() {
64 @Override
65 public void widgetSelected(SelectionEvent e) {
66 List<Class<? extends IdentifiableEntity>> classList = config.getClassList();
67 classList.add(TaxonBase.class);
68 }
69 });
70
71
72
73
74
75
76
77
78
79 Button checkBoxTaxonName = new Button(composite, SWT.CHECK);
80 checkBoxTaxonName.setSelection(config.getClassList().contains(TaxonNameBase.class));
81 checkBoxTaxonName.setText(Messages.DatabaseRepairPage_updateTaxonName);
82 checkBoxTaxonName
83 .setToolTipText(Messages.DatabaseRepairPage_toolTip_TaxonName);
84 checkBoxTaxonName.addSelectionListener(new SelectionAdapter() {
85 @Override
86 public void widgetSelected(SelectionEvent e) {
87 List<Class<? extends IdentifiableEntity>> classList = config.getClassList();
88 classList.add(TaxonNameBase.class);
89 }
90 });
91
92
93 }
94
95 }