Statistics
| Revision:

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 @ 42534

History | View | Annotate | Download (6.74 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.JOutputPanel;
41
import org.gvsig.installer.swing.api.creation.JPackageInfoPanel;
42
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizard;
43
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizardException;
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
import org.gvsig.installer.swing.api.execution.JShowPackagesAndAskContinuePanel;
48
import org.gvsig.installer.swing.api.packagebuilder.PackageBuildder;
49
/**
50
 * 
51
 * <p>
52
 * This manager is used to register and create the wizards that are used to
53
 * create and execute an installer. These wizards are classes that inherit of
54
 * {@link JPanel}.
55
 * </p>
56
 * 
57
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
58
 */
59
public interface SwingInstallerManager {
60

    
61

    
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);
97

    
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;
109

    
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);
120

    
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;
132

    
133
        /**
134
         * Returns the current application version.
135
         * 
136
         * @return the current application version
137
         */
138
        public String getApplicationVersion();
139

    
140
        /**
141
         * Sets the current application version.
142
         * 
143
         * @param gvSIGVersion
144
         *            the current application version
145
         */
146
        public void setApplicationVersion(String gvSIGVersion);
147

    
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();
154

    
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);
162

    
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);
171

    
172
        /**
173
         * Returns a reference to the {@link InstallerManager}.
174
         * 
175
         * @return a reference to the {@link InstallerManager}
176
         */
177
        public InstallerManager getInstallerManager();
178

    
179
        public JShowPackageStatusAndAskContinuePanel createJShowPackageStatusAndAskContinuePanel(
180
                        List<PackageInfo> packages, String message);
181

    
182
        public JShowPackagesAndAskContinuePanel createJShowTroubledPackagesAndAskContinuePanel(
183
                        List<PackageInfo> packages, String message);
184
        
185
        public JPackageInfoPanel createPackageInfoPanel();
186

    
187
        public JPackageInfoPanel createPackageInfoPanel(String packageType);
188

    
189
        public JOutputPanel createOutputPanel();
190

    
191
        public JProgressPanel createProgressPanel();
192

    
193
        public void setDefaultDownloadURL(String defaultDownloadURLs);
194

    
195
        public void setDefaultDownloadURL(File defaultDownloadURLs);
196

    
197
        public void addDefaultDownloadURL(URL url);
198

    
199
        public void addDefaultDownloadURL(URL url, String label);
200
        
201
        public void addDefaultDownloadURL(String url) throws MalformedURLException;
202

    
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);
220

    
221
}