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 / execution / wizard / TypicalOrAdvancedWizard.java @ 40560

History | View | Annotate | Download (3.01 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.execution.wizard;
25

    
26
import java.util.List;
27

    
28
import javax.swing.JPanel;
29

    
30
import org.gvsig.gui.beans.wizard.WizardPanelWithLogo;
31
import org.gvsig.gui.beans.wizard.panel.NotContinueWizardException;
32
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
33
import org.gvsig.installer.lib.api.execution.InstallPackageService;
34
import org.gvsig.installer.swing.impl.execution.DefaultInstallPackageWizard;
35
import org.gvsig.installer.swing.impl.execution.panel.TypicalOrAdvancedPanel;
36

    
37
/**
38
 * @author gvSIG Team
39
 * @version $Id$
40
 * 
41
 */
42
public class TypicalOrAdvancedWizard extends TypicalOrAdvancedPanel implements
43
                OptionPanel {
44

    
45
        private DefaultInstallPackageWizard installerExecutionWizard;
46

    
47
        private int direccion = WizardPanelWithLogo.ACTION_NEXT;
48

    
49
        public TypicalOrAdvancedWizard(
50
                        DefaultInstallPackageWizard installerExecutionWizard) {
51
                super();
52
                this.installerExecutionWizard = installerExecutionWizard;
53
        }
54

    
55
        private static final long serialVersionUID = -7151675399781722322L;
56

    
57
        public JPanel getJPanel() {
58
                return this;
59
        }
60

    
61
        public String getPanelTitle() {
62
                return swingInstallerManager.getText("_select_installation_mode");
63
        }
64

    
65
        public void lastPanel() {
66
                direccion = WizardPanelWithLogo.ACTION_NEXT;
67

    
68
        }
69

    
70
        public void nextPanel() throws NotContinueWizardException {
71
                if (installerExecutionWizard.getAskTypicalOrCustom()) {
72
                        installerExecutionWizard
73
                                        .setShowSelectPackagesPanel(isAdvancedModeSelected());
74
                }
75
                direccion = WizardPanelWithLogo.ACTION_PREVIOUS;
76
        }
77

    
78
        public void updatePanel() {
79
                InstallPackageService service = installerExecutionWizard
80
                                .getInstallerExecutionService();
81

    
82
                if (!installerExecutionWizard.getAskTypicalOrCustom()) {
83
                        (installerExecutionWizard).doAction(direccion);
84
                }
85

    
86
                // if no packages will be selected on typical mode
87
                List<String> defaultdPackagesIDs = service
88
                                .getDefaultSelectedPackagesIDs();
89

    
90
                // disable or enable the typical mode
91
                if ((defaultdPackagesIDs == null) || (defaultdPackagesIDs.size() < 1)) {
92
                        setEnableTypicalMode(false);
93
                } else {
94
                        // typical mode is enabled
95
                        setEnableTypicalMode(true);
96
                }
97

    
98
        }
99
}