svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.exportto / org.gvsig.exportto.swing / org.gvsig.exportto.swing.impl / src / main / java / org / gvsig / exportto / swing / impl / wizard / DefaultWizardContainer.java @ 41486
History | View | Annotate | Download (2.79 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.exportto.swing.impl.wizard; |
25 |
|
26 |
import javax.swing.JPanel; |
27 |
|
28 |
import org.slf4j.Logger; |
29 |
import org.slf4j.LoggerFactory; |
30 |
|
31 |
import org.gvsig.exportto.swing.spi.ExporttoPanelValidationException; |
32 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderPanel; |
33 |
import org.gvsig.gui.beans.wizard.panel.NotContinueWizardException; |
34 |
import org.gvsig.gui.beans.wizard.panel.OptionPanel; |
35 |
import org.gvsig.i18n.Messages; |
36 |
|
37 |
/**
|
38 |
* @author gvSIG Team
|
39 |
* @version $Id$
|
40 |
*
|
41 |
*/
|
42 |
public class DefaultWizardContainer implements OptionPanel { |
43 |
|
44 |
private static final Logger LOG = LoggerFactory |
45 |
.getLogger(DefaultWizardContainer.class); |
46 |
|
47 |
private ExporttoSwingProviderPanel exporttoSwingProviderPanel = null; |
48 |
|
49 |
public DefaultWizardContainer(
|
50 |
ExporttoSwingProviderPanel exporttoSwingProviderPanel) { |
51 |
super();
|
52 |
this.exporttoSwingProviderPanel = exporttoSwingProviderPanel;
|
53 |
} |
54 |
|
55 |
public String getPanelTitle() { |
56 |
return exporttoSwingProviderPanel.getPanelTitle();
|
57 |
} |
58 |
|
59 |
public void nextPanel() throws NotContinueWizardException { |
60 |
try {
|
61 |
if (!this.exporttoSwingProviderPanel.isValidPanel()) { |
62 |
throw new NotContinueWizardException( |
63 |
Messages.getText("_Invalid_values_in_form"),
|
64 |
exporttoSwingProviderPanel.asJComponent(), |
65 |
false);
|
66 |
} |
67 |
} catch (ExporttoPanelValidationException e) {
|
68 |
LOG.info("Invalid form values.");
|
69 |
throw new NotContinueWizardException( |
70 |
Messages.getText("_Invalid_values_in_form"),
|
71 |
e, exporttoSwingProviderPanel.asJComponent()); |
72 |
} |
73 |
} |
74 |
|
75 |
public void lastPanel() { |
76 |
// TODO Auto-generated method stub
|
77 |
|
78 |
} |
79 |
|
80 |
public void updatePanel() { |
81 |
|
82 |
} |
83 |
|
84 |
public JPanel getJPanel() { |
85 |
return (JPanel) exporttoSwingProviderPanel.asJComponent(); |
86 |
} |
87 |
|
88 |
} |