Revision 32286
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/resources/locale/text.properties | ||
---|---|---|
14 | 14 |
installer_progress=Progreso de instalaci?n |
15 | 15 |
installer_advanced_mode=El modo avanzado permite copiar recursos que est?n localizados fuera de el directorio de los plugins. No se recomienda usar esta opci?n. |
16 | 16 |
installer_initializing=Initializing |
17 |
installer_create_output_file_exception=Error creando el fichero de salida |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/resources/locale/text_en.properties | ||
---|---|---|
13 | 13 |
installer_output_options=Output options |
14 | 14 |
installer_progress=Install progress |
15 | 15 |
installer_advanced_mode=The advanced mode option allows to copy resources that are located out of the plugin directory. We don't recommend to use this option. |
16 |
installer_initializing=Inicializando |
|
16 |
installer_initializing=Inicializando |
|
17 |
installer_create_output_file_exception=Error creating the output file |
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/panel/SelectPluginToInstallPanel.java | ||
---|---|---|
48 | 48 |
private JList pluginList; |
49 | 49 |
private JScrollPane pluginScrollPane1; |
50 | 50 |
private String selectedPlugin = null; |
51 |
private File pluginsDirectory = null; |
|
51 | 52 |
|
52 | 53 |
public SelectPluginToInstallPanel() { |
53 | 54 |
super(); |
... | ... | |
59 | 60 |
{ |
60 | 61 |
pluginList.setModel(new PluginListModel(pluginsDirectory)); |
61 | 62 |
pluginList.setCellRenderer(new PluginListCellRenderer(this)); |
63 |
this.pluginsDirectory = pluginsDirectory; |
|
62 | 64 |
} |
63 | 65 |
|
64 | 66 |
private void initComponents() { |
... | ... | |
92 | 94 |
public void setSelectedPlugin(String selectedPlugin) { |
93 | 95 |
this.selectedPlugin = selectedPlugin; |
94 | 96 |
} |
97 |
|
|
98 |
/** |
|
99 |
* @return the path for the plugin to install |
|
100 |
*/ |
|
101 |
public File getSelectedPluginDirectory(){ |
|
102 |
return new File(pluginsDirectory.getAbsolutePath() + File.separator + selectedPlugin); |
|
103 |
} |
|
95 | 104 |
} |
96 | 105 |
|
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/panel/SelectOutputFilePanel.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
package org.gvsig.installer.swing.impl.creation.panel; |
29 | 29 |
|
30 |
import java.io.File; |
|
31 |
|
|
30 | 32 |
import javax.swing.JPanel; |
31 | 33 |
|
32 | 34 |
import org.gvsig.gui.beans.openfile.FileTextField; |
... | ... | |
47 | 49 |
swingInstallerManager = (DefaultSwingInstallerManager)SwingInstallerLocator.getSwingInstallerManager(); |
48 | 50 |
initComponents(); |
49 | 51 |
initLabels(); |
52 |
//REMOVE THIS |
|
53 |
fileTextField.setSelectedFile(new File("/tmp/plugins.zip")); |
|
50 | 54 |
} |
51 | 55 |
|
52 | 56 |
private void initLabels() { |
... | ... | |
75 | 79 |
|
76 | 80 |
add(northPanel, java.awt.BorderLayout.NORTH); |
77 | 81 |
} |
82 |
|
|
83 |
public File getSelectedFile(){ |
|
84 |
return fileTextField.getSelectedFile(); |
|
85 |
} |
|
78 | 86 |
} |
79 | 87 |
|
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/panel/ProgressPanel.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import javax.swing.JPanel; |
31 | 31 |
|
32 |
import org.gvsig.installer.lib.api.creation.InstallerCreationServiceException; |
|
32 | 33 |
import org.gvsig.installer.swing.api.SwingInstallerLocator; |
33 | 34 |
import org.gvsig.installer.swing.impl.DefaultSwingInstallerManager; |
34 | 35 |
|
... | ... | |
99 | 100 |
progressLabel.setText(swingInstallerManager.getText("finished")); |
100 | 101 |
} |
101 | 102 |
|
102 |
public void progress(int progress){
|
|
103 |
public void setProgress(int progress){
|
|
103 | 104 |
progressBar.setValue(progress); |
104 | 105 |
} |
106 |
|
|
107 |
public void setExceptionText(InstallerCreationServiceException e) { |
|
108 |
progressLabel.setText(swingInstallerManager.getText("installer_create_output_file_exception")); |
|
109 |
} |
|
105 | 110 |
} |
106 | 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/SelectPlugintoInstallWizard.java | ||
---|---|---|
72 | 72 |
try { |
73 | 73 |
InstallerCreationService installerCreationService = |
74 | 74 |
InstallerLocator.getInstallerManager().getInstallerCreationService(); |
75 |
installerCreationService.setPluginDirectory(new File(getSelectedPlugin()));
|
|
75 |
installerCreationService.setPluginDirectory(getSelectedPluginDirectory());
|
|
76 | 76 |
installerCreationWizard.setInstallerCreationService(installerCreationService); |
77 | 77 |
} catch (Exception e) { |
78 | 78 |
logger.error(swingInstallerManager.getText("installer_infofile_exception"), e); |
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 | ||
---|---|---|
27 | 27 |
|
28 | 28 |
package org.gvsig.installer.swing.impl.creation.wizard; |
29 | 29 |
|
30 |
import java.io.File; |
|
31 |
import java.io.FileNotFoundException; |
|
32 |
import java.io.FileOutputStream; |
|
33 |
|
|
34 |
import javax.swing.JOptionPane; |
|
30 | 35 |
import javax.swing.JPanel; |
31 | 36 |
|
37 |
import org.gvsig.installer.lib.api.InstallerInfo; |
|
32 | 38 |
import org.gvsig.installer.swing.impl.InstallerWizardPanel; |
33 | 39 |
import org.gvsig.installer.swing.impl.creation.DefaultInstallerCreationWizard; |
34 | 40 |
import org.gvsig.installer.swing.impl.creation.panel.SelectOutputFilePanel; |
41 |
import org.slf4j.Logger; |
|
42 |
import org.slf4j.LoggerFactory; |
|
35 | 43 |
|
36 | 44 |
/** |
37 | 45 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
38 | 46 |
*/ |
39 | 47 |
public class SelectOutputFileWizard extends SelectOutputFilePanel implements InstallerWizardPanel{ |
40 | 48 |
private DefaultInstallerCreationWizard installerCreationWizard; |
49 |
private static final Logger logger = LoggerFactory.getLogger(SelectOutputFileWizard.class); |
|
41 | 50 |
|
42 | 51 |
public SelectOutputFileWizard(DefaultInstallerCreationWizard installerCreationWizard) { |
43 | 52 |
super(); |
... | ... | |
53 | 62 |
} |
54 | 63 |
|
55 | 64 |
public void lastPanel() { |
56 |
// TODO Auto-generated method stub |
|
57 |
|
|
65 |
|
|
58 | 66 |
} |
59 | 67 |
|
60 | 68 |
public void nextPanel() { |
61 |
// TODO Auto-generated method stub |
|
62 |
|
|
69 |
try { |
|
70 |
installerCreationWizard.setOutputStream(new FileOutputStream(getSelectedFile())); |
|
71 |
} catch (FileNotFoundException e) { |
|
72 |
logger.error(swingInstallerManager.getText("installer_create_output_file_exception"), e); |
|
73 |
JOptionPane.showMessageDialog(installerCreationWizard, |
|
74 |
swingInstallerManager.getText("installer_create_output_file_exception")); |
|
75 |
} |
|
63 | 76 |
} |
64 | 77 |
|
65 | 78 |
public void updatePanel() { |
66 |
// TODO Auto-generated method stub |
|
67 | 79 |
|
80 |
|
|
68 | 81 |
} |
69 | 82 |
|
70 | 83 |
} |
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/PluginDescriptionWizard.java | ||
---|---|---|
59 | 59 |
} |
60 | 60 |
|
61 | 61 |
public void nextPanel() { |
62 |
// TODO Auto-generated method stub |
|
63 |
|
|
62 |
InstallerInfo installerInfo = |
|
63 |
installerCreationWizard.getInstallerCreationService().getInstallerInfo(); |
|
64 |
installerInfo.setCode(getCode()); |
|
65 |
installerInfo.setName(getName()); |
|
66 |
installerInfo.setDescription(getDescription()); |
|
67 |
installerInfo.setVersion(getVersion()); |
|
68 |
installerInfo.setBuild(getBuild()); |
|
69 |
installerInfo.setState(getState()); |
|
70 |
installerInfo.setOfficial(isOfficial()); |
|
64 | 71 |
} |
65 | 72 |
|
66 | 73 |
public void updatePanel() { |
67 |
InstallerInfo installerInfoResource =
|
|
74 |
InstallerInfo installerInfo = |
|
68 | 75 |
installerCreationWizard.getInstallerCreationService().getInstallerInfo(); |
69 |
setCode(installerInfoResource.getCode());
|
|
70 |
setName(installerInfoResource.getName());
|
|
71 |
setVersion(installerInfoResource.getVersion());
|
|
72 |
setBuildText(installerInfoResource.getBuild());
|
|
73 |
setOffcicial(installerInfoResource.isOfficial());
|
|
74 |
setState(installerInfoResource.getState());
|
|
75 |
setDescription(installerInfoResource.getDescription());
|
|
76 |
setCode(installerInfo.getCode()); |
|
77 |
setName(installerInfo.getName()); |
|
78 |
setVersion(installerInfo.getVersion()); |
|
79 |
setBuildText(installerInfo.getBuild()); |
|
80 |
setOffcicial(installerInfo.isOfficial()); |
|
81 |
setState(installerInfo.getState()); |
|
82 |
setDescription(installerInfo.getDescription()); |
|
76 | 83 |
} |
77 |
|
|
78 | 84 |
} |
79 | 85 |
|
80 | 86 |
|
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 | ||
---|---|---|
27 | 27 |
|
28 | 28 |
package org.gvsig.installer.swing.impl.creation.wizard; |
29 | 29 |
|
30 |
import java.io.OutputStream; |
|
31 |
|
|
30 | 32 |
import javax.swing.JPanel; |
31 | 33 |
|
34 |
import org.gvsig.installer.lib.api.creation.InstallerCreationService; |
|
35 |
import org.gvsig.installer.lib.api.creation.InstallerCreationServiceException; |
|
32 | 36 |
import org.gvsig.installer.swing.impl.InstallerWizardPanel; |
33 | 37 |
import org.gvsig.installer.swing.impl.creation.DefaultInstallerCreationWizard; |
34 | 38 |
import org.gvsig.installer.swing.impl.creation.panel.ProgressPanel; |
39 |
import org.slf4j.Logger; |
|
40 |
import org.slf4j.LoggerFactory; |
|
35 | 41 |
|
36 | 42 |
/** |
37 | 43 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
38 | 44 |
*/ |
39 | 45 |
public class ProgressWizard extends ProgressPanel implements InstallerWizardPanel{ |
40 | 46 |
private DefaultInstallerCreationWizard installerCreationWizard; |
47 |
private static final Logger logger = LoggerFactory.getLogger(ProgressWizard.class); |
|
41 | 48 |
|
42 | 49 |
public ProgressWizard(DefaultInstallerCreationWizard installerCreationWizard) { |
43 | 50 |
super(); |
... | ... | |
63 | 70 |
} |
64 | 71 |
|
65 | 72 |
public void updatePanel() { |
66 |
setPluginText(installerCreationWizard.getInstallerCreationService().getInstallerInfo().getName());
|
|
67 |
//Write the InfoResource file
|
|
73 |
InstallerCreationService installerCreationService =
|
|
74 |
installerCreationWizard.getInstallerCreationService();
|
|
68 | 75 |
|
69 |
//Compress the plugin |
|
70 |
setCompressingText(); |
|
76 |
setPluginText(installerCreationService.getInstallerInfo().getName()); |
|
71 | 77 |
|
72 |
|
|
73 |
//Set the finished text |
|
74 |
setFinishedText(); |
|
75 |
|
|
78 |
try { |
|
79 |
//Compress the plugin |
|
80 |
setCompressingText(); |
|
81 |
installerCreationService.createInstaller(installerCreationWizard.getOutputStream()); |
|
82 |
setProgress(100); |
|
83 |
|
|
84 |
//Set the finished text |
|
85 |
setFinishedText(); |
|
86 |
} catch (InstallerCreationServiceException e) { |
|
87 |
logger.error(swingInstallerManager.getText("installer_create_output_file_exception"), e); |
|
88 |
setExceptionText(e); |
|
89 |
} |
|
76 | 90 |
} |
77 | 91 |
|
92 |
|
|
78 | 93 |
} |
79 | 94 |
|
80 | 95 |
|
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/DefaultInstallerCreationWizard.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import java.awt.BorderLayout; |
31 | 31 |
import java.io.File; |
32 |
import java.io.OutputStream; |
|
32 | 33 |
|
33 | 34 |
import javax.swing.ImageIcon; |
34 | 35 |
|
... | ... | |
53 | 54 |
public class DefaultInstallerCreationWizard extends InstallerCreationWizard{ |
54 | 55 |
private WizardPanelWithLogo wizardPanelWithLogo = null; |
55 | 56 |
private InstallerCreationService installercreationService = null; |
57 |
private OutputStream outputStream = null; |
|
56 | 58 |
|
57 | 59 |
//Wizards |
58 | 60 |
private AdvancedModeSelectionWizard advancedModeSelectionWizard = null; |
... | ... | |
154 | 156 |
InstallerCreationService installercreationService) { |
155 | 157 |
this.installercreationService = installercreationService; |
156 | 158 |
} |
159 |
|
|
160 |
/** |
|
161 |
* @return the outputStream |
|
162 |
*/ |
|
163 |
public OutputStream getOutputStream() { |
|
164 |
return outputStream; |
|
165 |
} |
|
166 |
|
|
167 |
/** |
|
168 |
* @param outputStream the outputStream to set |
|
169 |
*/ |
|
170 |
public void setOutputStream(OutputStream outputStream) { |
|
171 |
this.outputStream = outputStream; |
|
172 |
} |
|
157 | 173 |
} |
158 | 174 |
|
Also available in: Unified diff