Revision 39675

View differences:

tags/v2_0_0_Build_2063/extensions/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.
33
_official_recommended=Official y recomendado
34
_official=Oficial
35
_not_official_recommended=No oficial, recomendado
36
_not_official=No oficial
37
_downloading=Descargando
38
_start_download=Comenzar descarga
39
_download_progress=Progreso de la descarga
40
_Cant_download_package_files=No se han podido descargar los ficheros del paquete
41
_do_you_want_to_continue=?Desea continuar?
42
_Download_error=Error en la descarga
43
_finished=Terminado
44
_the_selected_file_does_not_exist=El archivo seleccionado no existe.
45
_execute_adding_error=Error al a?adir
46
_progress=Progreso
47
_select_plugins=Selecciona paquetes
48
_There_are_no_packages_in_typical_installation_to_select=No hay paquetes en la instalaci?n t?pica para seleccionar
49
_do_you_want_to_continue=?Desea continuar?
50
_do_you_want_to_continue_anyway=?Desea continuar de todas formas?
51
_you_have_selected_in_development_or_not_official_versions=Ha seleccionado versiones de desarrollo o no oficiales
52
_the_following_dependencies_have_not_been_possible_to_resolve=Las siguientes dependencias no se han podido resolver.
53
_the_selected_packages_require_to_install_or_update_the_following_packages=Los paquetes seleccionados requieren instalar o actualizar los siguientes paquetes:
54
_an_error_has_occurred_when_calculating_the_dependecies_of_the_packages_to_install=Se ha producido un error calculando las dependencias de los paquetes a instalar.
55
_an_error_has_occurred_when_calculating_the_dependecies_of_the_selected_packages=Se ha producido un error calculando las dependencias de los paquetes seleccionados.
56
_it_is_not_possible_to_verify_if_any_additional_package_is_needed_to_install_the_selected_packages=No es posible verificar si precisa alg?n paquete adicional para instalar los paquetes que ha seleccionado.
57
_a_problem_has_occurred_when_calculating_the_dependencies=Ha ocurrido un problema calculando las dependencias.
58
_if_you_want_you_can_select_again_manually_the_packets_that_might_be_necessary=Si lo desea puede volver a seleccionar manualmente los paquetes que estime pueden ser necesarios.
59
_do_you_want_to_continue_and_install_the_packages_you_already_have_selected=?Desea continuar instalando los paquetes que ya ha seleccionado?
60
_cancel=Cancelar
61
_continue=Continuar
62
_error_creating_the_wizard=Error creando el asistente.
63
_malformed_url=Direcci?n URL incorrecta.
64
_the_package_source_files_url_is_malformed._Please_review_it=La URL de los archivos fuente del paquete es incorrecta. Por favor, rev?sala.
65
_the_owners_url_is_malformed._Please_review_it=La URL del propietario es incorrecta. Por favor, rev?sala.
66
_advanced_options=Opciones avanzadas
67
_select_an_option=Selecciona una opcion.
68
_the_folder_install_already_exists._do_you_want_to_delete_it_before_proceeding?=El directorio install ya existe. Quieres borrarlo antes de continuar?
69
_Couldn't_delete_the_directory=No se pudo borrar el directorio.
70
_advanced_mode=El modo avanzado permite copiar recursos que est?n alojados fuera del directorio del plugin. No se recomienda usar esta opci?n.
71
_name=Nombre
72
_description=Descripci?n
73
_version=Versi?n
74
_build=Build
75
_is_official=Es oficial?
76
_status=Estado
77
_code=C?digo
78
_operating_system=Sistema operativo
79
_architecture=Arquitectura
80
_java_version=Versi?n java
81
_gvSIG_desktop_version=Versi?n gvSIG desktop
82
_package_owner=Propietario del paquete
83
_package_URL_owner=URL del propietario del paquete 
84
_sources_url=URL del c?digo fuente
85
_dependencies=Dependencias
86
_plugin_description=Description del plugin
87
_plugin_to_install=Plugin a instalar
88
_enable_advanced_mode=Habilitar modo avanzado.
89
_package_file=Archivo del paquete
90
_package_index_file=Archivo del ?ndice del paquete
91
_download_url=URL de descarga
92
_create_package_index=Crear ?ndice del paquete
93
_output_options=Opciones de salida
94
_invalid_download_url=URL de descarga incorrecta.
95
_files_to_copy=Archivos a copiar
96
_the_folder_install/files_already_exists_do_you_want_to_delete_it_before_proceeding?=El directorio install/files ya existe. Desea borrarlo antes de continuar?
97
_ant_script=Script de ant
98
_select_installation_source=Selecciona fuente de instalaci?n
99
_select_installation_mode=Selecciona modo de instalaci?n
100
_gvSIG_packages_and_packages_and_index_sets=Paquetes gvSIG y sets de paquetes y ?ndices
101
_broken_package=Paquete roto
102
_install_addons_in_gvsig_standard_dist=instalar complementos incluidos en la distribuci?n gvSIG standard
103
_install_addons_in_gvspki_or_gvspks_file=instalar complementos contenidos en un archivo .gvspki o .gvspks
104
_install_addons_from_remote_repo=instalar complementos desde un repositorio remoto
105
_These_packages_not_downloaded=No se han podido descargar estos paquetes
106
_gvSIG_must_be_restarted_to_have_changes_applied=Es necesario reiniciar gvSIG para que los cambios tengan efecto 
107
_All=Todos
108
_Install_package=Instalar paquetes
109
_finished_Some_files_not_downloaded=Terminado. Algunos archivos no se pudieron descargar.
110
_downloading_files=Descargar archivos
tags/v2_0_0_Build_2063/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/resources/org/gvsig/installer/swing/impl/text_en.properties
1
# Resource bundle texts for the English language locale (en)
2
_select_the_folder_to_create_the_package_with=Select the folder to create the package with
3
_output_options=Output options
4
_the_package_file_folder_does_not_exist=The package file folder does not exist
5
_the_package_index_file_folder_does_not_exist=The package index file folder does not exist
6
_plugin_description=Plugin description
7
_installer_progress=Installer progress
8
_Compressing=Compressing
9
_Creating_index=Creating ?ndex
10
_Finished=Finished
11
_cant_create_the_package=Can't create the package
12
_create_package=Create package
13
_select_symbol_folder=Select symbol folder
14
_Symbols_wizard=Symbols_wizard
15
_typical_installation=Typical installation
16
_advanced_installation=Advanced installation
17
_fast_filter=Fast filter
18
_search=Search
19
_reset_filters=Reset filters
20
_categories=Categories
21
_types=Types
22
_standard_installation=Standard installation
23
_installation_from_file=Installation from file
24
_installation_from_url=Installation from URL
25
_name=Name
26
_version=Version
27
_type=Type
28
_already_installed,_check_to_reinstall=Already installed, check to reinstall
29
_checked_to_reinstall=Checked to reinstall
30
_not_installed,_check_to_install=Not installed, check to reinstall
31
_checked_to_install=Checked to install
32
_already_installed_but_not_installable=Already installed but not installable
33
_official_recommended=Official and recommended
34
_official=Official
35
_not_official_recommended=Not official, recommended
36
_not_official=Not official
37
_downloading=Downloading
38
_start_download=Start download
39
_progress=Progress
40
_select_plugins=Select packages
41
_There_are_no_packages_in_typical_installation_to_select=There are no packages in typical installation to select
42
_do_you_want_to_continue=Do you want to continue?
43
_do_you_want_to_continue_anyway=Do you want to continue anyway?
44
_you_have_selected_in_development_or_not_official_versions=You have selected in development or not official versions
45
_download_progress=Download progress
46
_Cant_download_package_files=Can't download package files
47
_do_you_want_to_continue=Do you want to continue?
48
_Download_error=Download error
49
_finished=Finished
50
_the_selected_file_does_not_exist=The selected file does not exist.
51
_execute_adding_error=Execute adding error
52
_the_following_dependencies_have_not_been_possible_to_resolve=The following dependencies have not been possible to resolve.
53
_the_selected_packages_require_to_install_or_update_the_following_packages=The selected packages require to install or update the following packages:
54
_an_error_has_occurred_when_calculating_the_dependecies_of_the_packages_to_install=An error has occurred when calculating the dependencies of the packages to install.
55
_an_error_has_occurred_when_calculating_the_dependecies_of_the_selected_packages=An error has occurred when calculating the dependencies of the selected packages.
56
_it_is_not_possible_to_verify_if_any_additional_package_is_needed_to_install_the_selected_packages=It is not possible to verify if any additional package is needed to install the selected packages
57
_a_problem_has_occurred_when_calculating_the_dependencies=A problem has occurred when calculating the dependencies.
58
_if_you_want_you_can_select_again_manually_the_packets_that_might_be_necessary=If you want you can select again manually the packets that might be necessary.
59
_do_you_want_to_continue_and_install_the_packages_you_already_have_selected=Do you want to continue and install the packages you already have selected?
60
_cancel=Cancel
61
_continue=Continue
62
_error_creating_the_wizard=Error creating the wizard
63
_malformed_url=Malformed URL
64
_the_package_source_files_url_is_malformed._Please_review_it=The package source files URL is malformed. Please review it.
65
_the_owners_url_is_malformed._Please_review_it=The owner's URL is malformed. Please review it.
66
_advanced_options=Advanced options
67
_select_an_option=Select an option.
68
_the_folder_install_already_exists._do_you_want_to_delete_it_before_proceeding?=The folder install already exists. Do you want to delete it before proceeding?
69
_Couldn't_delete_the_directory=Couldn't delete the directory.
70
_advanced_mode=The advanced mode option allows to copy resources that are located out of the plugin directory. We don't recommend to use this option.
71
_name=Name
72
_description=Description
73
_version=Version
74
_build=Build
75
_is_official=Is official?
76
_status=Status
77
_code=Code
78
_operating_system=Operating system
79
_architecture=Architecture
80
_java_version=Java version
81
_gvSIG_desktop_version=gvSIG desktop version
82
_package_owner=Package owner
83
_package_URL_owner=Package URL owner
84
_sources_url=Sources URL
85
_dependencies=Dependencies
86
_plugin_description=Plugin description
87
_plugin_to_install=Plugin to install
88
_enable_advanced_mode=Enable advanced mode.
89
_package_file=Archivo del paquete
90
_package_index_file=Package index file
91
_download_url=Download URL
92
_create_package_index=Create package index
93
_output_options=Output options
94
_invalid_download_url=Invalid download URL.
95
_files_to_copy=Files to copy
96
_the_folder_install/files_already_exists_do_you_want_to_delete_it_before_proceeding?=The folder install/files already exists. Do you want to delete it before proceeding?
97
_ant_script=Ant script
98
_select_installation_source=Select installation source
99
_select_installation_mode=Select installation mode
100
_gvSIG_packages_and_packages_and_index_sets=gvSIG packages and packages and index sets
101
_broken_package=Broken package
102
_install_addons_in_gvsig_standard_dist=install addons contained in the gvSIG standard distribution
103
_install_addons_in_gvspki_or_gvspks_file=install addons contained in a .gvspki or .gvspks file
104
_install_addons_from_remote_repo=install addons from a remote repository
105
_These_packages_not_downloaded=Unable to download these packages
106
_gvSIG_must_be_restarted_to_have_changes_applied=Changes will take effect when gvSIG is restarted
107
_All=All
108
_Install_package=Package install
109
_finished_Some_files_not_downloaded=Finished. There were issues downloading some files.
110
_downloading_files=File download
tags/v2_0_0_Build_2063/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.installer.swing.impl.DefaultSwingInstallerLibrary
tags/v2_0_0_Build_2063/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/wizard/WizardListenerAdapter.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.impl.wizard;
29

  
30
import java.awt.Component;
31

  
32
import javax.swing.JOptionPane;
33

  
34
import org.gvsig.gui.beans.wizard.WizardPanel;
35
import org.gvsig.gui.beans.wizard.WizardPanelActionListener;
36
import org.gvsig.i18n.Messages;
37
import org.gvsig.installer.swing.api.wizard.InstallerWizardPanel;
38
import org.gvsig.tools.task.CancellableTask;
39

  
40
/**
41
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
42
 */
