Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.installer / org.gvsig.installer.swing / org.gvsig.installer.swing.impl / src / main / java / org / gvsig / installer / swing / impl / packagebuilder / options / SelectFolderToPackagingOption.java @ 42529

History | View | Annotate | Download (3.6 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.installer.swing.impl.packagebuilder.options;
25

    
26
import java.awt.BorderLayout;
27
import java.io.File;
28
import javax.swing.JFileChooser;
29
import javax.swing.JLabel;
30
import javax.swing.JPanel;
31

    
32
import org.gvsig.gui.beans.wizard.panel.NotContinueWizardException;
33
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
34
import org.gvsig.i18n.Messages;
35
import org.gvsig.installer.swing.impl.packagebuilder.BasePackageWizard;
36

    
37
/**
38
 *
39
 * @author usuario
40
 */
41
public class SelectFolderToPackagingOption extends JPanel  implements OptionPanel {
42

    
43
    private BasePackageWizard wizard = null;
44
    
45
    /**
46
     * Creates new form SelectFolderToPackagingOption
47
     * @param wizard
48
     * @param message
49
     */
50
    public SelectFolderToPackagingOption(BasePackageWizard wizard, String message) {
51
        this.wizard = wizard;
52
        initComponents();
53
        if( message == null ) {
54
            this.jLabel1.setText(Messages.getText(this.jLabel1.getText()));
55
        } else {
56
            this.jLabel1.setText(message);
57
        }
58
    }
59

    
60
    @Override
61
        public JPanel getJPanel() {
62
        return this;
63
    }
64

    
65
    @Override
66
    public void lastPanel() {
67

    
68
    }
69

    
70
    @Override
71
    public void nextPanel() throws NotContinueWizardException {
72
        File file = jFileChooser1.getSelectedFile();
73
        if( file!=null ) {
74
            wizard.setFolderToPackaging(file);
75
        }
76
    }
77

    
78
    @Override
79
    public void updatePanel() {
80

    
81
    }
82

    
83
    @Override
84
    public String getPanelTitle() {
85
        return Messages.getText("_select_folder");
86
    }
87

    
88
    public void setCurrentFolder(File folder) {
89
        this.jFileChooser1.setCurrentDirectory(folder);
90
    }
91
    
92
    /**
93
     * This method is called from within the constructor to
94
     * initialize the form.
95
     * WARNING: Do NOT modify this code. The content of this method is
96
     * always regenerated by the Form Editor.
97
     */
98
    @SuppressWarnings("unchecked")
99
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
100
    private void initComponents() {
101

    
102
        jLabel1 = new JLabel();
103
        jFileChooser1 = new JFileChooser();
104

    
105
        setLayout(new BorderLayout());
106

    
107
        jLabel1.setText("_Seleccione_la_carpeta_donde_estan_los _contenidos_a_empaquetar");
108
        add(jLabel1, BorderLayout.PAGE_START);
109

    
110
        jFileChooser1.setControlButtonsAreShown(false);
111
        jFileChooser1.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
112
        add(jFileChooser1, BorderLayout.CENTER);
113
    }// </editor-fold>//GEN-END:initComponents
114

    
115

    
116
    // Variables declaration - do not modify//GEN-BEGIN:variables
117
    protected JFileChooser jFileChooser1;
118
    protected JLabel jLabel1;
119
    // End of variables declaration//GEN-END:variables
120
}