svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / extension / TranslationsPackageExtension.java @ 41284
History | View | Annotate | Download (3.03 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.app.extension; |
25 |
|
26 |
import java.io.File; |
27 |
import org.cresques.Messages; |
28 |
import org.gvsig.andami.PluginsLocator; |
29 |
import org.gvsig.andami.PluginsManager; |
30 |
import org.gvsig.andami.installer.packagebuilder.BasePackageWizard; |
31 |
import org.gvsig.andami.installer.translations.TranslationsInstallerFactory; |
32 |
import org.gvsig.andami.plugins.Extension; |
33 |
import org.gvsig.app.ApplicationLocator; |
34 |
import org.gvsig.app.ApplicationManager; |
35 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
36 |
import org.slf4j.Logger; |
37 |
import org.slf4j.LoggerFactory; |
38 |
|
39 |
public class TranslationsPackageExtension extends Extension { |
40 |
|
41 |
private static Logger logger = LoggerFactory |
42 |
.getLogger(TranslationsPackageExtension.class); |
43 |
|
44 |
public void initialize() { |
45 |
// Do nothing
|
46 |
} |
47 |
|
48 |
public void postInitialize() { |
49 |
super.postInitialize();
|
50 |
} |
51 |
|
52 |
public void execute(String actionCommand) { |
53 |
if ( "tools-devel-translations-package".equalsIgnoreCase(actionCommand) ) { |
54 |
ApplicationManager application = ApplicationLocator.getManager(); |
55 |
application.getUIManager().showWindow( |
56 |
new TranslationsPackageWizard(),
|
57 |
application.translate("_Translations_package"),
|
58 |
WindowManager.MODE.WINDOW |
59 |
); |
60 |
} |
61 |
} |
62 |
|
63 |
public boolean isEnabled() { |
64 |
return true; |
65 |
} |
66 |
|
67 |
public boolean isVisible() { |
68 |
return true; |
69 |
} |
70 |
|
71 |
private class TranslationsPackageWizard extends BasePackageWizard { |
72 |
|
73 |
private static final long serialVersionUID = 9205891710214122265L; |
74 |
|
75 |
TranslationsPackageWizard() { |
76 |
super(TranslationsInstallerFactory.PROVIDER_NAME);
|
77 |
} |
78 |
|
79 |
@Override
|
80 |
protected void initOptionPanels() { |
81 |
PluginsManager pluginsManager = PluginsLocator.getManager(); |
82 |
this.addSelectFolderToPackagingOption(Messages.getText("_Seleccione_la_carpeta_en_la_que_se_encuentran_las_traducciones_a_empaquetar")); |
83 |
super.addDefaultOptionPanels();
|
84 |
this.setFolderToPackaging(new File(pluginsManager.getApplicationFolder(), "i18n")); |
85 |
} |
86 |
|
87 |
} |
88 |
} |