svn-gvsig-desktop / 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 @ 40581
History | View | Annotate | Download (6.27 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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.
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
/*
|
25 |
* AUTHORS (In addition to CIT):
|
26 |
* 2010 {Prodevelop} {Task}
|
27 |
*/
|
28 |
|
29 |
package org.gvsig.installer.swing.api; |
30 |
|
31 |
import java.io.File; |
32 |
import java.net.MalformedURLException; |
33 |
import java.net.URL; |
34 |
import java.util.List; |
35 |
|
36 |
import javax.swing.JPanel; |
37 |
|
38 |
import org.gvsig.installer.lib.api.InstallerManager; |
39 |
import org.gvsig.installer.lib.api.PackageInfo; |
40 |
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizard; |
41 |
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizardException; |
42 |
import org.gvsig.installer.swing.api.creation.JOutputPanel; |
43 |
import org.gvsig.installer.swing.api.creation.JPackageInfoPanel; |
44 |
import org.gvsig.installer.swing.api.execution.AbstractInstallPackageWizard; |
45 |
import org.gvsig.installer.swing.api.execution.InstallPackageWizardException; |
46 |
import org.gvsig.installer.swing.api.execution.JShowPackageStatusAndAskContinuePanel; |
47 |
|
48 |
/**
|
49 |
*
|
50 |
* <p>
|
51 |
* This manager is used to register and create the wizards that are used to
|
52 |
* create and execute an installer. These wizards are classes that inherit of
|
53 |
* {@link JPanel}.
|
54 |
* </p>
|
55 |
*
|
56 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a>
|
57 |
*/
|
58 |
public interface SwingInstallerManager { |
59 |
|
60 |
|
61 |
public interface UrlAndLabel { |
62 |
/**
|
63 |
* Return the url.
|
64 |
*
|
65 |
* @return the url
|
66 |
*/
|
67 |
public URL getURL(); |
68 |
|
69 |
/**
|
70 |
* Return the url associated to the url or null
|
71 |
* if the url don't have a label.
|
72 |
*
|
73 |
* @return the label or null
|
74 |
*/
|
75 |
public String getLabel(); |
76 |
|
77 |
/**
|
78 |
* Return a string with the label and the url like:
|
79 |
* "label - http://..."
|
80 |
*
|
81 |
* @return the label and url
|
82 |
*/
|
83 |
public String toString(); // Return "label - url" |
84 |
} |
85 |
|
86 |
/**
|
87 |
* Registers a class that implements a wizard to create an installer of a
|
88 |
* plugin from a gvSIG installation directory.
|
89 |
*
|
90 |
* @param clazz
|
91 |
* Class that inherits of the {@link MakePluginPackageWizard}
|
92 |
* abstract class.
|
93 |
*/
|
94 |
public void registerMakePluginPackageWizardInstallerCreationWizard( |
95 |
Class<? extends MakePluginPackageWizard> clazz); |
96 |
|
97 |
/**
|
98 |
* This method returns a class that is used to create an installer from a
|
99 |
* gvSIG installation directory.
|
100 |
*
|
101 |
* @return The wizard to create an installer.
|
102 |
* @throws MakePluginPackageWizardException
|
103 |
* If there is a problem creating the wizard.
|
104 |
*/
|
105 |
public MakePluginPackageWizard createMakePluginPackageWizard(
|
106 |
File applicationDirectory, File installFolder) |
107 |
throws MakePluginPackageWizardException;
|
108 |
|
109 |
/**
|
110 |
* Registers a class that implements a wizard to execte an installer to
|
111 |
* install a set of plugins in a gvSIG installation directory.
|
112 |
*
|
113 |
* @param clazz
|
114 |
* Class that inherits of the
|
115 |
* {@link AbstractInstallPackageWizard} abstract class.
|
116 |
*/
|
117 |
public void registerInstallPackageWizard( |
118 |
Class<? extends AbstractInstallPackageWizard> clazz); |
119 |
|
120 |
/**
|
121 |
* This method returns a class that is used to execute an installer to
|
122 |
* install a set of plugins in a gvSIG installation directory.
|
123 |
*
|
124 |
* @return The wizard to execute an installer.
|
125 |
* @throws InstallPackageWizardException
|
126 |
* If there is a problem creating the wizard.
|
127 |
*/
|
128 |
public AbstractInstallPackageWizard createInstallPackageWizard(
|
129 |
File applicationDirectory, File installFolder) |
130 |
throws InstallPackageWizardException;
|
131 |
|
132 |
/**
|
133 |
* Returns the current application version.
|
134 |
*
|
135 |
* @return the current application version
|
136 |
*/
|
137 |
public String getApplicationVersion(); |
138 |
|
139 |
/**
|
140 |
* Sets the current application version.
|
141 |
*
|
142 |
* @param gvSIGVersion
|
143 |
* the current application version
|
144 |
*/
|
145 |
public void setApplicationVersion(String gvSIGVersion); |
146 |
|
147 |
/**
|
148 |
* Returns the default URL to download packages from.
|
149 |
*
|
150 |
* @return the default URL to download packages from
|
151 |
*/
|
152 |
public URL getDefaultDownloadURL(); |
153 |
|
154 |
/**
|
155 |
* Sets the default URL to download packages from
|
156 |
*
|
157 |
* @param defaultDownloadURL
|
158 |
* the default URL to download packages from
|
159 |
*/
|
160 |
public void setDefaultDownloadURL(URL defaultDownloadURL); |
161 |
|
162 |
/**
|
163 |
* Translate a key in a text using the current application language
|
164 |
*
|
165 |
* @param key
|
166 |
* The key to translate
|
167 |
* @return The translated key
|
168 |
*/
|
169 |
public String getText(String key); |
170 |
|
171 |
/**
|
172 |
* Returns a reference to the {@link InstallerManager}.
|
173 |
*
|
174 |
* @return a reference to the {@link InstallerManager}
|
175 |
*/
|
176 |
public InstallerManager getInstallerManager();
|
177 |
|
178 |
public JShowPackageStatusAndAskContinuePanel createJShowPackageStatusAndAskContinuePanel(
|
179 |
List<PackageInfo> packages, String message); |
180 |
|
181 |
public JPackageInfoPanel createPackageInfoPanel();
|
182 |
|
183 |
public JOutputPanel createOutputPanel();
|
184 |
|
185 |
public JProgressPanel createProgressPanel();
|
186 |
|
187 |
public void setDefaultDownloadURL(String defaultDownloadURLs); |
188 |
|
189 |
public void setDefaultDownloadURL(File defaultDownloadURLs); |
190 |
|
191 |
public void addDefaultDownloadURL(URL url); |
192 |
|
193 |
public void addDefaultDownloadURL(URL url, String label); |
194 |
|
195 |
public void addDefaultDownloadURL(String url) throws MalformedURLException; |
196 |
|
197 |
/**
|
198 |
* Return the list of default URL used to retrieve the package.gvspki
|
199 |
*
|
200 |
* @return list of defaults urls
|
201 |
* @deprecated use getDefaultDownloadUrlAndLabels
|
202 |
*/
|
203 |
public List<URL> getDefaultDownloadURLs(); |
204 |
|
205 |
/**
|
206 |
* Return the list of default URL used to retrieve the package.gvspki
|
207 |
* the list contains the URLs and their labels.
|
208 |
*
|
209 |
* @return list of default urls and their labels
|
210 |
*/
|
211 |
public List<UrlAndLabel> getDefaultDownloadUrlAndLabels(); |
212 |
} |