43
public class WizardListenerAdapter implements WizardPanelActionListener {
44

  
45
	private InstallerWizardPanel installerWizardPanel;
46

  
47
	public WizardListenerAdapter(InstallerWizardPanel installerWizardPanel) {
48
		super();
49
		this.installerWizardPanel = installerWizardPanel;
50
	}
51

  
52
	public void cancel(WizardPanel wizardPanel) {
53
		if (installerWizardPanel.getWizardActionListener() != null) {
54
			for (CancellableTask task : installerWizardPanel
55
					.getCancellableTasks()) {
56
				task.cancelRequest();
57
			}
58
			installerWizardPanel.getWizardActionListener().cancel(
59
					installerWizardPanel);
60
		}
61
	}
62

  
63
	public void finish(WizardPanel wizardPanel) {
64
		if (installerWizardPanel.getWizardActionListener() != null) {
65
			installerWizardPanel.getWizardActionListener().finish(
66
					installerWizardPanel);
67
		}
68
		
69
		if (installerWizardPanel.needsToRestartApplicationAfterFinish()) {
70

  
71
		    // --------------------------- Suggest restart
72
		    Component parent = null;
73
		    if (installerWizardPanel instanceof Component) {
74
		        parent = (Component) installerWizardPanel;
75
		    }
76
		    JOptionPane.showMessageDialog(
77
		        parent,
78
		        Messages.getText("_gvSIG_must_be_restarted_to_have_changes_applied"),
79
                Messages.getText("_finished"),
80
		        JOptionPane.WARNING_MESSAGE);
81
		}
82
	}
83
}
0 84

  
tags/v2_0_0_Build_2063/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/panel/SelectBundlesPanel.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.impl.execution.panel;
29

  
30
import java.awt.BorderLayout;
31
import java.awt.GridBagConstraints;
32
import java.awt.GridBagLayout;
33
import java.awt.Insets;
34
import java.awt.event.ItemEvent;
35
import java.awt.event.ItemListener;
36
import java.io.File;
37
import java.net.MalformedURLException;
38
import java.net.URL;
39
import java.util.List;
40

  
41
import javax.swing.ButtonGroup;
42
import javax.swing.JComboBox;
43
import javax.swing.JPanel;
44
import javax.swing.JRadioButton;
45
import javax.swing.JTextField;
46
import javax.swing.event.DocumentEvent;
47
import javax.swing.event.DocumentListener;
48

  
49
import org.gvsig.gui.beans.openfile.FileFilter;
50
import org.gvsig.gui.beans.openfile.FileTextField;
51
import org.gvsig.installer.swing.api.SwingInstallerLocator;
52
import org.gvsig.installer.swing.impl.DefaultSwingInstallerManager;
53

  
54
/**
55
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
56
 */
