Revision 32632
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/wizard/WizardPanelCancelAction.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 2 |
|
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 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.swing.impl.wizard; |
|
29 |
|
|
30 |
import jwizardcomponent.CancelAction; |
|
31 |
import jwizardcomponent.JWizardComponents; |
|
32 |
|
|
33 |
import org.gvsig.installer.swing.api.wizard.WizardPanel; |
|
34 |
|
|
35 |
/** |
|
36 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
37 |
*/ |
|
38 |
public class WizardPanelCancelAction extends CancelAction{ |
|
39 |
private WizardPanel wizardPanel = null; |
|
40 |
|
|
41 |
public WizardPanelCancelAction(JWizardComponents wizardComponents, WizardPanel wizardPanel) { |
|
42 |
super(wizardComponents); |
|
43 |
this.wizardPanel = wizardPanel; |
|
44 |
} |
|
45 |
|
|
46 |
public void performAction() { |
|
47 |
if (wizardPanel.getWizardActionListener() != null){ |
|
48 |
wizardPanel.getWizardActionListener().closeWizard(); |
|
49 |
} |
|
50 |
} |
|
51 |
} |
|
52 |
|
|
0 | 53 |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/wizard/ProgressWizard.java | ||
---|---|---|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
public void lastPanel() { |
64 |
// TODO Auto-generated method stub
|
|
65 |
|
|
64 |
installerExecutionWizard.setFinishButtonVisible(false);
|
|
65 |
installerExecutionWizard.setCancelButtonEnabled(true); |
|
66 | 66 |
} |
67 | 67 |
|
68 | 68 |
public void nextPanel() { |
... | ... | |
92 | 92 |
setExceptionText(e); |
93 | 93 |
} |
94 | 94 |
setProgress(100); |
95 |
|
|
96 |
installerExecutionWizard.setFinishButtonVisible(true); |
|
97 |
installerExecutionWizard.setCancelButtonEnabled(false); |
|
95 | 98 |
} |
96 | 99 |
} |
97 | 100 |
|
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/DefaultInstallPackageWizard.java | ||
---|---|---|
45 | 45 |
import org.gvsig.installer.swing.impl.execution.wizard.ProgressWizard; |
46 | 46 |
import org.gvsig.installer.swing.impl.execution.wizard.SelectInstallersWizard; |
47 | 47 |
import org.gvsig.installer.swing.impl.execution.wizard.SelectPluginsWizard; |
48 |
import org.gvsig.installer.swing.impl.wizard.WizardPanelCancelAction; |
|
48 | 49 |
import org.gvsig.installer.swing.impl.wizard.WizardPanelFinishAction; |
49 | 50 |
import org.gvsig.installer.swing.impl.wizard.WizardPanelWithLogo; |
50 | 51 |
import org.slf4j.Logger; |
... | ... | |
77 | 78 |
|
78 | 79 |
addWizards(); |
79 | 80 |
|
81 |
//Adding the listeners |
|
80 | 82 |
getWizardComponents().setFinishAction(new WizardPanelFinishAction(getWizardComponents(), this)); |
83 |
getWizardComponents().setCancelAction(new WizardPanelCancelAction(getWizardComponents(), this)); |
|
81 | 84 |
|
85 |
setFinishButtonVisible(false); |
|
86 |
|
|
82 | 87 |
this.setLayout(new BorderLayout()); |
83 | 88 |
this.add(wizardPanelWithLogo, BorderLayout.CENTER); |
84 | 89 |
|
... | ... | |
120 | 125 |
|
121 | 126 |
public void setNextButtonEnabled(boolean isEnabled){ |
122 | 127 |
getWizardComponents().getNextButton().setEnabled(isEnabled); |
128 |
} |
|
129 |
|
|
130 |
public void setFinishButtonVisible(boolean isVisible){ |
|
131 |
getWizardComponents().getFinishButton().setEnabled(isVisible); |
|
132 |
} |
|
133 |
|
|
134 |
public void setCancelButtonEnabled(boolean isEnabled){ |
|
135 |
getWizardComponents().getCancelButton().setEnabled(isEnabled); |
|
123 | 136 |
} |
124 | 137 |
|
125 | 138 |
@Override |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/DefaultMakePluginPackageWizard.java | ||
---|---|---|
48 | 48 |
import org.gvsig.installer.swing.impl.creation.wizard.SelectFilesWizard; |
49 | 49 |
import org.gvsig.installer.swing.impl.creation.wizard.SelectOutputFileWizard; |
50 | 50 |
import org.gvsig.installer.swing.impl.creation.wizard.SelectPlugintoInstallWizard; |
51 |
import org.gvsig.installer.swing.impl.wizard.WizardPanelCancelAction; |
|
51 | 52 |
import org.gvsig.installer.swing.impl.wizard.WizardPanelFinishAction; |
52 | 53 |
import org.gvsig.installer.swing.impl.wizard.WizardPanelWithLogo; |
53 | 54 |
import org.gvsig.tools.locator.LocatorException; |
... | ... | |
86 | 87 |
|
87 | 88 |
addWizards(); |
88 | 89 |
|
90 |
//Adding the listeners |
|
89 | 91 |
getWizardComponents().setFinishAction(new WizardPanelFinishAction(getWizardComponents(), this)); |
90 |
|
|
92 |
getWizardComponents().setCancelAction(new WizardPanelCancelAction(getWizardComponents(), this)); |
|
93 |
|
|
94 |
setFinishButtonVisible(false); |
|
95 |
|
|
91 | 96 |
this.setLayout(new BorderLayout()); |
92 | 97 |
this.add(wizardPanelWithLogo, BorderLayout.CENTER); |
93 | 98 |
|
... | ... | |
138 | 143 |
public void setNextButtonEnabled(boolean isEnabled){ |
139 | 144 |
getWizardComponents().getNextButton().setEnabled(isEnabled); |
140 | 145 |
} |
146 |
|
|
147 |
public void setCancelButtonEnabled(boolean isEnabled){ |
|
148 |
getWizardComponents().getCancelButton().setEnabled(isEnabled); |
|
149 |
} |
|
150 |
|
|
151 |
public void setFinishButtonVisible(boolean isVisible){ |
|
152 |
getWizardComponents().getFinishButton().setVisible(isVisible); |
|
153 |
} |
|
141 | 154 |
|
142 |
|
|
143 | 155 |
public void setAdvancedModeSelected(boolean advancedModeSelected) { |
144 | 156 |
for (int i=getWizardComponents().getWizardPanelList().size()-1 ; i>=3 ; i--){ |
145 | 157 |
getWizardComponents().removeWizardPanel(i); |
... | ... | |
177 | 189 |
|
178 | 190 |
public void setSelectedPackageInfo(PackageInfo selectedPackageInfo) { |
179 | 191 |
this.selectedPackageInfo = selectedPackageInfo; |
180 |
} |
|
192 |
}
|
|
181 | 193 |
} |
182 | 194 |
|
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/wizard/ProgressWizard.java | ||
---|---|---|
59 | 59 |
} |
60 | 60 |
|
61 | 61 |
public void lastPanel() { |
62 |
// TODO Auto-generated method stub
|
|
63 |
|
|
62 |
installerCreationWizard.setFinishButtonVisible(false);
|
|
63 |
installerCreationWizard.setCancelButtonEnabled(true); |
|
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
public void nextPanel() { |
... | ... | |
88 | 88 |
logger.error(swingInstallerManager.getText("create_output_file_exception"), e); |
89 | 89 |
setExceptionText(e); |
90 | 90 |
} |
91 |
|
|
92 |
setProgress(100); |
|
93 |
installerCreationWizard.setFinishButtonVisible(true); |
|
94 |
installerCreationWizard.setCancelButtonEnabled(false); |
|
91 | 95 |
} |
92 | 96 |
|
93 | 97 |
|
Also available in: Unified diff