Revision 37591 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/SelectFilesWizard.java
SelectFilesWizard.java | ||
---|---|---|
44 | 44 |
*/ |
45 | 45 |
public class SelectFilesWizard extends SelectFilesPanel implements OptionPanel { |
46 | 46 |
|
47 |
private static final long serialVersionUID = 1645239143301238773L;
|
|
48 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
47 |
private static final long serialVersionUID = 1645239143301238773L;
|
|
48 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
49 | 49 |
|
50 |
public SelectFilesWizard(
|
|
51 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
52 |
super();
|
|
53 |
this.installerCreationWizard = installerCreationWizard;
|
|
54 |
}
|
|
50 |
public SelectFilesWizard(
|
|
51 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
52 |
super();
|
|
53 |
this.installerCreationWizard = installerCreationWizard;
|
|
54 |
}
|
|
55 | 55 |
|
56 |
public JPanel getJPanel() {
|
|
57 |
return this;
|
|
58 |
}
|
|
56 |
public JPanel getJPanel() {
|
|
57 |
return this;
|
|
58 |
}
|
|
59 | 59 |
|
60 |
public String getPanelTitle() {
|
|
61 |
return swingInstallerManager.getText("files_to_copy");
|
|
62 |
}
|
|
60 |
public String getPanelTitle() {
|
|
61 |
return swingInstallerManager.getText("files_to_copy");
|
|
62 |
}
|
|
63 | 63 |
|
64 |
public void lastPanel() {
|
|
65 |
// Do nothing
|
|
64 |
public void lastPanel() {
|
|
65 |
// Do nothing
|
|
66 | 66 |
|
67 |
}
|
|
67 |
}
|
|
68 | 68 |
|
69 |
public void nextPanel() {
|
|
69 |
public void nextPanel() {
|
|
70 | 70 |
|
71 |
PackageInfo packageInfo =
|
|
72 |
installerCreationWizard.getSelectedPackageInfo();
|
|
71 |
PackageInfo packageInfo = installerCreationWizard
|
|
72 |
.getSelectedPackageInfo();
|
|
73 | 73 |
|
74 |
packageInfo.clearFilesToCopy();
|
|
75 |
List<File> selectedFiles = getSelectedFiles();
|
|
74 |
packageInfo.clearFilesToCopy();
|
|
75 |
List<File> selectedFiles = getSelectedFiles();
|
|
76 | 76 |
|
77 |
for (int i = 0; i < selectedFiles.size(); i++) {
|
|
78 |
packageInfo.addFileToCopy(selectedFiles.get(i));
|
|
79 |
}
|
|
80 |
}
|
|
77 |
for (int i = 0; i < selectedFiles.size(); i++) {
|
|
78 |
packageInfo.addFileToCopy(selectedFiles.get(i));
|
|
79 |
}
|
|
80 |
}
|
|
81 | 81 |
|
82 |
public void updatePanel() {
|
|
83 |
String path =
|
|
84 |
installerCreationWizard.getPluginsFolder() + File.separator
|
|
85 |
+ installerCreationWizard.getSelectedPackageInfo().getCode()
|
|
86 |
+ File.separator + "install/files";
|
|
87 |
File folder = new File(path);
|
|
82 |
public void updatePanel() {
|
|
83 |
String path = installerCreationWizard.getPluginsFolder()
|
|
84 |
+ File.separator
|
|
85 |
+ installerCreationWizard.getSelectedPackageInfo().getCode()
|
|
86 |
+ File.separator + "install/files";
|
|
87 |
File folder = new File(path);
|
|
88 | 88 |
|
89 |
if (folder.exists() && folder.isDirectory()) {
|
|
90 |
String msg =
|
|
91 |
Messages.getText("_the_folder_install/files_already_exists_do_you_want_to_delete_it_before_proceeding?");
|
|
89 |
if (folder.exists() && folder.isDirectory()) {
|
|
90 |
String msg = Messages
|
|
91 |
.getText("_the_folder_install/files_already_exists_do_you_want_to_delete_it_before_proceeding?");
|
|
92 | 92 |
|
93 |
int resp = |
|
94 |
JOptionPane.showConfirmDialog(null, msg, Messages |
|
95 |
.getText("select_an_option?"), JOptionPane.YES_NO_OPTION); |
|
93 |
int resp = JOptionPane.showConfirmDialog(null, msg, Messages |
|
94 |
.getText("select_an_option?"), JOptionPane.YES_NO_OPTION); |
|
96 | 95 |
|
97 |
if (resp == JOptionPane.OK_OPTION) { |
|
98 |
PackageInfo packageInfo = |
|
99 |
installerCreationWizard.getSelectedPackageInfo(); |
|
100 |
|
|
101 |
if (!packageInfo.removeFilesFolder(folder)) { |
|
102 |
JOptionPane.showMessageDialog(null, Messages.getText("_Couldn't_delete_the_directory")); |
|
103 |
} |
|
104 |
} |
|
96 |
if (resp == JOptionPane.OK_OPTION) { |
|
97 |
PackageInfo packageInfo = installerCreationWizard |
|
98 |
.getSelectedPackageInfo(); |
|
105 | 99 |
|
106 |
|
|
107 |
} |
|
100 |
if (!packageInfo.removeFilesFolder(folder)) { |
|
101 |
JOptionPane.showMessageDialog(null, Messages |
|
102 |
.getText("_Couldn't_delete_the_directory")); |
|
103 |
} |
|
104 |
} |
|
108 | 105 |
|
109 |
}
|
|
106 |
}
|
|
110 | 107 |
|
108 |
} |
|
109 |
|
|
111 | 110 |
} |
Also available in: Unified diff