Project

General

Profile

Revision 159bb3e7

ID159bb3e754631c608cca350a9e43adb2295fb21d
Parent f5ae4e08
Child e2137c8f

Added by Katja Luther about 3 years ago

ref #6619: add the possibility to ignore methods of the configurator in the configuration wizard of imports and exports

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbstractExportWizard.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
22 22
 * @version 1.0
23 23
 */
24 24
public abstract class AbstractExportWizard<CONFIG extends IIoConfigurator> extends Wizard implements IExportWizard{
25
	
26
	protected final String CONFIGURATION_PAGE = "CONFIGURATION_PAGE"; 
27
	
25

  
26
	protected final String CONFIGURATION_PAGE = "CONFIGURATION_PAGE";
27

  
28 28
	private GenericConfiguratorWizardPage pageConfiguration;
29
	
29

  
30 30
	/* (non-Javadoc)
31 31
	 * @see org.eclipse.jface.wizard.Wizard#addPages()
32 32
	 */
......
34 34
	@Override
35 35
	public void addPages() {
36 36
		super.addPages();
37
		
38
		pageConfiguration = GenericConfiguratorWizardPage.Export(CONFIGURATION_PAGE, getConfigurator());
37

  
38
		pageConfiguration = GenericConfiguratorWizardPage.Export(CONFIGURATION_PAGE, getConfigurator(), null);
39 39
		this.addPage(pageConfiguration);
40 40
	}
41
	
41

  
42 42
	/**
43 43
	 * <p>getConfigurator</p>
44 44
	 *
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbstractImportWizard.java
32 32

  
33 33
	protected final String CONFIGURATION_PAGE = "CONFIGURATION_PAGE";
34 34

  
35
	private GenericConfiguratorWizardPage pageConfiguration;
35
	protected GenericConfiguratorWizardPage pageConfiguration;
36 36
	private NomenclaturalCodeWizardPage pageNomenclaturalCode;
37 37

  
38 38
	private IWorkbench workbench;
......
43 43
	@Override
44 44
	public void addPages() {
45 45
		super.addPages();
46
		
46

  
47 47
		addConfiguratorPage();
48 48

  
49 49
		pageNomenclaturalCode = new NomenclaturalCodeWizardPage((IImportConfigurator)getConfigurator());
50 50
		this.addPage(pageNomenclaturalCode);
51 51
	}
52
	
52

  
53 53
	protected void addConfiguratorPage(){
54
		pageConfiguration = GenericConfiguratorWizardPage.Import(CONFIGURATION_PAGE, getConfigurator());
54
		pageConfiguration = GenericConfiguratorWizardPage.Import(CONFIGURATION_PAGE, getConfigurator(), null);
55 55
		this.addPage(pageConfiguration);
56 56
	}
57 57

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelDistributionUpdateWizard.java
13 13
import java.io.FileNotFoundException;
14 14
import java.io.IOException;
15 15
import java.net.URI;
16
import java.util.ArrayList;
17
import java.util.List;
16 18
import java.util.UUID;
17 19

  
18 20
import org.apache.commons.io.IOUtils;
......
95 97
    /** {@inheritDoc} */
96 98
    @Override
97 99
    public void addPages() {
98
        super.addPages();
100
        addConfiguratorPage();
101
        addDataSourcePage();
99 102

  
100
        dataSourcePage = new ImportFromFileAndChooseVocIdWizardOage("Choose NormalExplicit",
101
                "Please choose an xls file in the NormalExplicit format.", new String[]{"*.xlsx", "*.xls", "*.*"});
103

  
104
    }
105
    @Override
106
    protected void addConfiguratorPage(){
107
        List<String> ignoreMethods = new ArrayList<>();
108
        ignoreMethods.add("setIgnoreNull");
109
        ignoreMethods.add("setInteractWithUser");
110
        ignoreMethods.add("setUseClassification");
111
        pageConfiguration = GenericConfiguratorWizardPage.Import(CONFIGURATION_PAGE, getConfigurator(), ignoreMethods);
112
        addPage(pageConfiguration);
113
    }
114

  
115
    private void addDataSourcePage(){
116
        dataSourcePage = new ImportFromFileAndChooseVocIdWizardOage("Choose Excel File",
117
                "Please choose an xls file in the Distribution Update format.", new String[]{"*.xlsx", "*.xls", "*.*"});
102 118
        addPage(dataSourcePage);
103 119
    }
120

  
121

  
104 122
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
44 44

  
45 45
    private final IIoConfigurator configurator;
46 46
    private final ResourceBundle resourceBundle;
47
    private final List<String> ignoreMethods;
47 48

  
48 49
    /**
49 50
     * @param pageName
50 51
     * @param configurator
51 52
     */
52 53
    private GenericConfiguratorWizardPage(String pageName,
53
            IIoConfigurator configurator, String title, String description) {
54
            IIoConfigurator configurator, String title, String description, List<String> ignoreMethods) {
54 55
        super(pageName);
55 56
        this.setTitle(title);
56 57

  
57 58
        this.setDescription(description);
58 59

  
59 60
        this.configurator = configurator;
61
        this.ignoreMethods = ignoreMethods;
60 62

  
61 63

  
62 64
        resourceBundle = getResourceBundle(configurator);
......
84 86
     *         object.
85 87
     */
86 88
    public static GenericConfiguratorWizardPage Import(String pageName,
87
            IIoConfigurator configurator) {
89
            IIoConfigurator configurator, List<String> ignoreMethods) {
88 90
        return new GenericConfiguratorWizardPage(pageName, configurator,
89
                "Import Configuration", "Configure the import mechanism.");
91
                "Import Configuration", "Configure the import mechanism.", ignoreMethods);
90 92
    }
91 93

  
92 94
    /**
......
103 105
     *         object.
104 106
     */
105 107
    public static GenericConfiguratorWizardPage Export(String pageName,
106
            IIoConfigurator configurator) {
108
            IIoConfigurator configurator, List<String> ignoreMethods) {
107 109
        return new GenericConfiguratorWizardPage(pageName, configurator,
108
                "Export Configuration", "Configure the export mechanism.");
110
                "Export Configuration", "Configure the export mechanism.", ignoreMethods);
109 111
    }
110 112

  
111 113
    /*
......
158 160
        });
159 161

  
160 162
        for (Method method : methods) {
161
            createCheckbox(composite, method, configurator);
163
            if (!ignoreMethods.contains( method.getName())) {
164
                createCheckbox(composite, method, configurator);
165
            }
162 166
        }
163 167

  
164 168
        // scrolledComposite.setContent(composite);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)