Revision 43920 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.dbf/src/main/java/org/gvsig/exportto/swing/prov/dbf/ExporttoDBFProvider.java

View differences:

ExporttoDBFProvider.java
23 23
 */
24 24
package org.gvsig.exportto.swing.prov.dbf;
25 25

  
26
import java.util.logging.Level;
27
import java.util.logging.Logger;
28 26
import org.gvsig.exportto.ExporttoService;
29 27
import org.gvsig.exportto.ExporttoServiceException;
30
import org.gvsig.exportto.swing.prov.dbf.panel.ExporttoDBFPanel;
28
import org.gvsig.exportto.swing.prov.dbf.panel.EncodingPanel;
31 29
import org.gvsig.exportto.swing.prov.file.AbstractExporttoFileProvider;
32 30
import org.gvsig.exportto.swing.spi.ExporttoSwingProvider;
33 31
import org.gvsig.fmap.dal.feature.FeatureStore;
34 32
import org.gvsig.tools.service.spi.ProviderServices;
35 33

  
36
/* gvSIG. Geographic Information System of the Valencian Government
37
 *
38
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
39
 * of the Valencian Government (CIT)
40
 *
41
 * This program is free software; you can redistribute it and/or
42
 * modify it under the terms of the GNU General Public License
43
 * as published by the Free Software Foundation; either version 2
44
 * of the License, or (at your option) any later version.
45
 *
46
 * This program is distributed in the hope that it will be useful,
47
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
48
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
49
 * GNU General Public License for more details.
50
 *
51
 * You should have received a copy of the GNU General Public License
52
 * along with this program; if not, write to the Free Software
53
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
54
 * MA  02110-1301, USA.
55
 *
56
 */
57

  
58 34
/**
59 35
 * Exporto provider which gets Exporto from a file.
60 36
 * 
......
62 38
 * @version $Id$
63 39
 * 
64 40
 */
65
public class ExporttoDBFProvider extends AbstractExporttoFileProvider implements
66
    ExporttoSwingProvider {
41
public class ExporttoDBFProvider 
42
        extends AbstractExporttoFileProvider 
43
        implements ExporttoSwingProvider
44
    {
67 45

  
68
    private String encoding;
46
    @SuppressWarnings("OverridableMethodCallInConstructor")
47
    public ExporttoDBFProvider(
48
            ProviderServices providerServices,
49
            FeatureStore featureStore
50
        ) {
51
        super(providerServices, featureStore);
52
    }
69 53

  
70
    public ExporttoDBFProvider(ProviderServices providerServices,
71
        FeatureStore featureStore) {
72
        super(providerServices, featureStore, null, new ExporttoDBFPanel());
54
    @Override
55
    public ExportDBFOptions getOptions() {
56
        if( this.options == null ) {
57
            this.options = new BaseExportDBFOptions();
58
        }
59
        return (ExportDBFOptions) this.options;
73 60
    }
74 61

  
75 62
    @Override
63
    protected void addPanels() {
64
        this.panelAdd(new EncodingPanel(this.getOptions()));
65
    }
66
    
67
    @Override
76 68
    public ExporttoService createExporttoService() {
77 69
        try {
78
            return new ExporttoDBFService(selectFileOptionPanel.getSelectedFile(),
79
                featureStore,
80
                ((ExporttoDBFPanel) selectFileOptionPanel).getEncoding());
70
            return new ExporttoDBFService(
71
                this.getOptions().getFile(),
72
                this.getOptions().getSourceFeatureStore(),
73
                this.getOptions().getEncoding()
74
            );
81 75
        } catch (ExporttoServiceException ex) {
82 76
            throw new RuntimeException(ex);
83 77
        }
84 78
    }
85 79
    
86
    @Override
87
    public boolean needsPanelTargetProjection(){
88
        return false;
89
    }
90 80
}

Also available in: Unified diff