57
public class SelectBundlesPanel extends JPanel implements ItemListener,
58
		DocumentListener {
59

  
60
	/**
61
     * 
62
     */
63
	private static final long serialVersionUID = -6580729307001414868L;
64
	protected DefaultSwingInstallerManager swingInstallerManager = null;
65
	private JRadioButton fileRadioButton;
66
	private ButtonGroup buttonGroup;
67
	private JPanel northPanel;
68
	private FileTextField selectFileText;
69
	private JRadioButton standardRadioButton;
70
	private JComboBox downloadURL;
71
	private JRadioButton urlRadioButton;
72
	private final List<URL> defaultDownloadURL;
73

  
74
	public SelectBundlesPanel(List<URL> defaultDownloadURL, File installFolder) {
75
		super();
76
		this.defaultDownloadURL = defaultDownloadURL;
77
		swingInstallerManager = (DefaultSwingInstallerManager) SwingInstallerLocator
78
				.getSwingInstallerManager();
79
		initComponents();
80
		initListeners();
81
		
82
		String[] files = installFolder.list();
83
		
84
		if (files.length >0){
85
			standardRadioButton.setSelected(true);
86
		} else {
87
			urlRadioButton.setSelected(true);	
88
			standardRadioButton.setEnabled(false);
89
		}
90
	}
91

  
92
	private void initListeners() {
93
		standardRadioButton.addItemListener(this);
94
		fileRadioButton.addItemListener(this);
95
		urlRadioButton.addItemListener(this);
96
		Object obj = selectFileText.getComponent(0);
97
		if ((obj != null) && (obj instanceof JTextField)) {
98
			((JTextField) obj).getDocument().addDocumentListener(this);
99
		}
100
	}
101

  
102
	private void initComponents() {
103
		java.awt.GridBagConstraints gridBagConstraints;
104

  
105
		northPanel = new JPanel();
106
		standardRadioButton = new JRadioButton();
107
		fileRadioButton = new JRadioButton();
108
		urlRadioButton = new JRadioButton();
109
		selectFileText = new FileTextField();
110
		selectFileText.setFileFilter(new FileFilter() {
111

  
112
			private String packageExt = swingInstallerManager
113
					.getInstallerManager().getDefaultPackageFileExtension();
114
			private String packageSetExt = swingInstallerManager
115
					.getInstallerManager().getDefaultPackageSetFileExtension();
116
			private String indexSetExt = swingInstallerManager
117
					.getInstallerManager().getDefaultIndexSetFileExtension();
118

  
119
			@Override
120
			public String getDescription() {
121
				return "_gvSIG_packages_and_packages_and_index_sets" + " (*."
122
						+ packageExt + ", *." + packageSetExt + ", *."
123
						+ indexSetExt + ")";
124
			}
125

  
126
			@Override
127
			public boolean accept(File file) {
128
				if (file.isFile()) {
129
					String name = file.getName().toLowerCase();
130
					return name.endsWith(packageExt)
131
							|| name.endsWith(packageSetExt)
132
							|| name.endsWith(indexSetExt);
133
				}
134
				return true;
135
			}
136

  
137
			@Override
138
			public String getDefaultExtension() {
139
				return packageSetExt;
140
			}
141
		});
142

  
143
		downloadURL = new JComboBox();
144
		downloadURL.setEditable(true);
145
		if (defaultDownloadURL != null) {
146
			for (int i = 0; i < defaultDownloadURL.size(); i++) {
147
				downloadURL.addItem(defaultDownloadURL.get(i));
148
			}
149
		}
150

  
151
		buttonGroup = new ButtonGroup();
152

  
153
		buttonGroup.add(standardRadioButton);
154
		buttonGroup.add(fileRadioButton);
155
		buttonGroup.add(urlRadioButton);
156

  
157
		setLayout(new BorderLayout());
158

  
159
		northPanel.setLayout(new GridBagLayout());
160

  
161
		standardRadioButton.setText(swingInstallerManager
162
				.getText("_standard_installation") +
163
				" (" +
164
				swingInstallerManager.getText("_install_addons_in_gvsig_standard_dist") +
165
				")");
166

  
167
		gridBagConstraints = new GridBagConstraints();
168
		gridBagConstraints.anchor = GridBagConstraints.WEST;
169
		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
170
		northPanel.add(standardRadioButton, gridBagConstraints);
171

  
172
		fileRadioButton.setText(swingInstallerManager
173
				.getText("_installation_from_file") +
174
		             " (" +
175
		             swingInstallerManager.getText("_install_addons_in_gvspki_or_gvspks_file") +
176
		             ")");
177

  
178
		gridBagConstraints = new GridBagConstraints();
179
		gridBagConstraints.gridx = 0;
180
		gridBagConstraints.gridy = 1;
181
		gridBagConstraints.anchor = GridBagConstraints.WEST;
182
		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
183
		northPanel.add(fileRadioButton, gridBagConstraints);
184
		gridBagConstraints = new GridBagConstraints();
185
		gridBagConstraints.gridx = 0;
186
		gridBagConstraints.gridy = 2;
187
		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
188
		gridBagConstraints.weightx = 1.0;
189
		gridBagConstraints.insets = new Insets(2, 20, 2, 2);
190
		northPanel.add(selectFileText, gridBagConstraints);
191

  
192
		urlRadioButton.setText(swingInstallerManager
193
				.getText("_installation_from_url") +
194
	             " (" +
195
	             swingInstallerManager.getText("_install_addons_from_remote_repo") +
196
	             ")");
197
		
198
		gridBagConstraints = new GridBagConstraints();
199
		gridBagConstraints.gridx = 0;
200
		gridBagConstraints.gridy = 3;
201
		gridBagConstraints.anchor = GridBagConstraints.WEST;
202
		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
203
		northPanel.add(urlRadioButton, gridBagConstraints);
204
		gridBagConstraints = new GridBagConstraints();
205
		gridBagConstraints.gridx = 0;
206
		gridBagConstraints.gridy = 4;
207
		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
208
		gridBagConstraints.weightx = 1.0;
209
		gridBagConstraints.insets = new Insets(2, 20, 2, 2);
210
		northPanel.add(downloadURL, gridBagConstraints);
211

  
212
		add(northPanel, java.awt.BorderLayout.NORTH);
213
	}
214

  
215
	public void itemStateChanged(ItemEvent e) {
216
		selectFileText.setEnabled(fileRadioButton.isSelected());
217
		checkNextButtonEnabled();
218
	}
219

  
220
	protected File getSelectedFile() {
221
		return selectFileText.getSelectedFile();
222
	}
223

  
224
	protected URL getSelectedURL() throws MalformedURLException {
225
		if (downloadURL.getSelectedItem() instanceof URL) {
226
			return (URL) downloadURL.getSelectedItem();
227
		}
228
		return new URL(downloadURL.getSelectedItem().toString());
229

  
230
	}
231

  
232
	protected boolean isStandardSelected() {
233
		return standardRadioButton.isSelected();
234
	}
235

  
236
	protected boolean isFileSelected() {
237
		return fileRadioButton.isSelected();
238
	}
239

  
240
	protected boolean isURLSelected() {
241
		return urlRadioButton.isSelected();
242
	}
243

  
244
	protected boolean isNextButtonEnabled() {
245
		if (isStandardSelected()) {
246
			return true;
247
		}
248
		if (isFileSelected()) {
249
			File file = selectFileText.getSelectedFile();
250
			if (file == null) {
251
				return false;
252
			}
253
			return file.exists();
254
		}
255
		if (isURLSelected()) {
256
			try {
257
				getSelectedURL();
258
				return true;
259
			} catch (MalformedURLException e) {
260
				return false;
261
			}
262
		}
263
		return false;
264
	}
265

  
266
	protected void checkNextButtonEnabled() {
267

  
268
	}
269

  
270
	public void changedUpdate(DocumentEvent e) {
271
		checkNextButtonEnabled();
272
	}
273

  
274
	public void insertUpdate(DocumentEvent e) {
275
		checkNextButtonEnabled();
276
	}
277

  
278
	public void removeUpdate(DocumentEvent e) {
279
		checkNextButtonEnabled();
280
	}
281

  
282
}
0 283

  
tags/v2_0_0_Build_2063/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/panel/TypicalOrAdvancedPanel.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.impl.execution.panel;
23

  
24
import java.awt.BorderLayout;
25
import java.awt.GridBagConstraints;
26
import java.awt.GridBagLayout;
27
import java.awt.Insets;
28
import java.awt.event.ItemEvent;
29
import java.awt.event.ItemListener;
30

  
31
import javax.swing.ButtonGroup;
32
import javax.swing.JPanel;
33
import javax.swing.JRadioButton;
34
import javax.swing.event.DocumentEvent;
35
import javax.swing.event.DocumentListener;
36

  
37
import org.gvsig.installer.swing.api.SwingInstallerLocator;
38
import org.gvsig.installer.swing.impl.DefaultSwingInstallerManager;
39

  
40
/**
41
 * @author gvSIG Team
42
 * @version $Id$
43
 * 
44
 */
