Revision 43126 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/SwingInstallerManager.java
SwingInstallerManager.java | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* Copyright (C) 2007-2013 gvSIG Association. |
5 | 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.
|
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
|
9 |
* version. |
|
10 | 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.
|
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
14 |
* details. |
|
15 | 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. |
|
16 |
* You should have received a copy of the GNU General Public License along with |
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51 |
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
20 | 19 |
* |
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
|
21 |
* gvsig.com, or visit our website www.gvsig.com. |
|
23 | 22 |
*/ |
24 | 23 |
/* |
25 | 24 |
* AUTHORS (In addition to CIT): |
26 | 25 |
* 2010 {Prodevelop} {Task} |
27 | 26 |
*/ |
28 |
|
|
29 | 27 |
package org.gvsig.installer.swing.api; |
30 | 28 |
|
31 | 29 |
import java.io.File; |
... | ... | |
34 | 32 |
import java.util.List; |
35 | 33 |
|
36 | 34 |
import javax.swing.JPanel; |
35 |
import org.gvsig.installer.lib.api.Dependencies; |
|
37 | 36 |
|
38 | 37 |
import org.gvsig.installer.lib.api.InstallerManager; |
39 | 38 |
import org.gvsig.installer.lib.api.PackageInfo; |
... | ... | |
41 | 40 |
import org.gvsig.installer.swing.api.creation.JPackageInfoPanel; |
42 | 41 |
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizard; |
43 | 42 |
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizardException; |
44 |
import org.gvsig.installer.swing.api.execution.AbstractInstallPackageWizard; |
|
45 | 43 |
import org.gvsig.installer.swing.api.execution.InstallPackageWizardException; |
44 |
import org.gvsig.installer.swing.api.execution.InstallWizardPanel; |
|
46 | 45 |
import org.gvsig.installer.swing.api.execution.JShowPackageStatusAndAskContinuePanel; |
47 | 46 |
import org.gvsig.installer.swing.api.execution.JShowPackagesAndAskContinuePanel; |
47 |
import org.gvsig.installer.swing.api.execution.JShowRequiredPackagesAndAskContinuePanel; |
|
48 |
import org.gvsig.installer.swing.api.execution.JShowUnresolvedDependenciesAndAskContinuePanel; |
|
49 |
import org.gvsig.installer.swing.api.execution.PackageFilter; |
|
48 | 50 |
import org.gvsig.installer.swing.api.packagebuilder.PackageBuildder; |
51 |
import org.gvsig.installer.swing.api.wizard.InstallerWizardPanel; |
|
52 |
|
|
49 | 53 |
/** |
50 |
*
|
|
54 |
* |
|
51 | 55 |
* <p> |
52 | 56 |
* This manager is used to register and create the wizards that are used to |
53 | 57 |
* create and execute an installer. These wizards are classes that inherit of |
54 | 58 |
* {@link JPanel}. |
55 | 59 |
* </p> |
56 |
*
|
|
60 |
* |
|
57 | 61 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
58 | 62 |
*/ |
59 | 63 |
public interface SwingInstallerManager { |
60 | 64 |
|
65 |
public interface UrlAndLabel { |
|
61 | 66 |
|
62 |
public interface UrlAndLabel { |
|
63 |
/** |
|
64 |
* Return the url. |
|
65 |
* |
|
66 |
* @return the url |
|
67 |
*/ |
|
68 |
public URL getURL(); |
|
69 |
|
|
70 |
/** |
|
71 |
* Return the url associated to the url or null |
|
72 |
* if the url don't have a label. |
|
73 |
* |
|
74 |
* @return the label or null |
|
75 |
*/ |
|
76 |
public String getLabel(); |
|
77 |
|
|
78 |
/** |
|
79 |
* Return a string with the label and the url like: |
|
80 |
* "label - http://..." |
|
81 |
* |
|
82 |
* @return the label and url |
|
83 |
*/ |
|
84 |
public String toString(); // Return "label - url" |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* Registers a class that implements a wizard to create an installer of a |
|
89 |
* plugin from a gvSIG installation directory. |
|
90 |
* |
|
91 |
* @param clazz |
|
92 |
* Class that inherits of the {@link MakePluginPackageWizard} |
|
93 |
* abstract class. |
|
94 |
*/ |
|
95 |
public void registerMakePluginPackageWizardInstallerCreationWizard( |
|
96 |
Class<? extends MakePluginPackageWizard> clazz); |
|
67 |
/** |
|
68 |
* Return the url. |
|
69 |
* |
|
70 |
* @return the url |
|
71 |
*/ |
|
72 |
public URL getURL(); |
|
97 | 73 |
|
98 |
/** |
|
99 |
* This method returns a class that is used to create an installer from a |
|
100 |
* gvSIG installation directory. |
|
101 |
* |
|
102 |
* @return The wizard to create an installer. |
|
103 |
* @throws MakePluginPackageWizardException |
|
104 |
* If there is a problem creating the wizard. |
|
105 |
*/ |
|
106 |
public MakePluginPackageWizard createMakePluginPackageWizard( |
|
107 |
File applicationDirectory, File installFolder) |
|
108 |
throws MakePluginPackageWizardException; |
|
74 |
/** |
|
75 |
* Return the url associated to the url or null if the url don't have a |
|
76 |
* label. |
|
77 |
* |
|
78 |
* @return the label or null |
|
79 |
*/ |
|
80 |
public String getLabel(); |
|
109 | 81 |
|
110 |
/** |
|
111 |
* Registers a class that implements a wizard to execte an installer to |
|
112 |
* install a set of plugins in a gvSIG installation directory. |
|
113 |
* |
|
114 |
* @param clazz |
|
115 |
* Class that inherits of the |
|
116 |
* {@link AbstractInstallPackageWizard} abstract class. |
|
117 |
*/ |
|
118 |
public void registerInstallPackageWizard( |
|
119 |
Class<? extends AbstractInstallPackageWizard> clazz); |
|
82 |
/** |
|
83 |
* Return a string with the label and the url like: "label - http://..." |
|
84 |
* |
|
85 |
* @return the label and url |
|
86 |
*/ |
|
87 |
public String toString(); // Return "label - url" |
|
88 |
} |
|
120 | 89 |
|
121 |
/** |
|
122 |
* This method returns a class that is used to execute an installer to |
|
123 |
* install a set of plugins in a gvSIG installation directory. |
|
124 |
* |
|
125 |
* @return The wizard to execute an installer. |
|
126 |
* @throws InstallPackageWizardException |
|
127 |
* If there is a problem creating the wizard. |
|
128 |
*/ |
|
129 |
public AbstractInstallPackageWizard createInstallPackageWizard( |
|
130 |
File applicationDirectory, File installFolder) |
|
131 |
throws InstallPackageWizardException; |
|
90 |
/** |
|
91 |
* Registers a class that implements a wizard to create an installer of a |
|
92 |
* plugin from a gvSIG installation directory. |
|
93 |
* |
|
94 |
* @param clazz Class that inherits of the {@link MakePluginPackageWizard} |
|
95 |
* abstract class. |
|
96 |
*/ |
|
97 |
public void registerMakePluginPackageWizardInstallerCreationWizard( |
|
98 |
Class<? extends MakePluginPackageWizard> clazz); |
|
132 | 99 |
|
133 |
/** |
|
134 |
* Returns the current application version. |
|
135 |
* |
|
136 |
* @return the current application version |
|
137 |
*/ |
|
138 |
public String getApplicationVersion(); |
|
100 |
/** |
|
101 |
* This method returns a class that is used to create an installer from a |
|
102 |
* gvSIG installation directory. |
|
103 |
* |
|
104 |
* @return The wizard to create an installer. |
|
105 |
* @throws MakePluginPackageWizardException If there is a problem creating |
|
106 |
* the wizard. |
|
107 |
*/ |
|
108 |
public MakePluginPackageWizard createMakePluginPackageWizard( |
|
109 |
File applicationDirectory, File installFolder) |
|
110 |
throws MakePluginPackageWizardException; |
|
139 | 111 |
|
140 |
/** |
|
141 |
* Sets the current application version. |
|
142 |
* |
|
143 |
* @param gvSIGVersion |
|
144 |
* the current application version |
|
145 |
*/ |
|
146 |
public void setApplicationVersion(String gvSIGVersion); |
|
112 |
/** |
|
113 |
* Registers a class that implements a wizard to execte an installer to |
|
114 |
* install a set of plugins in a gvSIG installation directory. |
|
115 |
* |
|
116 |
* @param clazz Class that inherits of the |
|
117 |
* {@link AbstractInstallPackageWizard} abstract class. |
|
118 |
*/ |
|
119 |
public void registerInstallPackageWizard( |
|
120 |
Class<? extends InstallerWizardPanel> clazz); |
|
147 | 121 |
|
148 |
/** |
|
149 |
* Returns the default URL to download packages from. |
|
150 |
* |
|
151 |
* @return the default URL to download packages from |
|
152 |
*/ |
|
153 |
public URL getDefaultDownloadURL(); |
|
122 |
/** |
|
123 |
* This method returns a class that is used to execute an installer to |
|
124 |
* install a set of plugins in a gvSIG installation directory. |
|
125 |
* |
|
126 |
* @return The wizard to execute an installer. |
|
127 |
* @throws InstallPackageWizardException If there is a problem creating the |
|
128 |
* wizard. |
|
129 |
*/ |
|
130 |
public InstallWizardPanel createInstallPackageWizard( |
|
131 |
File applicationDirectory, File installFolder) |
|
132 |
throws InstallPackageWizardException; |
|
154 | 133 |
|
155 |
/** |
|
156 |
* Sets the default URL to download packages from |
|
157 |
* |
|
158 |
* @param defaultDownloadURL |
|
159 |
* the default URL to download packages from |
|
160 |
*/ |
|
161 |
public void setDefaultDownloadURL(URL defaultDownloadURL); |
|
134 |
/** |
|
135 |
* Returns the current application version. |
|
136 |
* |
|
137 |
* @return the current application version |
|
138 |
*/ |
|
139 |
public String getApplicationVersion(); |
|
162 | 140 |
|
163 |
/** |
|
164 |
* Translate a key in a text using the current application language |
|
165 |
* |
|
166 |
* @param key |
|
167 |
* The key to translate |
|
168 |
* @return The translated key |
|
169 |
*/ |
|
170 |
public String getText(String key); |
|
141 |
/** |
|
142 |
* Sets the current application version. |
|
143 |
* |
|
144 |
* @param gvSIGVersion the current application version |
|
145 |
*/ |
|
146 |
public void setApplicationVersion(String gvSIGVersion); |
|
171 | 147 |
|
172 |
/**
|
|
173 |
* Returns a reference to the {@link InstallerManager}.
|
|
174 |
*
|
|
175 |
* @return a reference to the {@link InstallerManager}
|
|
176 |
*/
|
|
177 |
public InstallerManager getInstallerManager();
|
|
148 |
/**
|
|
149 |
* Returns the default URL to download packages from.
|
|
150 |
*
|
|
151 |
* @return the default URL to download packages from
|
|
152 |
*/
|
|
153 |
public URL getDefaultDownloadURL();
|
|
178 | 154 |
|
179 |
public JShowPackageStatusAndAskContinuePanel createJShowPackageStatusAndAskContinuePanel( |
|
180 |
List<PackageInfo> packages, String message); |
|
155 |
/** |
|
156 |
* Sets the default URL to download packages from |
|
157 |
* |
|
158 |
* @param defaultDownloadURL the default URL to download packages from |
|
159 |
*/ |
|
160 |
public void setDefaultDownloadURL(URL defaultDownloadURL); |
|
181 | 161 |
|
182 |
public JShowPackagesAndAskContinuePanel createJShowTroubledPackagesAndAskContinuePanel( |
|
183 |
List<PackageInfo> packages, String message); |
|
184 |
|
|
185 |
public JPackageInfoPanel createPackageInfoPanel(); |
|
162 |
/** |
|
163 |
* Translate a key in a text using the current application language |
|
164 |
* |
|
165 |
* @param key The key to translate |
|
166 |
* @return The translated key |
|
167 |
*/ |
|
168 |
public String getText(String key); |
|
186 | 169 |
|
187 |
public JPackageInfoPanel createPackageInfoPanel(String packageType); |
|
170 |
/** |
|
171 |
* Returns a reference to the {@link InstallerManager}. |
|
172 |
* |
|
173 |
* @return a reference to the {@link InstallerManager} |
|
174 |
*/ |
|
175 |
public InstallerManager getInstallerManager(); |
|
188 | 176 |
|
189 |
public JOutputPanel createOutputPanel(); |
|
177 |
public JShowPackageStatusAndAskContinuePanel createJShowPackageStatusAndAskContinuePanel( |
|
178 |
List<PackageInfo> packages, String message); |
|
190 | 179 |
|
191 |
public JProgressPanel createProgressPanel(); |
|
180 |
public JShowPackagesAndAskContinuePanel createJShowTroubledPackagesAndAskContinuePanel( |
|
181 |
List<PackageInfo> packages, String message); |
|
192 | 182 |
|
193 |
public void setDefaultDownloadURL(String defaultDownloadURLs); |
|
183 |
public JShowRequiredPackagesAndAskContinuePanel createJShowRequiredPackagesAndAskContinuePanel( |
|
184 |
List<PackageInfo> packages, String message); |
|
194 | 185 |
|
195 |
public void setDefaultDownloadURL(File defaultDownloadURLs); |
|
186 |
public JShowUnresolvedDependenciesAndAskContinuePanel createJShowUnresolvedDependenciesAndAskContinuePanel( |
|
187 |
Dependencies dependencies, String message); |
|
196 | 188 |
|
197 |
public void addDefaultDownloadURL(URL url);
|
|
189 |
public JPackageInfoPanel createPackageInfoPanel();
|
|
198 | 190 |
|
199 |
public void addDefaultDownloadURL(URL url, String label); |
|
200 |
|
|
201 |
public void addDefaultDownloadURL(String url) throws MalformedURLException; |
|
191 |
public JPackageInfoPanel createPackageInfoPanel(String packageType); |
|
202 | 192 |
|
203 |
/** |
|
204 |
* Return the list of default URL used to retrieve the package.gvspki |
|
205 |
* |
|
206 |
* @return list of defaults urls |
|
207 |
* @deprecated use getDefaultDownloadUrlAndLabels |
|
208 |
*/ |
|
209 |
public List<URL> getDefaultDownloadURLs(); |
|
210 |
|
|
211 |
/** |
|
212 |
* Return the list of default URL used to retrieve the package.gvspki |
|
213 |
* the list contains the URLs and their labels. |
|
214 |
* |
|
215 |
* @return list of default urls and their labels |
|
216 |
*/ |
|
217 |
public List<UrlAndLabel> getDefaultDownloadUrlAndLabels(); |
|
218 |
|
|
219 |
public PackageBuildder createPackagerPanel(String packageType, File selectionFolder, File outputFolder); |
|
193 |
public JOutputPanel createOutputPanel(); |
|
220 | 194 |
|
195 |
public JProgressPanel createProgressPanel(); |
|
196 |
|
|
197 |
public void setDefaultDownloadURL(String defaultDownloadURLs); |
|
198 |
|
|
199 |
public void setDefaultDownloadURL(File defaultDownloadURLs); |
|
200 |
|
|
201 |
public void addDefaultDownloadURL(URL url); |
|
202 |
|
|
203 |
public void addDefaultDownloadURL(URL url, String label); |
|
204 |
|
|
205 |
public void addDefaultDownloadURL(String url) throws MalformedURLException; |
|
206 |
|
|
207 |
/** |
|
208 |
* Return the list of default URL used to retrieve the package.gvspki |
|
209 |
* |
|
210 |
* @return list of defaults urls |
|
211 |
* @deprecated use getDefaultDownloadUrlAndLabels |
|
212 |
*/ |
|
213 |
public List<URL> getDefaultDownloadURLs(); |
|
214 |
|
|
215 |
/** |
|
216 |
* Return the list of default URL used to retrieve the package.gvspki the |
|
217 |
* list contains the URLs and their labels. |
|
218 |
* |
|
219 |
* @return list of default urls and their labels |
|
220 |
*/ |
|
221 |
public List<UrlAndLabel> getDefaultDownloadUrlAndLabels(); |
|
222 |
|
|
223 |
public PackageBuildder createPackagerPanel(String packageType, File selectionFolder, File outputFolder); |
|
224 |
|
|
225 |
public PackageFilter createPackageTypeFilter(String type) ; |
|
221 | 226 |
} |
Also available in: Unified diff