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

History | View | Annotate | Download (7.75 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 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
 *
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
 *
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.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2010 {Prodevelop}   {Task}
26
 */
27
package org.gvsig.installer.swing.api;
28

    
29
import java.io.File;
30
import java.net.MalformedURLException;
31
import java.net.URL;
32
import java.util.List;
33

    
34
import javax.swing.JPanel;
35
import org.gvsig.installer.lib.api.Dependencies;
36

    
37
import org.gvsig.installer.lib.api.InstallerManager;
38
import org.gvsig.installer.lib.api.PackageInfo;
39
import org.gvsig.installer.swing.api.creation.JOutputPanel;
40
import org.gvsig.installer.swing.api.creation.JPackageInfoPanel;
41
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizard;
42
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizardException;
43
import org.gvsig.installer.swing.api.execution.InstallPackageWizardException;
44
import org.gvsig.installer.swing.api.execution.InstallWizardPanel;
45
import org.gvsig.installer.swing.api.execution.JShowPackageStatusAndAskContinuePanel;
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;
50
import org.gvsig.installer.swing.api.packagebuilder.PackageBuildder;
51
import org.gvsig.installer.swing.api.wizard.InstallerWizardPanel;
52

    
53
/**
54
 *
55
 * <p>
56
 * This manager is used to register and create the wizards that are used to
57
 * create and execute an installer. These wizards are classes that inherit of
58
 * {@link JPanel}.
59
 * </p>
60
 *
61
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
62
 */
63
public interface SwingInstallerManager {
64

    
65
    public interface UrlAndLabel {
66

    
67
        /**
68
         * Return the url.
69
         *
70
         * @return the url
71
         */
72
        public URL getURL();
73

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

    
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
    }
89

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

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

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

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

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

    
141
    /**
142
     * Sets the current application version.
143
     *
144
     * @param gvSIGVersion 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 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 The key to translate
166
     * @return The translated key
167
     */
168
    public String getText(String key);
169

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

    
177
    public JShowPackageStatusAndAskContinuePanel createJShowPackageStatusAndAskContinuePanel(
178
            List<PackageInfo> packages, String message);
179

    
180
    public JShowPackagesAndAskContinuePanel createJShowTroubledPackagesAndAskContinuePanel(
181
            List<PackageInfo> packages, String message);
182

    
183
    public JShowRequiredPackagesAndAskContinuePanel createJShowRequiredPackagesAndAskContinuePanel(
184
            List<PackageInfo> packages, String message);
185

    
186
    public JShowUnresolvedDependenciesAndAskContinuePanel createJShowUnresolvedDependenciesAndAskContinuePanel(
187
            Dependencies dependencies, String message);
188

    
189
    public JPackageInfoPanel createPackageInfoPanel();
190

    
191
    public JPackageInfoPanel createPackageInfoPanel(String packageType);
192

    
193
    public JOutputPanel createOutputPanel();
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) ;
226
}