45
public class TypicalOrAdvancedPanel extends JPanel implements ItemListener,
46
		DocumentListener {
47

  
48
	private static final long serialVersionUID = 8488517767926838568L;
49

  
50
	protected DefaultSwingInstallerManager swingInstallerManager = null;
51

  
52
	private JPanel northPanel;
53
	private JRadioButton typicalModeRadioButton;
54
	private JRadioButton advancedModeRadioButton;
55
	private ButtonGroup buttonGroup;
56

  
57
	public TypicalOrAdvancedPanel() {
58
		swingInstallerManager = (DefaultSwingInstallerManager) SwingInstallerLocator
59
				.getSwingInstallerManager();
60
		initComponents();
61
		initListeners();
62
		typicalModeRadioButton.setSelected(true);
63

  
64
	}
65

  
66
	private void initListeners() {
67
		typicalModeRadioButton.addItemListener(this);
68
		advancedModeRadioButton.addItemListener(this);
69
	}
70

  
71
	private void initComponents() {
72
		java.awt.GridBagConstraints gridBagConstraints;
73

  
74
		northPanel = new JPanel();
75
		typicalModeRadioButton = new JRadioButton();
76
		advancedModeRadioButton = new JRadioButton();
77

  
78
		buttonGroup = new ButtonGroup();
79

  
80
		buttonGroup.add(typicalModeRadioButton);
81
		buttonGroup.add(advancedModeRadioButton);
82

  
83
		setLayout(new BorderLayout());
84

  
85
		northPanel.setLayout(new GridBagLayout());
86

  
87
		typicalModeRadioButton.setText(swingInstallerManager
88
				.getText("_typical_installation"));
89
		gridBagConstraints = new GridBagConstraints();
90
		gridBagConstraints.gridx = 0;
91
		gridBagConstraints.gridy = 1;
92
		gridBagConstraints.anchor = GridBagConstraints.WEST;
93
		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
94
		northPanel.add(typicalModeRadioButton, gridBagConstraints);
95

  
96
		advancedModeRadioButton.setText(swingInstallerManager
97
				.getText("_advanced_installation"));
98
		gridBagConstraints = new GridBagConstraints();
99
		gridBagConstraints.gridx = 0;
100
		gridBagConstraints.gridy = 2;
101
		gridBagConstraints.anchor = GridBagConstraints.WEST;
102
		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
103
		northPanel.add(advancedModeRadioButton, gridBagConstraints);
104

  
105
		add(northPanel, java.awt.BorderLayout.WEST);
106
	}
107

  
108
	protected boolean isTypicalModeSelected() {
109
		return typicalModeRadioButton.isSelected();
110
	}
111

  
112
	protected boolean isAdvancedModeSelected() {
113
		return advancedModeRadioButton.isSelected();
114
	}
115

  
116
	protected void setEnableTypicalMode(boolean active) {
117
		if (active) {
118
			typicalModeRadioButton.setSelected(true);
119
		} else {
120
			advancedModeRadioButton.setSelected(true);
121
		}
122
		typicalModeRadioButton.setEnabled(active);
123
	}
124

  
125
	public void itemStateChanged(ItemEvent arg0) {
126
	}
127

  
128
	public void changedUpdate(DocumentEvent arg0) {
129
	}
130

  
131
	public void insertUpdate(DocumentEvent arg0) {
132
	}
133

  
134
	public void removeUpdate(DocumentEvent arg0) {
135
	}
136

  
137
}
0 138

  
tags/v2_0_0_Build_2063/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/panel/PackagePropertiesFilterPanel.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.impl.execution.panel;
23

  
24
import java.awt.GridBagConstraints;
25
import java.awt.GridBagLayout;
26
import java.awt.Insets;
27
import java.awt.event.ActionEvent;
28
import java.awt.event.ActionListener;
29
import java.awt.event.MouseEvent;
30
import java.awt.event.MouseListener;
31
import java.util.List;
32

  
33
import javax.swing.DefaultListModel;
34
import javax.swing.JButton;
35
import javax.swing.JList;
36
import javax.swing.JPanel;
37
import javax.swing.JScrollPane;
38
import javax.swing.ListModel;
39

  
40
import org.gvsig.installer.lib.api.execution.InstallPackageService;
41
import org.gvsig.installer.swing.api.SwingInstallerLocator;
42
import org.gvsig.installer.swing.impl.DefaultSwingInstallerManager;
43
import org.gvsig.installer.swing.impl.execution.panel.filters.AllFilter;
44
import org.gvsig.installer.swing.impl.execution.panel.filters.CategoryFilter;
45
import org.gvsig.installer.swing.impl.execution.panel.filters.PackageFilter;
46
import org.gvsig.installer.swing.impl.execution.panel.filters.TypeFilter;
47

  
48
/**
49
 * @author gvSIG Team
50
 * @version $Id$
51
 * 
52
 */
