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 / execution / wizard / TypicalOrAdvancedWizardPage.java @ 43195
History | View | Annotate | Download (2.95 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 modify it under
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
9 |
* version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
14 |
* details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License along with
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.installer.swing.impl.execution.wizard; |
24 |
|
25 |
import java.io.File; |
26 |
import java.io.IOException; |
27 |
import java.util.logging.Level; |
28 |
import java.util.logging.Logger; |
29 |
import java.util.zip.ZipFile; |
30 |
|
31 |
import javax.swing.JPanel; |
32 |
import org.gvsig.gui.beans.wizard.panel.NotContinueWizardException; |
33 |
import org.gvsig.gui.beans.wizard.panel.OptionPanel; |
34 |
import org.gvsig.installer.swing.impl.execution.InstallWizardPanel_ext; |
35 |
import org.gvsig.installer.swing.impl.execution.panel.TypicalOrAdvancedPanel; |
36 |
|
37 |
/**
|
38 |
* @author gvSIG Team
|
39 |
* @version $Id$
|
40 |
*
|
41 |
*/
|
42 |
public class TypicalOrAdvancedWizardPage extends TypicalOrAdvancedPanel implements |
43 |
OptionPanel { |
44 |
|
45 |
private static final long serialVersionUID = -7151675399781722322L; |
46 |
|
47 |
private final InstallWizardPanel_ext wizardPanel; |
48 |
|
49 |
public TypicalOrAdvancedWizardPage(
|
50 |
InstallWizardPanel_ext wizardPanel) { |
51 |
super();
|
52 |
this.wizardPanel = wizardPanel;
|
53 |
} |
54 |
|
55 |
@Override
|
56 |
public JPanel getJPanel() { |
57 |
return this; |
58 |
} |
59 |
|
60 |
@Override
|
61 |
public String getPanelTitle() { |
62 |
return wizardPanel.getTranslation("_select_installation_mode"); |
63 |
} |
64 |
|
65 |
@Override
|
66 |
public void lastPanel() { |
67 |
} |
68 |
|
69 |
@Override
|
70 |
public void nextPanel() throws NotContinueWizardException { |
71 |
if (!wizardPanel.getSkipTypicalOrAdvancedWizardPage()) {
|
72 |
wizardPanel.setSkipSelectPackagesWizardPage(!isAdvancedModeSelected()); |
73 |
} |
74 |
} |
75 |
|
76 |
@Override
|
77 |
public void updatePanel() { |
78 |
boolean enableTypicalMode = false; |
79 |
File packages = new File(wizardPanel.getInstallFolder(),"package.gvspks"); |
80 |
if( packages.exists() ) {
|
81 |
try {
|
82 |
ZipFile z = new ZipFile(packages); |
83 |
if( z.getEntry("defaultPackages")!=null ) { |
84 |
enableTypicalMode = true;
|
85 |
} |
86 |
} catch (IOException ex) { |
87 |
} |
88 |
} |
89 |
setEnableTypicalMode(enableTypicalMode); |
90 |
if (wizardPanel.getSkipTypicalOrAdvancedWizardPage()) {
|
91 |
wizardPanel.skip(); |
92 |
} |
93 |
|
94 |
} |
95 |
} |