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/AdvancedModeSelectionWizard.java | ||
---|---|---|
42 | 42 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
43 | 43 |
*/ |
44 | 44 |
public class AdvancedModeSelectionWizard extends AdvancedModeSelectionPanel |
45 |
implements OptionPanel {
|
|
45 |
implements OptionPanel {
|
|
46 | 46 |
|
47 |
/**
|
|
47 |
/**
|
|
48 | 48 |
* |
49 | 49 |
*/ |
50 |
private static final long serialVersionUID = 257540289911849694L;
|
|
51 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
50 |
private static final long serialVersionUID = 257540289911849694L;
|
|
51 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
52 | 52 |
|
53 |
public AdvancedModeSelectionWizard(
|
|
54 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
55 |
super();
|
|
56 |
this.installerCreationWizard = installerCreationWizard;
|
|
57 |
}
|
|
53 |
public AdvancedModeSelectionWizard(
|
|
54 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
55 |
super();
|
|
56 |
this.installerCreationWizard = installerCreationWizard;
|
|
57 |
}
|
|
58 | 58 |
|
59 |
public JPanel getJPanel() {
|
|
60 |
return this;
|
|
61 |
}
|
|
59 |
public JPanel getJPanel() {
|
|
60 |
return this;
|
|
61 |
}
|
|
62 | 62 |
|
63 |
public String getPanelTitle() {
|
|
64 |
return swingInstallerManager.getText("advanced_mode_selection");
|
|
65 |
}
|
|
63 |
public String getPanelTitle() {
|
|
64 |
return swingInstallerManager.getText("advanced_mode_selection");
|
|
65 |
}
|
|
66 | 66 |
|
67 |
public void lastPanel() {
|
|
68 |
// TODO Auto-generated method stub
|
|
67 |
public void lastPanel() {
|
|
68 |
// TODO Auto-generated method stub
|
|
69 | 69 |
|
70 |
}
|
|
70 |
}
|
|
71 | 71 |
|
72 |
public void nextPanel() {
|
|
72 |
public void nextPanel() {
|
|
73 | 73 |
|
74 |
if (!isAdvancedModeSelected()) { |
|
75 |
|
|
76 |
String path = |
|
77 |
installerCreationWizard.getPluginsFolder() + File.separator |
|
78 |
+ installerCreationWizard.getSelectedPackageInfo().getCode() |
|
79 |
+ File.separator + "install"; |
|
80 |
File folder = new File(path); |
|
74 |
if (!isAdvancedModeSelected()) { |
|
81 | 75 |
|
82 |
if (folder.exists()) { |
|
83 |
String msg = |
|
84 |
Messages.getText("_the_folder_install_already_exists_do_you_want_to_delete_it_before_proceeding"); |
|
76 |
String path = installerCreationWizard.getPluginsFolder() |
|
77 |
+ File.separator |
|
78 |
+ installerCreationWizard.getSelectedPackageInfo() |
|
79 |
.getCode() + File.separator + "install"; |
|
80 |
File folder = new File(path); |
|
85 | 81 |
|
86 |
int resp = |
|
87 |
JOptionPane.showConfirmDialog(null, msg, Messages |
|
88 |
.getText("select_an_option?"), |
|
89 |
JOptionPane.YES_NO_OPTION); |
|
82 |
if (folder.exists()) { |
|
83 |
String msg = Messages |
|
84 |
.getText("_the_folder_install_already_exists_do_you_want_to_delete_it_before_proceeding"); |
|
90 | 85 |
|
91 |
if (resp == JOptionPane.OK_OPTION) { |
|
92 |
PackageInfo packageInfo = |
|
93 |
installerCreationWizard.getSelectedPackageInfo(); |
|
94 |
boolean success = packageInfo.removeInstallFolder(folder); |
|
95 |
|
|
96 |
if (!success) { |
|
97 |
JOptionPane.showMessageDialog(null, Messages.getText("_Couldn't_delete_the_directory")); |
|
98 |
} |
|
99 |
} |
|
100 |
} |
|
101 |
} |
|
102 |
installerCreationWizard |
|
103 |
.setAdvancedModeSelected(isAdvancedModeSelected()); |
|
104 |
} |
|
86 |
int resp = JOptionPane.showConfirmDialog(null, msg, Messages |
|
87 |
.getText("select_an_option?"), |
|
88 |
JOptionPane.YES_NO_OPTION); |
|
105 | 89 |
|
106 |
public void updatePanel() { |
|
107 |
// TODO Auto-generated method stub |
|
90 |
if (resp == JOptionPane.OK_OPTION) { |
|
91 |
PackageInfo packageInfo = installerCreationWizard |
|
92 |
.getSelectedPackageInfo(); |
|
93 |
boolean success = packageInfo.removeInstallFolder(folder); |
|
108 | 94 |
|
109 |
} |
|
95 |
if (!success) { |
|
96 |
JOptionPane.showMessageDialog(null, Messages |
|
97 |
.getText("_Couldn't_delete_the_directory")); |
|
98 |
} |
|
99 |
} |
|
100 |
} |
|
101 |
} |
|
102 |
installerCreationWizard |
|
103 |
.setAdvancedModeSelected(isAdvancedModeSelected()); |
|
104 |
} |
|
110 | 105 |
|
106 |
public void updatePanel() { |
|
107 |
// TODO Auto-generated method stub |
|
108 |
|
|
109 |
} |
|
110 |
|
|
111 | 111 |
} |
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/SelectOutputFileWizard.java | ||
---|---|---|
49 | 49 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
50 | 50 |
*/ |
51 | 51 |
public class SelectOutputFileWizard extends DefaultOutputPanel implements |
52 |
OptionPanel {
|
|
52 |
OptionPanel {
|
|
53 | 53 |
|
54 |
/**
|
|
54 |
/**
|
|
55 | 55 |
* |
56 | 56 |
*/ |
57 |
private static final long serialVersionUID = 555020268506822671L;
|
|
58 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
59 |
private static final Logger logger =
|
|
60 |
LoggerFactory.getLogger(SelectOutputFileWizard.class);
|
|
57 |
private static final long serialVersionUID = 555020268506822671L;
|
|
58 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
59 |
private static final Logger logger = LoggerFactory
|
|
60 |
.getLogger(SelectOutputFileWizard.class);
|
|
61 | 61 |
|
62 |
public SelectOutputFileWizard(
|
|
63 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
64 |
super();
|
|
65 |
this.installerCreationWizard = installerCreationWizard;
|
|
66 |
}
|
|
62 |
public SelectOutputFileWizard(
|
|
63 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
64 |
super();
|
|
65 |
this.installerCreationWizard = installerCreationWizard;
|
|
66 |
}
|
|
67 | 67 |
|
68 |
public JPanel getJPanel() {
|
|
69 |
return this;
|
|
70 |
}
|
|
68 |
public JPanel getJPanel() {
|
|
69 |
return this;
|
|
70 |
}
|
|
71 | 71 |
|
72 |
public String getPanelTitle() {
|
|
73 |
return swingInstallerManager.getText("output_options");
|
|
74 |
}
|
|
72 |
public String getPanelTitle() {
|
|
73 |
return swingInstallerManager.getText("output_options");
|
|
74 |
}
|
|
75 | 75 |
|
76 |
public void lastPanel() {
|
|
76 |
public void lastPanel() {
|
|
77 | 77 |
|
78 |
}
|
|
78 |
}
|
|
79 | 79 |
|
80 |
public void nextPanel() throws NotContinueWizardException { |
|
81 |
try { |
|
82 |
File file = getPackageFile(); |
|
83 |
File filePath = new File(file.getParent()); |
|
84 |
if (!filePath.exists()) { |
|
85 |
JOptionPane.showMessageDialog(installerCreationWizard, |
|
86 |
swingInstallerManager |
|
87 |
.getText("The_package_file_folder_does_not_exist: _") |
|
88 |
+ filePath); |
|
89 |
throw new NotContinueWizardException("", null, false); |
|
90 |
} |
|
80 |
public void nextPanel() throws NotContinueWizardException { |
|
81 |
try { |
|
82 |
File file = getPackageFile(); |
|
83 |
File filePath = new File(file.getParent()); |
|
84 |
if (!filePath.exists()) { |
|
85 |
JOptionPane |
|
86 |
.showMessageDialog( |
|
87 |
installerCreationWizard, |
|
88 |
swingInstallerManager |
|
89 |
.getText("The_package_file_folder_does_not_exist: _") |
|
90 |
+ filePath); |
|
91 |
throw new NotContinueWizardException("", null, false); |
|
92 |
} |
|
91 | 93 |
|
92 |
if (isCreatePackageIndex()) { |
|
93 |
URL url = getDownloadURL(); |
|
94 |
if (url == null) { |
|
95 |
throw new NotContinueWizardException("", null, false); |
|
96 |
} |
|
97 |
installerCreationWizard.setDownloadURL(url); |
|
98 |
File indexFile = getPackageIndexFile(); |
|
99 |
File indexFilePath = new File(indexFile.getParent()); |
|
100 |
if (!indexFilePath.exists()) { |
|
101 |
JOptionPane |
|
102 |
.showMessageDialog( |
|
103 |
installerCreationWizard, |
|
104 |
swingInstallerManager |
|
105 |
.getText("The_package_index_file_folder_does_not_exist: _") |
|
106 |
+ indexFilePath); |
|
107 |
throw new NotContinueWizardException("", null, false); |
|
108 |
} |
|
109 |
installerCreationWizard |
|
110 |
.setIndexOutputStream(new FileOutputStream(indexFile)); |
|
111 |
} |
|
112 |
installerCreationWizard.setOutputStream(new FileOutputStream(file)); |
|
113 |
} catch (FileNotFoundException e) { |
|
114 |
logger.info(swingInstallerManager |
|
115 |
.getText("create_output_file_exception"), e); |
|
116 |
JOptionPane.showMessageDialog(installerCreationWizard, |
|
117 |
swingInstallerManager.getText("create_output_file_exception")); |
|
118 |
} |
|
119 |
} |
|
94 |
if (isCreatePackageIndex()) { |
|
95 |
URL url = getDownloadURL(); |
|
96 |
if (url == null) { |
|
97 |
throw new NotContinueWizardException("", null, false); |
|
98 |
} |
|
99 |
installerCreationWizard.setDownloadURL(url); |
|
100 |
File indexFile = getPackageIndexFile(); |
|
101 |
File indexFilePath = new File(indexFile.getParent()); |
|
102 |
if (!indexFilePath.exists()) { |
|
103 |
JOptionPane |
|
104 |
.showMessageDialog( |
|
105 |
installerCreationWizard, |
|
106 |
swingInstallerManager |
|
107 |
.getText("The_package_index_file_folder_does_not_exist: _") |
|
108 |
+ indexFilePath); |
|
109 |
throw new NotContinueWizardException("", null, false); |
|
110 |
} |
|
111 |
installerCreationWizard |
|
112 |
.setIndexOutputStream(new FileOutputStream(indexFile)); |
|
113 |
} |
|
114 |
installerCreationWizard.setOutputStream(new FileOutputStream(file)); |
|
115 |
} catch (FileNotFoundException e) { |
|
116 |
logger.info(swingInstallerManager |
|
117 |
.getText("create_output_file_exception"), e); |
|
118 |
JOptionPane.showMessageDialog(installerCreationWizard, |
|
119 |
swingInstallerManager |
|
120 |
.getText("create_output_file_exception")); |
|
121 |
} |
|
122 |
} |
|
120 | 123 |
|
121 |
public void updatePanel() {
|
|
122 |
setPackageFile(getDefaultPackageBundleFile());
|
|
123 |
setPackageIndexFile(getDefaultPackageIndexBundleFile());
|
|
124 |
}
|
|
124 |
public void updatePanel() {
|
|
125 |
setPackageFile(getDefaultPackageBundleFile());
|
|
126 |
setPackageIndexFile(getDefaultPackageIndexBundleFile());
|
|
127 |
}
|
|
125 | 128 |
|
126 |
private File getDefaultPackageBundleFile() {
|
|
127 |
File installsFolder = installerCreationWizard.getInstallFolder();
|
|
128 |
PackageInfo info = installerCreationWizard.getSelectedPackageInfo();
|
|
129 |
String fileName =
|
|
130 |
InstallerLocator.getInstallerManager().getPackageFileName(info);
|
|
131 |
return new File(installsFolder, fileName);
|
|
132 |
}
|
|
129 |
private File getDefaultPackageBundleFile() {
|
|
130 |
File installsFolder = installerCreationWizard.getInstallFolder();
|
|
131 |
PackageInfo info = installerCreationWizard.getSelectedPackageInfo();
|
|
132 |
String fileName = InstallerLocator.getInstallerManager()
|
|
133 |
.getPackageFileName(info);
|
|
134 |
return new File(installsFolder, fileName);
|
|
135 |
}
|
|
133 | 136 |
|
134 |
private File getDefaultPackageIndexBundleFile() { |
|
135 |
File installsFolder = installerCreationWizard.getInstallFolder(); |
|
136 |
PackageInfo info = installerCreationWizard.getSelectedPackageInfo(); |
|
137 |
String fileName = |
|
138 |
InstallerLocator.getInstallerManager() |
|
139 |
.getPackageIndexFileName(info); |
|
140 |
return new File(installsFolder, fileName); |
|
141 |
} |
|
137 |
private File getDefaultPackageIndexBundleFile() { |
|
138 |
File installsFolder = installerCreationWizard.getInstallFolder(); |
|
139 |
PackageInfo info = installerCreationWizard.getSelectedPackageInfo(); |
|
140 |
String fileName = InstallerLocator.getInstallerManager() |
|
141 |
.getPackageIndexFileName(info); |
|
142 |
return new File(installsFolder, fileName); |
|
143 |
} |
|
142 | 144 |
|
143 | 145 |
} |
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 | ||
---|---|---|
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 |
} |
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 | ||
---|---|---|
46 | 46 |
*/ |
47 | 47 |
public class ProgressWizard extends DefaultProgressPanel implements OptionPanel { |
48 | 48 |
|
49 |
private static final long serialVersionUID = -2940454513497249659L;
|
|
50 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
51 |
private DefaultSwingInstallerManager swingInstallerManager;
|
|
49 |
private static final long serialVersionUID = -2940454513497249659L;
|
|
50 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
51 |
private DefaultSwingInstallerManager swingInstallerManager;
|
|
52 | 52 |
|
53 |
public ProgressWizard(DefaultMakePluginPackageWizard installerCreationWizard) { |
|
54 |
super(); |
|
55 |
this.installerCreationWizard = installerCreationWizard; |
|
56 |
swingInstallerManager = |
|
57 |
(DefaultSwingInstallerManager) SwingInstallerLocator |
|
58 |
.getSwingInstallerManager(); |
|
59 |
} |
|
53 |
public ProgressWizard(DefaultMakePluginPackageWizard installerCreationWizard) { |
|
54 |
super(); |
|
55 |
this.installerCreationWizard = installerCreationWizard; |
|
56 |
swingInstallerManager = (DefaultSwingInstallerManager) SwingInstallerLocator |
|
57 |
.getSwingInstallerManager(); |
|
58 |
} |
|
60 | 59 |
|
61 |
public JPanel getJPanel() {
|
|
62 |
return this;
|
|
63 |
}
|
|
60 |
public JPanel getJPanel() {
|
|
61 |
return this;
|
|
62 |
}
|
|
64 | 63 |
|
65 |
public String getPanelTitle() {
|
|
66 |
return swingInstallerManager.getText("_Installer_progress");
|
|
67 |
}
|
|
64 |
public String getPanelTitle() {
|
|
65 |
return swingInstallerManager.getText("_Installer_progress");
|
|
66 |
}
|
|
68 | 67 |
|
69 |
public void lastPanel() {
|
|
70 |
installerCreationWizard.setFinishButtonEnabled(false);
|
|
71 |
installerCreationWizard.setCancelButtonEnabled(true);
|
|
72 |
}
|
|
68 |
public void lastPanel() {
|
|
69 |
installerCreationWizard.setFinishButtonEnabled(false);
|
|
70 |
installerCreationWizard.setCancelButtonEnabled(true);
|
|
71 |
}
|
|
73 | 72 |
|
74 |
public void nextPanel() {
|
|
75 |
// Do nothing
|
|
76 |
}
|
|
73 |
public void nextPanel() {
|
|
74 |
// Do nothing
|
|
75 |
}
|
|
77 | 76 |
|
78 |
public void updatePanel() {
|
|
79 |
MakePluginPackageService installerCreationService =
|
|
80 |
installerCreationWizard.getInstallerCreationService();
|
|
77 |
public void updatePanel() {
|
|
78 |
MakePluginPackageService installerCreationService = installerCreationWizard
|
|
79 |
.getInstallerCreationService();
|
|
81 | 80 |
|
82 |
PackageInfo packageInfo =
|
|
83 |
installerCreationWizard.getSelectedPackageInfo();
|
|
81 |
PackageInfo packageInfo = installerCreationWizard
|
|
82 |
.getSelectedPackageInfo();
|
|
84 | 83 |
|
85 |
SimpleTaskStatus taskStatus = |
|
86 |
ToolsLocator.getTaskStatusManager().createDefaultSimpleTaskStatus( |
|
87 |
packageInfo.getName()); |
|
88 |
this.bind(taskStatus); |
|
89 |
try { |
|
90 |
// Compress the plugin |
|
91 |
taskStatus.message(swingInstallerManager.getText("_Compressing")); |
|
92 |
installerCreationService.preparePackage(packageInfo); |
|
93 |
installerCreationService.createPackage(packageInfo, |
|
94 |
installerCreationWizard.getOutputStream()); |
|
95 |
if (installerCreationWizard.getIndexOutputStream() != null) { |
|
96 |
taskStatus.message(swingInstallerManager |
|
97 |
.getText("_Creating_index")); |
|
98 |
PackageInfo info = |
|
99 |
installerCreationWizard.getSelectedPackageInfo(); |
|
100 |
File pluginFolder = |
|
101 |
installerCreationWizard.getMakePluginPackageService() |
|
102 |
.getPluginFolder(info); |
|
84 |
SimpleTaskStatus taskStatus = ToolsLocator.getTaskStatusManager() |
|
85 |
.createDefaultSimpleTaskStatus(packageInfo.getName()); |
|
86 |
this.bind(taskStatus); |
|
87 |
try { |
|
88 |
// Compress the plugin |
|
89 |
taskStatus.message(swingInstallerManager.getText("_Compressing")); |
|
90 |
installerCreationService.preparePackage(packageInfo); |
|
91 |
installerCreationService.createPackage(packageInfo, |
|
92 |
installerCreationWizard.getOutputStream()); |
|
93 |
if (installerCreationWizard.getIndexOutputStream() != null) { |
|
94 |
taskStatus.message(swingInstallerManager |
|
95 |
.getText("_Creating_index")); |
|
96 |
PackageInfo info = installerCreationWizard |
|
97 |
.getSelectedPackageInfo(); |
|
98 |
File pluginFolder = installerCreationWizard |
|
99 |
.getMakePluginPackageService().getPluginFolder(info); |
|
103 | 100 |
|
104 |
PackageInfo infoIndex = (PackageInfo) info.clone();
|
|
105 |
infoIndex.setDownloadURL(installerCreationWizard
|
|
106 |
.getDownloadURL());
|
|
101 |
PackageInfo infoIndex = (PackageInfo) info.clone();
|
|
102 |
infoIndex.setDownloadURL(installerCreationWizard
|
|
103 |
.getDownloadURL());
|
|
107 | 104 |
|
108 |
installerCreationService.writePackageInfoForIndex(infoIndex,
|
|
109 |
pluginFolder);
|
|
110 |
installerCreationService.createPackageIndex(info,
|
|
111 |
installerCreationWizard.getIndexOutputStream());
|
|
112 |
}
|
|
113 |
taskStatus.terminate();
|
|
105 |
installerCreationService.writePackageInfoForIndex(infoIndex,
|
|
106 |
pluginFolder);
|
|
107 |
installerCreationService.createPackageIndex(info,
|
|
108 |
installerCreationWizard.getIndexOutputStream());
|
|
109 |
}
|
|
110 |
taskStatus.terminate();
|
|
114 | 111 |
|
115 |
// Set the finished text
|
|
116 |
taskStatus.message(swingInstallerManager.getText("_Finished"));
|
|
117 |
} catch (MakePluginPackageServiceException e) {
|
|
118 |
this.showErrorMessage(swingInstallerManager
|
|
119 |
.getText("_Cant_create_package"), e);
|
|
120 |
} catch (CloneNotSupportedException e) {
|
|
121 |
this.showErrorMessage(swingInstallerManager
|
|
122 |
.getText("_Cant_create_package"), e);
|
|
123 |
}
|
|
124 |
installerCreationWizard.setFinishButtonEnabled(true);
|
|
125 |
installerCreationWizard.setCancelButtonEnabled(false);
|
|
126 |
}
|
|
112 |
// Set the finished text
|
|
113 |
taskStatus.message(swingInstallerManager.getText("_Finished"));
|
|
114 |
} catch (MakePluginPackageServiceException e) {
|
|
115 |
this.showErrorMessage(swingInstallerManager
|
|
116 |
.getText("_Cant_create_package"), e);
|
|
117 |
} catch (CloneNotSupportedException e) {
|
|
118 |
this.showErrorMessage(swingInstallerManager
|
|
119 |
.getText("_Cant_create_package"), e);
|
|
120 |
}
|
|
121 |
installerCreationWizard.setFinishButtonEnabled(true);
|
|
122 |
installerCreationWizard.setCancelButtonEnabled(false);
|
|
123 |
}
|
|
127 | 124 |
|
128 | 125 |
} |
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/AntScriptWizard.java | ||
---|---|---|
49 | 49 |
*/ |
50 | 50 |
public class AntScriptWizard extends AntScriptPanel implements OptionPanel { |
51 | 51 |
|
52 |
/**
|
|
52 |
/**
|
|
53 | 53 |
* |
54 | 54 |
*/ |
55 |
private static final long serialVersionUID = -4741237867123090223L;
|
|
56 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
57 |
private static final Logger log =
|
|
58 |
LoggerFactory.getLogger(AntScriptWizard.class);
|
|
55 |
private static final long serialVersionUID = -4741237867123090223L;
|
|
56 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
57 |
private static final Logger log = LoggerFactory
|
|
58 |
.getLogger(AntScriptWizard.class);
|
|
59 | 59 |
|
60 |
public AntScriptWizard(
|
|
61 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
62 |
super();
|
|
63 |
this.installerCreationWizard = installerCreationWizard;
|
|
64 |
}
|
|
60 |
public AntScriptWizard(
|
|
61 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
62 |
super();
|
|
63 |
this.installerCreationWizard = installerCreationWizard;
|
|
64 |
}
|
|
65 | 65 |
|
66 |
public JPanel getJPanel() {
|
|
67 |
return this;
|
|
68 |
}
|
|
66 |
public JPanel getJPanel() {
|
|
67 |
return this;
|
|
68 |
}
|
|
69 | 69 |
|
70 |
public String getPanelTitle() {
|
|
71 |
return swingInstallerManager.getText("ant_script");
|
|
72 |
}
|
|
70 |
public String getPanelTitle() {
|
|
71 |
return swingInstallerManager.getText("ant_script");
|
|
72 |
}
|
|
73 | 73 |
|
74 |
public void lastPanel() {
|
|
75 |
// TODO Auto-generated method stub
|
|
74 |
public void lastPanel() {
|
|
75 |
// TODO Auto-generated method stub
|
|
76 | 76 |
|
77 |
}
|
|
77 |
}
|
|
78 | 78 |
|
79 |
public void nextPanel() throws NotContinueWizardException {
|
|
80 |
DocumentBuilder documentBuilder;
|
|
81 |
try {
|
|
82 |
documentBuilder =
|
|
83 |
DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
|
84 |
documentBuilder.parse(new ByteArrayInputStream(getAntScript()
|
|
85 |
.getBytes()));
|
|
86 |
} catch (Exception e) {
|
|
87 |
throw new NotContinueWizardException("not_valid_xml", e,
|
|
88 |
installerCreationWizard);
|
|
89 |
}
|
|
90 |
PackageInfo packageInfo =
|
|
91 |
installerCreationWizard.getSelectedPackageInfo();
|
|
92 |
packageInfo.setAntScript(getAntScript());
|
|
93 |
}
|
|
79 |
public void nextPanel() throws NotContinueWizardException {
|
|
80 |
DocumentBuilder documentBuilder;
|
|
81 |
try {
|
|
82 |
documentBuilder = DocumentBuilderFactory.newInstance()
|
|
83 |
.newDocumentBuilder();
|
|
84 |
documentBuilder.parse(new ByteArrayInputStream(getAntScript()
|
|
85 |
.getBytes()));
|
|
86 |
} catch (Exception e) {
|
|
87 |
throw new NotContinueWizardException("not_valid_xml", e,
|
|
88 |
installerCreationWizard);
|
|
89 |
}
|
|
90 |
PackageInfo packageInfo = installerCreationWizard
|
|
91 |
.getSelectedPackageInfo();
|
|
92 |
packageInfo.setAntScript(getAntScript());
|
|
93 |
}
|
|
94 | 94 |
|
95 |
public void updatePanel() {
|
|
96 |
PackageInfo installerInfo;
|
|
97 |
try {
|
|
98 |
MakePluginPackageService installerCreationService =
|
|
99 |
installerCreationWizard.getInstallerCreationService();
|
|
100 |
installerInfo = installerCreationWizard.getSelectedPackageInfo();
|
|
101 |
if (installerInfo.getAntScript() != null) {
|
|
102 |
setAntScript(installerInfo.getAntScript());
|
|
103 |
} else {
|
|
104 |
setAntScript(installerCreationService.getDefaultAntScript());
|
|
105 |
}
|
|
106 |
} catch (MakePluginPackageServiceException e) {
|
|
107 |
log.error("There is not a selected installer info", e);
|
|
108 |
}
|
|
109 |
}
|
|
95 |
public void updatePanel() {
|
|
96 |
PackageInfo installerInfo;
|
|
97 |
try {
|
|
98 |
MakePluginPackageService installerCreationService = installerCreationWizard
|
|
99 |
.getInstallerCreationService();
|
|
100 |
installerInfo = installerCreationWizard.getSelectedPackageInfo();
|
|
101 |
if (installerInfo.getAntScript() != null) {
|
|
102 |
setAntScript(installerInfo.getAntScript());
|
|
103 |
} else {
|
|
104 |
setAntScript(installerCreationService.getDefaultAntScript());
|
|
105 |
}
|
|
106 |
} catch (MakePluginPackageServiceException e) {
|
|
107 |
log.error("There is not a selected installer info", e);
|
|
108 |
}
|
|
109 |
}
|
|
110 | 110 |
|
111 | 111 |
} |
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/PackageInfoWizard.java | ||
---|---|---|
39 | 39 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
40 | 40 |
*/ |
41 | 41 |
public class PackageInfoWizard extends DefaultPackageInfoPanel implements |
42 |
OptionPanel {
|
|
42 |
OptionPanel {
|
|
43 | 43 |
|
44 |
private static final long serialVersionUID = 6880987804806802863L;
|
|
44 |
private static final long serialVersionUID = 6880987804806802863L;
|
|
45 | 45 |
|
46 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
46 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
47 | 47 |
|
48 |
public PackageInfoWizard(
|
|
49 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
50 |
super();
|
|
51 |
this.installerCreationWizard = installerCreationWizard;
|
|
52 |
}
|
|
48 |
public PackageInfoWizard(
|
|
49 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
50 |
super();
|
|
51 |
this.installerCreationWizard = installerCreationWizard;
|
|
52 |
}
|
|
53 | 53 |
|
54 |
public JPanel getJPanel() {
|
|
55 |
return this;
|
|
56 |
}
|
|
54 |
public JPanel getJPanel() {
|
|
55 |
return this;
|
|
56 |
}
|
|
57 | 57 |
|
58 |
public String getPanelTitle() {
|
|
59 |
return swingInstallerManager.getText("plugin_description");
|
|
60 |
}
|
|
58 |
public String getPanelTitle() {
|
|
59 |
return swingInstallerManager.getText("plugin_description");
|
|
60 |
}
|
|
61 | 61 |
|
62 |
public void lastPanel() {
|
|
63 |
// TODO Auto-generated method stub
|
|
62 |
public void lastPanel() {
|
|
63 |
// TODO Auto-generated method stub
|
|
64 | 64 |
|
65 |
}
|
|
65 |
}
|
|
66 | 66 |
|
67 |
public void nextPanel() throws NotContinueWizardException { |
|
68 |
if( ! this.validatePanel() ) { |
|
69 |
throw new NotContinueWizardException("", null, false); |
|
70 |
} |
|
71 |
PackageInfo installerInfo = |
|
72 |
installerCreationWizard.getSelectedPackageInfo(); |
|
73 |
this.panelToPackageInfo(installerInfo); |
|
74 |
// installerInfo.setCode(getCode()); |
|
75 |
// installerInfo.setName(getName()); |
|
76 |
// installerInfo.setDescription(getDescription()); |
|
77 |
// installerInfo.setVersion(getVersion()); |
|
78 |
// installerInfo.setBuild(getBuild()); |
|
79 |
// installerInfo.setState(getState()); |
|
80 |
// installerInfo.setOfficial(isOfficial()); |
|
81 |
// installerInfo.setOperatingSystem(getOperatingSystem()); |
|
82 |
// installerInfo.setArchitecture(getArchitecture()); |
|
83 |
// installerInfo.setJavaVM(getJavaVM()); |
|
84 |
// installerInfo.setGvSIGVersion(getGvSIGVersion()); |
|
85 |
// try { |
|
86 |
// installerInfo.setSourcesURL(getSources()); |
|
87 |
// } catch (MalformedURLException e) { |
|
88 |
// JOptionPane.showMessageDialog(null, "_the_package_source_files_url_is_malformed._Please_review_it.", |
|
89 |
// "_Malformed_URL", JOptionPane.OK_OPTION |
|
90 |
// + JOptionPane.WARNING_MESSAGE); |
|
91 |
// throw new NotContinueWizardException("", null, false); |
|
92 |
// } |
|
93 |
// installerInfo.setOwner(getOwner()); |
|
94 |
// installerInfo.setDependencies(getDependencies()); |
|
95 |
} |
|
67 |
public void nextPanel() throws NotContinueWizardException { |
|
68 |
if (!this.validatePanel()) { |
|
69 |
throw new NotContinueWizardException("", null, false); |
|
70 |
} |
|
71 |
PackageInfo installerInfo = installerCreationWizard |
|
72 |
.getSelectedPackageInfo(); |
|
73 |
this.panelToPackageInfo(installerInfo); |
|
74 |
// installerInfo.setCode(getCode()); |
|
75 |
// installerInfo.setName(getName()); |
|
76 |
// installerInfo.setDescription(getDescription()); |
|
77 |
// installerInfo.setVersion(getVersion()); |
|
78 |
// installerInfo.setBuild(getBuild()); |
|
79 |
// installerInfo.setState(getState()); |
|
80 |
// installerInfo.setOfficial(isOfficial()); |
|
81 |
// installerInfo.setOperatingSystem(getOperatingSystem()); |
|
82 |
// installerInfo.setArchitecture(getArchitecture()); |
|
83 |
// installerInfo.setJavaVM(getJavaVM()); |
|
84 |
// installerInfo.setGvSIGVersion(getGvSIGVersion()); |
|
85 |
// try { |
|
86 |
// installerInfo.setSourcesURL(getSources()); |
|
87 |
// } catch (MalformedURLException e) { |
|
88 |
// JOptionPane.showMessageDialog(null, |
|
89 |
// "_the_package_source_files_url_is_malformed._Please_review_it.", |
|
90 |
// "_Malformed_URL", JOptionPane.OK_OPTION |
|
91 |
// + JOptionPane.WARNING_MESSAGE); |
|
92 |
// throw new NotContinueWizardException("", null, false); |
|
93 |
// } |
|
94 |
// installerInfo.setOwner(getOwner()); |
|
95 |
// installerInfo.setDependencies(getDependencies()); |
|
96 |
} |
|
96 | 97 |
|
97 |
public void updatePanel() {
|
|
98 |
PackageInfo installerInfo =
|
|
99 |
installerCreationWizard.getSelectedPackageInfo();
|
|
100 |
this.packageInfoToPanel(installerInfo);
|
|
101 |
// setCode(installerInfo.getCode());
|
|
102 |
// setName(installerInfo.getName());
|
|
103 |
// setVersion(installerInfo.getVersion().toString());
|
|
104 |
// setBuildText(installerInfo.getBuild());
|
|
105 |
// setOfficial(installerInfo.isOfficial());
|
|
106 |
// setState(installerInfo.getState());
|
|
107 |
// setDescription(installerInfo.getDescription());
|
|
108 |
// setOperatingSystem(installerInfo.getOperatingSystem());
|
|
109 |
// setArchitecture(installerInfo.getArchitecture());
|
|
110 |
// setJavaVM(installerInfo.getJavaVM());
|
|
111 |
// String version = installerInfo.getGvSIGVersion();
|
|
112 |
// if ((version == null) || version.equals("")) {
|
|
113 |
// setGvSIGVersion(findCurrentGvSIGVersion());
|
|
114 |
// } else {
|
|
115 |
// setGvSIGVersion(installerInfo.getGvSIGVersion());
|
|
116 |
// }
|
|
117 |
// if (installerInfo.getSourcesURL() == null) {
|
|
118 |
// setSources("");
|
|
119 |
// } else {
|
|
120 |
// setSources(installerInfo.getSourcesURL().toString());
|
|
121 |
// }
|
|
122 |
// if (installerInfo.getOwner() == null ) {
|
|
123 |
// setOwner("");
|
|
124 |
// } else {
|
|
125 |
// setOwner(installerInfo.getOwner());
|
|
126 |
// }
|
|
127 |
// if (installerInfo.getDependencies() == null ) {
|
|
128 |
// setDependencies("");
|
|
129 |
// } else {
|
|
130 |
// setDependencies(installerInfo.getDependencies().toString());
|
|
131 |
// }
|
|
98 |
public void updatePanel() {
|
|
99 |
PackageInfo installerInfo = installerCreationWizard
|
|
100 |
.getSelectedPackageInfo();
|
|
101 |
this.packageInfoToPanel(installerInfo);
|
|
102 |
// setCode(installerInfo.getCode());
|
|
103 |
// setName(installerInfo.getName());
|
|
104 |
// setVersion(installerInfo.getVersion().toString());
|
|
105 |
// setBuildText(installerInfo.getBuild());
|
|
106 |
// setOfficial(installerInfo.isOfficial());
|
|
107 |
// setState(installerInfo.getState());
|
|
108 |
// setDescription(installerInfo.getDescription());
|
|
109 |
// setOperatingSystem(installerInfo.getOperatingSystem());
|
|
110 |
// setArchitecture(installerInfo.getArchitecture());
|
|
111 |
// setJavaVM(installerInfo.getJavaVM());
|
|
112 |
// String version = installerInfo.getGvSIGVersion();
|
|
113 |
// if ((version == null) || version.equals("")) {
|
|
114 |
// setGvSIGVersion(findCurrentGvSIGVersion());
|
|
115 |
// } else {
|
|
116 |
// setGvSIGVersion(installerInfo.getGvSIGVersion());
|
|
117 |
// }
|
|
118 |
// if (installerInfo.getSourcesURL() == null) {
|
|
119 |
// setSources("");
|
|
120 |
// } else {
|
|
121 |
// setSources(installerInfo.getSourcesURL().toString());
|
|
122 |
// }
|
|
123 |
// if (installerInfo.getOwner() == null ) {
|
|
124 |
// setOwner("");
|
|
125 |
// } else {
|
|
126 |
// setOwner(installerInfo.getOwner());
|
|
127 |
// }
|
|
128 |
// if (installerInfo.getDependencies() == null ) {
|
|
129 |
// setDependencies("");
|
|
130 |
// } else {
|
|
131 |
// setDependencies(installerInfo.getDependencies().toString());
|
|
132 |
// }
|
|
132 | 133 |
|
133 |
}
|
|
134 |
}
|
|
134 | 135 |
|
135 | 136 |
} |
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/SelectPlugintoInstallWizard.java | ||
---|---|---|
38 | 38 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
39 | 39 |
*/ |
40 | 40 |
public class SelectPlugintoInstallWizard extends SelectPluginToInstallPanel |
41 |
implements OptionPanel {
|
|
41 |
implements OptionPanel {
|
|
42 | 42 |
|
43 |
private static final long serialVersionUID = 3735333214491700782L;
|
|
44 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
43 |
private static final long serialVersionUID = 3735333214491700782L;
|
|
44 |
private DefaultMakePluginPackageWizard installerCreationWizard;
|
|
45 | 45 |
|
46 |
public SelectPlugintoInstallWizard(
|
|
47 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
48 |
super();
|
|
49 |
this.installerCreationWizard = installerCreationWizard;
|
|
50 |
installerCreationWizard.setNextButtonEnabled(false);
|
|
51 |
installerCreationWizard.setBackButtonEnabled(false);
|
|
52 |
}
|
|
46 |
public SelectPlugintoInstallWizard(
|
|
47 |
DefaultMakePluginPackageWizard installerCreationWizard) {
|
|
48 |
super();
|
|
49 |
this.installerCreationWizard = installerCreationWizard;
|
|
50 |
installerCreationWizard.setNextButtonEnabled(false);
|
|
51 |
installerCreationWizard.setBackButtonEnabled(false);
|
|
52 |
}
|
|
53 | 53 |
|
54 |
public JPanel getJPanel() {
|
|
55 |
return this;
|
|
56 |
}
|
|
54 |
public JPanel getJPanel() {
|
|
55 |
return this;
|
|
56 |
}
|
|
57 | 57 |
|
58 |
public String getPanelTitle() {
|
|
59 |
return swingInstallerManager.getText("plugin_to_install");
|
|
60 |
}
|
|
58 |
public String getPanelTitle() {
|
|
59 |
return swingInstallerManager.getText("plugin_to_install");
|
|
60 |
}
|
|
61 | 61 |
|
62 |
public void lastPanel() {
|
|
63 |
// TODO Auto-generated method stub
|
|
62 |
public void lastPanel() {
|
|
63 |
// TODO Auto-generated method stub
|
|
64 | 64 |
|
65 |
}
|
|
65 |
}
|
|
66 | 66 |
|
67 |
public void nextPanel() {
|
|
68 |
installerCreationWizard.setSelectedPackageInfo(super
|
|
69 |
.getSelectedInstallerInfo());
|
|
70 |
installerCreationWizard.setBackButtonEnabled(true);
|
|
71 |
}
|
|
67 |
public void nextPanel() {
|
|
68 |
installerCreationWizard.setSelectedPackageInfo(super
|
|
69 |
.getSelectedInstallerInfo());
|
|
70 |
installerCreationWizard.setBackButtonEnabled(true);
|
|
71 |
}
|
|
72 | 72 |
|
73 |
public void updatePanel() {
|
|
73 |
public void updatePanel() {
|
|
74 | 74 |
|
75 |
}
|
|
75 |
}
|
|
76 | 76 |
|
77 |
/*
|
|
78 |
* (non-Javadoc)
|
|
79 |
*
|
|
80 |
* @see
|
|
81 |
* org.gvsig.installer.swing.impl.creation.panel.SelectPluginToInstallPanel
|
|
82 |
* #setSelectedPlugin(java.lang.String)
|
|
83 |
*/
|
|
84 |
@Override
|
|
85 |
public void setSelectedInstallerInfo(PackageInfo installerInfo) {
|
|
86 |
super.setSelectedInstallerInfo(installerInfo);
|
|
87 |
installerInfo.setType("plugin");
|
|
88 |
installerCreationWizard.setNextButtonEnabled(installerInfo != null);
|
|
89 |
}
|
|
77 |
/*
|
|
78 |
* (non-Javadoc)
|
|
79 |
*
|
|
80 |
* @see
|
|
81 |
* org.gvsig.installer.swing.impl.creation.panel.SelectPluginToInstallPanel
|
|
82 |
* #setSelectedPlugin(java.lang.String)
|
|
83 |
*/
|
|
84 |
@Override
|
|
85 |
public void setSelectedInstallerInfo(PackageInfo installerInfo) {
|
|
86 |
super.setSelectedInstallerInfo(installerInfo);
|
|
87 |
installerInfo.setType("plugin");
|
|
88 |
installerCreationWizard.setNextButtonEnabled(installerInfo != null);
|
|
89 |
}
|
|
90 | 90 |
} |
Also available in: Unified diff