Statistics
| Revision:

root / trunk / org.gvsig.postgresql / org.gvsig.postgresql.app / org.gvsig.postgresql.app.export / src / main / java / org / gvsig / postgresql / exportto / panel / SelectTableNamePanel.java @ 61

History | View | Annotate | Download (2.37 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.postgresql.exportto.panel;
25

    
26
import java.awt.BorderLayout;
27
import javax.swing.JTextField;
28
import org.gvsig.exportto.swing.ExporttoSwingLocator;
29
import org.gvsig.exportto.swing.ExporttoSwingManager;
30
import org.gvsig.exportto.swing.spi.ExporttoPanelValidationException;
31
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderPanel;
32

    
33
/**
34
 * @author gvSIG Team
35
 * @version $Id$
36
 * 
37
 */
38
public class SelectTableNamePanel extends ExporttoSwingProviderPanel {
39

    
40
    private static final long serialVersionUID = 6269512983586358017L;
41

    
42
    private static final ExporttoSwingManager EXPORTTO_SWING_MANAGER =
43
        ExporttoSwingLocator.getSwingManager();
44

    
45
    protected JTextField textField = null;
46

    
47
    protected void initializeComponents() {
48
        this.setLayout(new BorderLayout());
49
        textField = new JTextField();
50
        add(textField, BorderLayout.NORTH);
51
    }
52

    
53
    public String getText() {
54
        String field = textField.getText();
55
        if ((field == null) || (field.equals(""))) {
56
            return null;
57
        }
58
        return field;
59
    }
60
    
61
    public String getPanelTitle() {
62
        return EXPORTTO_SWING_MANAGER.getTranslation("intro_tablename");
63
    }
64

    
65
    public boolean isValidPanel() throws ExporttoPanelValidationException {
66
        if (getText() == null || getText().equals("")) {
67
            throw new ExporttoPanelValidationException(
68
                "The table cannot be empty");
69
        }
70
        return true;
71
    }
72
}