Statistics
| Revision:

svn-gvsig-desktop / tags / v2_0_0_Build_2031 / extensions / org.gvsig.installer / org.gvsig.installer.swing / org.gvsig.installer.swing.api / src / main / java / org / gvsig / installer / swing / api / SwingInstallerManager.java @ 36096

History | View | Annotate | Download (5.04 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2010 {Prodevelop}   {Task}
26
 */
27

    
28
package org.gvsig.installer.swing.api;
29

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

    
34
import javax.swing.JPanel;
35

    
36
import org.gvsig.installer.lib.api.InstallerManager;
37
import org.gvsig.installer.lib.api.PackageInfo;
38
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizard;
39
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizardException;
40
import org.gvsig.installer.swing.api.execution.AbstractInstallPackageWizard;
41
import org.gvsig.installer.swing.api.execution.InstallPackageWizardException;
42
import org.gvsig.installer.swing.api.execution.JShowPackageStatusAndAskContinuePanel;
43

    
44
/**
45
 * 
46
 * <p>
47
 * This manager is used to register and create the wizards that are used to
48
 * create and execute an installer. These wizards are classes that inherit of
49
 * {@link JPanel}.
50
 * </p>
51
 * 
52
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
53
 */
54
public interface SwingInstallerManager {
55

    
56
    /**
57
     * Registers a class that implements a wizard to create an installer
58
     * of a plugin from a gvSIG installation directory.
59
     * 
60
     * @param clazz
61
     *            Class that inherits of the {@link MakePluginPackageWizard}
62
     *            abstract class.
63
     */
64
    public void registerMakePluginPackageWizardInstallerCreationWizard(
65
        Class<? extends MakePluginPackageWizard> clazz);
66

    
67
    /**
68
     * This method returns a class that is used to create an
69
     * installer from a gvSIG installation directory.
70
     * 
71
     * @return
72
     *         The wizard to create an installer.
73
     * @throws MakePluginPackageWizardException
74
     *             If there is a problem creating the wizard.
75
     */
76
    public MakePluginPackageWizard createMakePluginPackageWizard(
77
        File applicationDirectory, File pluginsFolder, File installFolder)
78
        throws MakePluginPackageWizardException;
79

    
80
    /**
81
     * Registers a class that implements a wizard to execte an installer
82
     * to install a set of plugins in a gvSIG installation directory.
83
     * 
84
     * @param clazz
85
     *            Class that inherits of the {@link AbstractInstallPackageWizard}
86
     *            abstract class.
87
     */
88
    public void registerInstallPackageWizard(
89
        Class<? extends AbstractInstallPackageWizard> clazz);
90

    
91
    /**
92
     * This method returns a class that is used to execute an
93
     * installer to install a set of plugins in a gvSIG installation directory.
94
     * 
95
     * @return
96
     *         The wizard to execute an installer.
97
     * @throws InstallPackageWizardException
98
     *             If there is a problem creating the wizard.
99
     */
100
    public AbstractInstallPackageWizard createInstallPackageWizard(
101
        File applicationDirectory, File pluginsFolder, File installFolder)
102
        throws InstallPackageWizardException;
103

    
104
    /**
105
     * Returns the current application version.
106
     * 
107
     * @return the current application version
108
     */
109
    public String getApplicationVersion();
110

    
111
    /**
112
     * Sets the current application version.
113
     * 
114
     * @param gvSIGVersion
115
     *            the current application version
116
     */
117
    public void setApplicationVersion(String gvSIGVersion);
118

    
119
    /**
120
     * Returns the default URL to download packages from.
121
     * 
122
     * @return the default URL to download packages from
123
     */
124
    public URL getDefaultDownloadURL();
125

    
126
    /**
127
     * Sets the default URL to download packages from
128
     * 
129
     * @param defaultDownloadURL
130
     *            the default URL to download packages from
131
     */
132
    public void setDefaultDownloadURL(URL defaultDownloadURL);
133

    
134
    /**
135
     * Translate a key in a text using the current application language
136
     * 
137
     * @param key
138
     *            The key to translate
139
     * @return
140
     *         The translated key
141
     */
142
    public String getText(String key);
143

    
144
    /**
145
     * Returns a reference to the {@link InstallerManager}.
146
     * 
147
     * @return a reference to the {@link InstallerManager}
148
     */
149
    public InstallerManager getInstallerManager();
150

    
151
    public JShowPackageStatusAndAskContinuePanel createJShowPackageStatusAndAskContinuePanel(List<PackageInfo> packages, String message);
152
}