53
public class PackagePropertiesFilterPanel extends JPanel implements
54
		ActionListener {
55

  
56
	private static final long serialVersionUID = 3767011079359743742L;
57

  
58
	public enum PropertiesFilter {
59
		CATEGORIES, TYPES
60
	}
61

  
62
	private PackagesTablePanel packagesTablePanel;
63

  
64
	private JScrollPane filterScrollPane;
65
	private JList jList;
66
//	private PropertiesFilter optionFilter = null;
67
	private DefaultListModel model = null;
68

  
69
	private DefaultSwingInstallerManager manager;
70

  
71
	public PackagePropertiesFilterPanel(PackagesTablePanel packagesTablePanel) {
72
		this.packagesTablePanel = packagesTablePanel;
73
		manager = (DefaultSwingInstallerManager) SwingInstallerLocator
74
				.getSwingInstallerManager();
75
		initComponents();
76
	}
77

  
78
	private void initComponents() {
79

  
80
		model = new DefaultListModel();
81
		jList = new JList(model);
82

  
83
		filterScrollPane = new JScrollPane(jList);
84
		MyMouseListener mouseListener = new MyMouseListener();
85
		// filterScrollPane.addMouseListener(mouseListener);
86
		jList.addMouseListener(mouseListener);
87

  
88
		JButton categoriesButton = new JButton(manager.getText("_categories"));
89
		categoriesButton.setActionCommand("categories");
90
		categoriesButton.addActionListener(this);
91

  
92
		JButton typesButton = new JButton(manager.getText("_types"));
93
		typesButton.setActionCommand("types");
94
		typesButton.addActionListener(this);
95

  
96
		this.setLayout(new GridBagLayout());
97

  
98
		java.awt.GridBagConstraints gridBagConstraints;
99

  
100
		gridBagConstraints = new GridBagConstraints();
101
		gridBagConstraints.fill = GridBagConstraints.BOTH;
102
		gridBagConstraints.gridx = 0;
103
		gridBagConstraints.gridy = 0;
104
		gridBagConstraints.weightx = 1;
105
		gridBagConstraints.weighty = 1;
106
		// gridBagConstraints.gridheight = 3;
107
		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
108
		this.add(filterScrollPane, gridBagConstraints);
109

  
110
		gridBagConstraints = new GridBagConstraints();
111
		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
112
		gridBagConstraints.gridx = 0;
113
		gridBagConstraints.gridy = 1;
114
		gridBagConstraints.weightx = 1;
115
		gridBagConstraints.weighty = 0;
116
		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
117
		this.add(categoriesButton, gridBagConstraints);
118

  
119
		gridBagConstraints = new GridBagConstraints();
120
		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
121
		gridBagConstraints.gridx = 0;
122
		gridBagConstraints.gridy = 2;
123
		gridBagConstraints.weightx = 1;
124
		gridBagConstraints.weighty = 0;
125
		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
126
		this.add(typesButton, gridBagConstraints);
127

  
128
	}
129

  
130
	public void resetPanel() {
131
		model.removeAllElements();
132
		
133
		// optionFilter = null;
134
		PackageFilter filter = null;
135
		packagesTablePanel.setFilter(filter);
136
	}
137

  
138
	public void actionPerformed(ActionEvent e) {
139

  
140
		InstallPackageService service = packagesTablePanel
141
				.getSelectPackagesPanel().getModel().getInstallPackageService();
142

  
143
		if ("categories".equals(e.getActionCommand())) {
144
		    
145
		    packagesTablePanel.resetPanel();
146
		    loadCategories();
147
			
148
		} else {
149
			if ("types".equals(e.getActionCommand())) {
150
//				this.optionFilter = PropertiesFilter.TYPES;
151
				model.removeAllElements();
152
				packagesTablePanel.resetPanel();
153

  
154
				List<String> types = service.getTypes();
155

  
156
				model.add(0,new AllFilter());
157
				if (types != null) {
158
					for (int i = 0; i < types.size(); i++) {
159
						model.add(i+1, new TypeFilter(types.get(i)));
160
					}
161
				}
162
			}
163
		}
164
	}
165

  
166
	private class MyMouseListener implements MouseListener {
167

  
168
		public void mouseClicked(MouseEvent e) {
169
			int i = jList.getSelectedIndex();
170
			if (i >= 0) {
171
				ListModel listModel = jList.getModel();
172
				PackageFilter filter = (PackageFilter) listModel.getElementAt(i);
173
				packagesTablePanel.setFilter(filter);
174
				
175
//				
176
//				// update packets list to filter
177
//				if (optionFilter == PropertiesFilter.TYPES) {
178
//					TypeFilter typeFilter = new TypeFilter(element);
179
//					packagesTablePanel.setFilter(typeFilter);
180
//				} else if (optionFilter == PropertiesFilter.CATEGORIES) {
181
//					CategoryFilter categoryFilter = new CategoryFilter(element);
182
//					packagesTablePanel.setFilter(categoryFilter);
183
//				}
184

  
185
			}
186
		}
187

  
188
		public void mouseEntered(MouseEvent e) {
189
		}
190

  
191
		public void mouseExited(MouseEvent e) {
192
		}
193

  
194
		public void mousePressed(MouseEvent e) {
195
		}
196

  
197
		public void mouseReleased(MouseEvent e) {
198
		}
199

  
200
	}
201
	
202
	private void loadCategories() {
203
	       
204
	    InstallPackageService service = packagesTablePanel
205
               .getSelectPackagesPanel().getModel().getInstallPackageService();
206
        model.removeAllElements();
207

  
208
        List<String> categories = service.getCategories();
209

  
210
        model.add(0,new AllFilter());
211
        if (categories != null) {
212
            for (int i = 0; i < categories.size(); i++) {
213
                model.add(i+1, new CategoryFilter(categories.get(i)));
214
            }
215
        }
216
        jList.setSelectedIndex(0);
217
	    
218
	}
219
	
220
	public void setInitialFilter() {
221
	    loadCategories();
222
	}
223

  
224
}
0 225

  
tags/v2_0_0_Build_2063/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/panel/SelectPackagesPanel.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.impl.execution.panel;
29

  
30
import java.awt.BorderLayout;
31
import java.util.ArrayList;
32
import java.util.List;
33

  
34
import javax.swing.JPanel;
35

  
36
import org.gvsig.installer.lib.api.PackageInfo;
37
import org.gvsig.installer.lib.api.execution.InstallPackageService;
38
import org.gvsig.installer.swing.api.SwingInstallerLocator;
39
import org.gvsig.installer.swing.impl.DefaultSwingInstallerManager;
40
import org.gvsig.installer.swing.impl.execution.DefaultInstallPackageWizard;
41
import org.gvsig.installer.swing.impl.execution.panel.model.PackagesTableModel;
42
import org.gvsig.installer.swing.impl.execution.wizard.SelectPackagesWizard;
43

  
44
/**
45
 * @author gvSIG Team
46
 * @version $Id$
47
 */
48
public class SelectPackagesPanel extends JPanel {
49

  
50
	private SelectPackagesWizard wizard;
51
	private static final long serialVersionUID = -7554097983061858479L;
52
	protected DefaultSwingInstallerManager swingInstallerManager = null;
53
	private PackagesTablePanel packagesTablePanel;
54

  
55
	private PackagesTableModel pluginsTableModel = null;
56

  
57
	public SelectPackagesPanel(SelectPackagesWizard selectPackagesWizard) {
58
		super();
59
		this.wizard = selectPackagesWizard;
60
		swingInstallerManager = (DefaultSwingInstallerManager) SwingInstallerLocator
61
				.getSwingInstallerManager();
62
		initComponents();
63
	}
64

  
65
	public JPanel getJPanel() {
66
		return this;
67
	}
68

  
69
	public void updateTableModel(PackagesTableModel pluginsTableModel) {
70
		packagesTablePanel.setTableModel(pluginsTableModel);
71
		add(packagesTablePanel, BorderLayout.CENTER);
72
	}
73

  
74
	public void selectPackages() {
75
		packagesTablePanel.selectPackages();
76
	}
77

  
78
	private void initComponents() {
79
		setLayout(new BorderLayout(0, 0));
80

  
81
		packagesTablePanel = new PackagesTablePanel(this);
82
		add(packagesTablePanel, BorderLayout.CENTER);
83
	}
84

  
85
	public List<PackageInfo> getPackagesToInstall() {
86

  
87
		List<PackageInfo> packages = packagesTablePanel.getPackagesToInstall();
88

  
89
		List<PackageInfo> packagesToInstall = new ArrayList<PackageInfo>();
90
		packagesToInstall.addAll(packages);
91
		return packagesToInstall;
92
	}
93

  
94
	public boolean isPackageSelected() {
95
		return packagesTablePanel.isPackageSelected();
96
	}
97

  
98
	public void checkIfPluginSelected() {
99
		wizard.checkIfPluginSelected();
100
	}
101

  
102
	public void packageSelectionChanged(Object value, int row, int column) {
103
	}
104

  
105
	public void updatePanel() {
106

  
107
		InstallPackageService installerExecutionService = wizard
108
				.getDefaultInstallPackageWizard()
109
				.getInstallerExecutionService();
110

  
111
		if (pluginsTableModel == null) {
112
			pluginsTableModel = new PackagesTableModel(swingInstallerManager,
113
					installerExecutionService, true);
114
		}
115
		pluginsTableModel.updatePackages();
116

  
117
		updateTableModel(pluginsTableModel);
118

  
119
		if (wizard.isDefaultPackagesSelectionSet()) {
120
			pluginsTableModel.selectDefaultPackages();
121
		}
122
		
123
		
124
		
125
		
126

  
127
	}
128

  
129
	public DefaultInstallPackageWizard getDefaultInstallPackageWizard() {
130
		return wizard.getDefaultInstallPackageWizard();
131
	}
132

  
133
	public PackagesTableModel getModel() {
134
		return this.pluginsTableModel;
135
	}
136

  
137
	public void clearPanel() {
138
		packagesTablePanel.clearAllPanels();
139
	}
140

  
141
    /**
142
     * 
143
     */
144
    public void setInitialFilter() {
145
        packagesTablePanel.setInitialFilter();
146
        
147
    }
148

  
149
}
0 150

  
tags/v2_0_0_Build_2063/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/panel/model/PackagesTableModel.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.impl.execution.panel.model;
29

  
30
import java.net.URL;
31
import java.util.ArrayList;
32
import java.util.Arrays;
33
import java.util.Comparator;
34
import java.util.HashMap;
35
import java.util.HashSet;
36
import java.util.Iterator;
37
import java.util.List;
38
import java.util.Map;
39
import java.util.Set;
40

  
41
import javax.swing.table.AbstractTableModel;
42

  
43
import org.gvsig.installer.lib.api.InstallerLocator;
44
import org.gvsig.installer.lib.api.InstallerManager;
45
import org.gvsig.installer.lib.api.PackageInfo;
46
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException;
47
import org.gvsig.installer.lib.api.execution.InstallPackageService;
48
import org.gvsig.installer.swing.api.SwingInstallerManager;
49
import org.gvsig.installer.swing.impl.execution.panel.filters.NameDescriptionOrCodeFilter;
50
import org.gvsig.installer.swing.impl.execution.panel.filters.PackageFilter;
51

  
52
public class PackagesTableModel extends AbstractTableModel {
53

  
54
	private static final long serialVersionUID = -454014676003979512L;
55

  
56
	public enum PackageStatus {
57
		INSTALLED, NOT_INSTALLED, TO_REINSTALL, TO_INSTALL, INSTALLED_NOT_INSTALLABLE, BROKEN;
58
	}
59

  
60
	public enum PackageOfficialRecommended {
61
		OFFICIAL_NOT_RECOMMENDED, OFFICIAL_RECOMMENDED, NOT_OFFICIAL_RECOMMENDED, NOT_OFFICIAL_NOT_RECOMMENDED
62
	}
63

  
64
	public class PackageOsAndArchitecture {
65
		public String os;
66
		public String arch;
67
	}
68
	
69
//	
70
//	public enum PackageOsAndArchitecture {
71
//		WINDOLS_32, WINDOLS_64, LINUX_32, LINUX_64, ALL, OTHER
72
//	}
73

  
74
	private TablePackageInfo[] currentlyVisiblePackages = null;
75

  
76
	private final String[] columnNames;
77

  
78
	private InstallerManager installerManager = InstallerLocator
79
			.getInstallerManager();
80
	private InstallPackageService installerExecutionService;
81

  
82
	boolean isOfficial;
83
	private NameDescriptionOrCodeFilter packageFastFilter = null;
84
	private PackageFilter packageFilter = null;
85
	
86
	private Set<PackageInfo> selectedPackages = new HashSet<PackageInfo>();
87
	private Map<String, TablePackageInfo> allPackages = null;
88

  
89
	public PackagesTableModel(SwingInstallerManager swingInstallerManager,
90
			InstallPackageService installerExecutionService, boolean isOfficial) {
91

  
92
		this.installerExecutionService = installerExecutionService;
93
		this.isOfficial = isOfficial;
94
		
95
		Map<String, TablePackageInfo> infos = getDefaultPackages();
96

  
97
		currentlyVisiblePackages = infos.values().toArray(
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff