Revision 39856

View differences:

tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/SwingInstallerLibrary.java
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 org.gvsig.installer.lib.api.InstallerLibrary;
31
import org.gvsig.tools.library.AbstractLibrary;
32
import org.gvsig.tools.library.LibraryException;
33

  
34
/**
35
 * Library for the swing installer.
36
 * 
37
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
38
 */
39
public class SwingInstallerLibrary extends AbstractLibrary {
40

  
41
	@Override
42
	public void doRegistration() {
43
		registerAsAPI(SwingInstallerLibrary.class);
44
		require(InstallerLibrary.class);
45
	}
46

  
47
	@Override
48
	protected void doInitialize() throws LibraryException {
49
		// TODO Auto-generated method stub
50

  
51
	}
52

  
53
	@Override
54
	protected void doPostInitialize() throws LibraryException {
55
		// TODO Auto-generated method stub
56

  
57
	}
58

  
59
}
0 60

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/JProgressPanel.java
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
package org.gvsig.installer.swing.api;
23

  
24
import javax.swing.JPanel;
25

  
26
import org.gvsig.tools.task.TaskStatus;
27

  
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 * 
32
 */
33
public abstract class JProgressPanel extends JPanel {
34

  
35
	public abstract void bind(TaskStatus taskStatus);
36

  
37
	public abstract void showErrorMessage(String msg, Exception ex);
38

  
39
}
0 40

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/SwingInstallerManager.java
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.MalformedURLException;
32
import java.net.URL;
33
import java.util.List;
34

  
35
import javax.swing.JPanel;
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.MakePluginPackageWizard;
40
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizardException;
41
import org.gvsig.installer.swing.api.creation.JOutputPanel;
42
import org.gvsig.installer.swing.api.creation.JPackageInfoPanel;
43
import org.gvsig.installer.swing.api.execution.AbstractInstallPackageWizard;
44
import org.gvsig.installer.swing.api.execution.InstallPackageWizardException;
45
import org.gvsig.installer.swing.api.execution.JShowPackageStatusAndAskContinuePanel;
46

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

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

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

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

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

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

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

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

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

  
135
	/**
136
	 * Translate a key in a text using the current application language
137
	 * 
138
	 * @param key
139
	 *            The key to translate
140
	 * @return 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(
152
			List<PackageInfo> packages, String message);
153

  
154
	public JPackageInfoPanel createPackageInfoPanel();
155

  
156
	public JOutputPanel createOutputPanel();
157

  
158
	public JProgressPanel createProgressPanel();
159

  
160
	public void setDefaultDownloadURL(String defaultDownloadURLs);
161

  
162
	public void setDefaultDownloadURL(File defaultDownloadURLs);
163

  
164
	public void addDefaultDownloadURL(URL url);
165

  
166
	public void addDefaultDownloadURL(String url) throws MalformedURLException;
167

  
168
	public List<URL> getDefaultDownloadURLs();
169
}
0 170

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/wizard/InstallerWizardPanel.java
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.wizard;
29

  
30
import java.util.List;
31

  
32
import org.gvsig.tools.task.CancellableTask;
33

  
34
/**
35
 * This interface must be implemented by all the wizards. It just have a methods
36
 * to manage the events that the wizard throws.
37
 * 
38
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
39
 */
40
public interface InstallerWizardPanel {
41

  
42
	/**
43
	 * @param wizardActionListener
44
	 *            sets the listener for the action events.
45
	 */
46
	public void setWizardActionListener(
47
			InstallerWizardActionListener wizardActionListener);
48

  
49
	/**
50
	 * @return the listener for the action events
51
	 */
52
	public InstallerWizardActionListener getWizardActionListener();
53

  
54
	public List<CancellableTask> getCancellableTasks();
55

  
56
	public void addCancellableTask(CancellableTask task);
57
	
58
	/**
59
	 * Tells whether this install wizard needs to restart
60
     * the app after install process has finished
61
     * 
62
	 * @return Whether this install wizard needs to restart
63
	 * the app after install process has finished
64
	 */
65
	public boolean needsToRestartApplicationAfterFinish();
66
}
0 67

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/wizard/AbstractInstallerWizard.java
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.wizard;
29

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

  
34
import javax.swing.JPanel;
35

  
36
import org.gvsig.tools.task.CancellableTask;
37

  
38
/**
39
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
40
 */
41
public abstract class AbstractInstallerWizard extends JPanel implements
42
		InstallerWizardPanel {
43

  
44
	private static final long serialVersionUID = 5609799260650093733L;
45
	protected InstallerWizardActionListener wizardActionListener = null;
46
	private final File applicationFolder;
47
	private final File installFolder;
48
	private List<CancellableTask> cancelableTasks;
49

  
50
	/**
51
	 * Constructor.
52
	 * 
53
	 * @param applicationFolder
54
	 *            the main root application folder
55
	 * @param installFolder
56
	 *            the default bundle files location folder
57
	 */
58
	public AbstractInstallerWizard(File applicationFolder, File installFolder) {
59
		super();
60
		this.applicationFolder = applicationFolder;
61
		this.installFolder = installFolder;
62
		this.cancelableTasks = new ArrayList<CancellableTask>();
63
	}
64

  
65
	public void addCancellableTask(CancellableTask task) {
66
		this.cancelableTasks.add(task);
67
	}
68

  
69
	public List<CancellableTask> getCancellableTasks() {
70
		return this.cancelableTasks;
71
	}
72

  
73
	public void setWizardActionListener(
74
			InstallerWizardActionListener wizardActionListener) {
75
		this.wizardActionListener = wizardActionListener;
76
	}
77

  
78
	public InstallerWizardActionListener getWizardActionListener() {
79
		return wizardActionListener;
80
	}
81

  
82
	public File getApplicationFolder() {
83
		return applicationFolder;
84
	}
85

  
86
	public File getInstallFolder() {
87
		return installFolder;
88
	}
89
	
90
	public boolean needsToRestartApplicationAfterFinish() {
91
	    // false by default
92
	    // to be overriden by subclasses
93
	    return false;
94
	}
95
}
0 96

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/wizard/InstallerWizardActionListener.java
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.wizard;
29

  
30
/**
31
 * <p>
32
 * Listener for the wizards used on the installation management. It controls the
33
 * events thrown by the wizard.
34
 * </p>
35
 * 
36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
37
 */
38
public interface InstallerWizardActionListener {
39

  
40
	public void finish(InstallerWizardPanel installerWizard);
41

  
42
	public void cancel(InstallerWizardPanel installerWizard);
43
}
0 44

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/execution/JShowUnresolvedDependenciesAndAskContinuePanel.java
1
package org.gvsig.installer.swing.api.execution;
2

  
3
import javax.swing.JPanel;
4

  
5
public abstract class JShowUnresolvedDependenciesAndAskContinuePanel extends
6
		JPanel {
7

  
8
	/**
9
	 * 
10
	 */
11
	private static final long serialVersionUID = -6257913354743524479L;
12

  
13
	public abstract boolean cancelled();
14

  
15
	public abstract boolean needShow();
16
}
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/execution/JShowPackageStatusAndAskContinuePanel.java
1
package org.gvsig.installer.swing.api.execution;
2

  
3
import javax.swing.JPanel;
4

  
5
public abstract class JShowPackageStatusAndAskContinuePanel extends JPanel {
6
	/**
7
	 * 
8
	 */
9
	private static final long serialVersionUID = 6598121113755711664L;
10

  
11
	public abstract boolean cancelled();
12

  
13
	public abstract boolean needShow();
14
}
0 15

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/execution/JShowRequiredPackagesAndAskContinuePanel.java
1
package org.gvsig.installer.swing.api.execution;
2

  
3
import javax.swing.JPanel;
4

  
5
public abstract class JShowRequiredPackagesAndAskContinuePanel extends JPanel {
6

  
7
	/**
8
	 * 
9
	 */
10
	private static final long serialVersionUID = -6257913354743524479L;
11

  
12
	public abstract boolean cancelled();
13

  
14
	public abstract boolean needShow();
15
}
0 16

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/execution/InstallPackageWizardException.java
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
 * 2009 {Iver T.I.}   {Task}
26
 */
27

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

  
30
import org.gvsig.tools.exception.BaseException;
31

  
32
/**
33
 * Base exception for all the exceptions that are thrown by the process of
34
 * execution of an installer using the wizard.
35
 * 
36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
37
 */
38
public class InstallPackageWizardException extends BaseException {
39

  
40
	private static final long serialVersionUID = -5480466569496849255L;
41
	private static final String KEY = "installer_execution_exception";
42

  
43
	/**
44
	 * @see BaseException#BaseException(String, Throwable, String, long)
45
	 */
46
	public InstallPackageWizardException(String message, Throwable cause) {
47
		super(message, cause, KEY, serialVersionUID);
48
	}
49
}
0 50

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/execution/AbstractInstallPackageWizard.java
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.execution;
29

  
30
import java.io.File;
31
import java.util.List;
32

  
33
import org.gvsig.installer.lib.api.PackageInfo;
34
import org.gvsig.installer.lib.api.execution.InstallPackageService;
35
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException;
36
import org.gvsig.installer.swing.api.wizard.AbstractInstallerWizard;
37

  
38
/**
39
 * <p>
40
 * Wizard that is used to open a bundle file to install one or more packages in
41
 * a valid gvSIG directory. This class receive a directory where gvSIG is
42
 * installed and it allows to select from the user interface the packages to
43
 * install.
44
 * </p>
45
 * <p>
46
 * All the classes that inherit if this abstract class have to have a
47
 * constructor with an argument of type {@link File}, that is the application
48
 * directory.
49
 * </p>
50
 * 
51
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
52
 */
53
public abstract class AbstractInstallPackageWizard extends
54
		AbstractInstallerWizard {
55

  
56
	private static final long serialVersionUID = -758246118332926598L;
57

  
58
	/**
59
	 * Constructor
60
	 * 
61
	 * @see AbstractInstallerWizard#AbstractInstallerWizard(File, File)
62
	 */
63
	public AbstractInstallPackageWizard(File applicationFolder,
64
			File installFolder) {
65
		super(applicationFolder, installFolder);
66
	}
67

  
68
	/**
69
	 * If this method is selected the first window of the wizard is not visible
70
	 * and the installation process takes the installers form the default
71
	 * directory.
72
	 * 
73
	 * @throws InstallPackageServiceException
74
	 *             if there an error reading the default directory.
75
	 */
76
	public abstract void installFromDefaultDirectory()
77
			throws InstallPackageServiceException;
78

  
79
	/**
80
	 * @return the installerExecutionService
81
	 */
82
	public abstract InstallPackageService getInstallerExecutionService();
83

  
84
	/**
85
	 * @return the installersToInstall
86
	 */
87
	public abstract List<PackageInfo> getInstallersToInstall();
88

  
89
	public abstract void setNextButtonEnabled(boolean isEnabled);
90

  
91
	public abstract void setFinishButtonVisible(boolean isVisible);
92

  
93
	public abstract void setCancelButtonEnabled(boolean isEnabled);
94

  
95
	public abstract void setBackButtonEnabled(boolean isEnabled);
96

  
97
	/**
98
	 * It will ask the user to select the installation mode to Typical or
99
	 * Advanced.
100
	 * 
101
	 * @param askIt
102
	 *            True or False if the option will be shown to the user or not.
103
	 */
104
	public abstract void setAskTypicalOrCustom(boolean askIt);
105

  
106
	/**
107
	 * To know if the question is set to be shown or not.
108
	 * 
109
	 * @return True if the question is set to be shown or false if not.
110
	 */
111
	public abstract boolean getAskTypicalOrCustom();
112

  
113
	public abstract void setSelectDefaultPackages(boolean isActivated);
114

  
115
	public abstract boolean getSelectDefaultPackages();
116
	
117
	   
118
	public boolean needsToRestartApplicationAfterFinish() {
119
	    // installers need to restart
120
	    return true;
121
	}
122

  
123
}
0 124

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/creation/MakePluginPackageWizardException.java
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
 * 2009 {Iver T.I.}   {Task}
26
 */
27

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

  
30
import org.gvsig.tools.exception.BaseException;
31

  
32
/**
33
 * Base exception for all the exceptions that are thrown by the process of
34
 * creation of an installer using the wizard.
35
 * 
36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
37
 */
38
public class MakePluginPackageWizardException extends BaseException {
39

  
40
	private static final long serialVersionUID = -2058883261679288759L;
41
	private static final String KEY = "installer_creation_exception";
42

  
43
	/**
44
	 * @see BaseException#BaseException(String, Throwable, String, long)
45
	 */
46
	public MakePluginPackageWizardException(String message, Throwable cause) {
47
		super(message, cause, KEY, serialVersionUID);
48
	}
49

  
50
}
0 51

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/creation/MakePluginPackageWizard.java
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.creation;
29

  
30
import java.io.File;
31

  
32
import org.gvsig.installer.lib.api.PackageInfo;
33
import org.gvsig.installer.swing.api.wizard.AbstractInstallerWizard;
34

  
35
/**
36
 * <p>
37
 * Wizard that is used to create a bundle with a package of type plugin from a
38
 * gvSIG directory. This class receive a gvSIG root directory and allows to the
39
 * user to select the plugin that is used to create the bundle.
40
 * </p>
41
 * <p>
42
 * The user can also set some plugin properties, like the version of the
43
 * installer, the build number... The definition of all these properties can be
44
 * found in {@link PackageInfo}.
45
 * </p>
46
 * <p>
47
 * All the classes that inherit if this abstract class have to have a
48
 * constructor with an argument of type {@link File}, that is the application
49
 * directory.
50
 * </p>
51
 * 
52
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
53
 */
54
public abstract class MakePluginPackageWizard extends AbstractInstallerWizard {
55

  
56
	private static final long serialVersionUID = 6387360455696226183L;
57

  
58
	/**
59
	 * Constructor
60
	 * 
61
	 * @see AbstractInstallerWizard#AbstractInstallerWizard(File, File)
62
	 */
63
	public MakePluginPackageWizard(File applicationFolder, File installFolder) {
64
		super(applicationFolder, installFolder);
65
	}
66
}
0 67

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/creation/JOutputPanel.java
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
package org.gvsig.installer.swing.api.creation;
23

  
24
import java.io.File;
25
import java.net.URL;
26

  
27
import javax.swing.JPanel;
28

  
29
/**
30
 * @author gvSIG Team
31
 * @version $Id$
32
 * 
33
 */
34
public abstract class JOutputPanel extends JPanel {
35

  
36
	/**
37
     * 
38
     */
39
	private static final long serialVersionUID = 3787670185392301184L;
40

  
41
	public abstract File getPackageFile();
42

  
43
	public abstract boolean isCreatePackageIndex();
44

  
45
	public abstract void setCreatePackageIndex(boolean create);
46

  
47
	public abstract File getPackageIndexFile();
48

  
49
	public abstract URL getDownloadURL();
50

  
51
	public abstract void setDownloadURL(URL downloadURL);
52

  
53
	public abstract void setPackageIndexFile(File packageIndexFile);
54

  
55
	public abstract void setPackageFile(File packageFile);
56
}
0 57

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/creation/JPackageInfoPanel.java
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
package org.gvsig.installer.swing.api.creation;
23

  
24
import javax.swing.JPanel;
25

  
26
import org.gvsig.installer.lib.api.PackageInfo;
27

  
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 * 
32
 */
33
public abstract class JPackageInfoPanel extends JPanel {
34

  
35
	/**
36
     * 
37
     */
38
	private static final long serialVersionUID = -3731407272889942912L;
39

  
40
	public abstract boolean validatePanel();
41

  
42
	public abstract void panelToPackageInfo(PackageInfo packageInfo);
43

  
44
	public abstract void packageInfoToPanel(PackageInfo packageInfo);
45

  
46
}
0 47

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/SwingInstallerLocator.java
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 org.gvsig.tools.locator.AbstractLocator;
31
import org.gvsig.tools.locator.Locator;
32
import org.gvsig.tools.locator.LocatorException;
33

  
34
/**
35
 * This Locator provides the entry point for the gvSIG
36
 * {@link SwingInstallerManager}
37
 * 
38
 * @see Locator
39
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
40
 */
41
public class SwingInstallerLocator extends AbstractLocator {
42

  
43
	private static final String LOCATOR_NAME = "SwingInstallerLocator";
44
	/**
45
	 * SwingInstallerManager name used by the locator to access the instance
46
	 */
47
	public static final String SWING_INSTALLER_MANAGER_NAME = "SwingInstallerManager";
48
	private static final String SWING_INSTALLER_MANAGER_DESCRIPTION = "SwingInstallerManager of gvSIG";
49

  
50
	/**
51
	 * Unique instance.
52
	 */
53
	private static final SwingInstallerLocator instance = new SwingInstallerLocator();
54

  
55
	/**
56
	 * @see Locator#getLocatorName()
57
	 */
58
	public String getLocatorName() {
59
		return LOCATOR_NAME;
60
	}
61

  
62
	/**
63
	 * Return a reference to {@link SwingInstallerManager}.
64
	 * 
65
	 * @return a reference to SwingInstallerManager
66
	 * @throws LocatorException
67
	 *             if there is no access to the class or the class cannot be
68
	 *             instantiated
69
	 * @see Locator#get(String)
70
	 */
71
	public static SwingInstallerManager getSwingInstallerManager()
72
			throws LocatorException {
73
		return (SwingInstallerManager) getInstance().get(
74
				SWING_INSTALLER_MANAGER_NAME);
75
	}
76

  
77
	/**
78
	 * Return the singleton instance.
79
	 * 
80
	 * @return the singleton instance
81
	 */
82
	public static SwingInstallerLocator getInstance() {
83
		return instance;
84
	}
85

  
86
	/**
87
	 * Registers the Class implementing the {@link SwingInstallerManager}
88
	 * interface.
89
	 * 
90
	 * @param clazz
91
	 *            implementing the SwingInstallerManager interface
92
	 */
93
	public static void registerSwingInstallerManager(
94
			Class<? extends SwingInstallerManager> clazz) {
95
		getInstance().register(SWING_INSTALLER_MANAGER_NAME,
96
				SWING_INSTALLER_MANAGER_DESCRIPTION, clazz);
97
	}
98
}
0 99

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.installer.swing.api.SwingInstallerLibrary
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2
	<modelVersion>4.0.0</modelVersion>
3
	<artifactId>org.gvsig.installer.swing.api</artifactId>
4
	<packaging>jar</packaging>
5
	<name>org.gvsig.installer.swing.api</name>
6
	
7
	<parent>
8
		<groupId>org.gvsig</groupId>
9
		<artifactId>org.gvsig.installer.swing</artifactId>
10
		<version>1.0.1</version>
11
	</parent> 
12
	<dependencies>
13
		<dependency>
14
			<groupId>org.gvsig</groupId>
15
			<artifactId>org.gvsig.tools.lib</artifactId>
16
            <scope>compile</scope>
17
		</dependency>
18
		<dependency>
19
			<groupId>org.gvsig</groupId>
20
			<artifactId>org.gvsig.installer.lib.api</artifactId>
21
			<version>1.0.1</version>
22
            <scope>compile</scope>
23
		</dependency>
24
	</dependencies>
25
</project>
0 26

  
tags/libraries/org.gvsig.installer/1.0.1/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/resources/org/gvsig/installer/swing/impl/text.properties
1
# Resource bundle texts for the Spanish language locale (es)
2
_select_the_folder_to_create_the_package_with=Selecciona el directorio con el que se crear? el paquete
3
_output_options=Opciones de salida
4
_the_package_file_folder_does_not_exist=La carpeta del paquete no existe
5
_the_package_index_file_folder_does_not_exist=La carpeta del paquete de ?ndices no existe
6
_plugin_description=Descripci?n del plugin
7
_installer_progress=Progreso del instalador
8
_Compressing=Comprimiendo
9
_Creating_index=Creando ?ndice
10
_Finished=Finalizado
11
_cant_create_the_package=No se pudo crear el paquete
12
_create_package=Creaci?n del paquete
13
_select_symbol_folder=Selecciona carpeta de s?mbolos
14
_Symbols_wizard=Instalador de s?mbolos
15
_typical_installation=Instalaci?n t?pica
16
_advanced_installation=Instalaci?n avanzada
17
_fast_filter=Filtro r?pido
18
_search=Buscar
19
_reset_filters=Restaurar filtros
20
_categories=Categor?as
21
_types=Tipos
22
_standard_installation=Instalaci?n est?ndar
23
_installation_from_file=Instalaci?n desde archivo
24
_installation_from_url=Instalaci?n desde URL
25
_name=Nombre
26
_version=Versi?n
27
_type=Tipo
28
_already_installed,_check_to_reinstall=Ya instalado, marca para reinstalar.
29
_checked_to_reinstall=Marcado para reinstalar.
30
_not_installed,_check_to_install=No instalado, marca para instalar.
31
_checked_to_install=Marcado para instalar.
32
_already_installed_but_not_installable=Ya instalado pero no instalable.
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff