Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.installer.app / org.gvsig.installer.app.mainplugin / src / main / java / org / gvsig / installer / app / extension / creation / MakePluginPackageExtension.java @ 40557

History | View | Annotate | Download (2.47 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
/*
25
 * AUTHORS (In addition to CIT):
26
 * 2010 {Prodevelop}   {Task}
27
 */
28

    
29
package org.gvsig.installer.app.extension.creation;
30

    
31
import org.slf4j.Logger;
32
import org.slf4j.LoggerFactory;
33

    
34
import org.gvsig.andami.PluginServices;
35
import org.gvsig.andami.PluginsLocator;
36
import org.gvsig.andami.PluginsManager;
37
import org.gvsig.andami.plugins.Extension;
38
import org.gvsig.app.ApplicationLocator;
39
import org.gvsig.app.extension.Version;
40
import org.gvsig.installer.swing.api.SwingInstallerLocator;
41

    
42
/**
43
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
44
 */
45
public class MakePluginPackageExtension extends Extension {
46

    
47
        private static final Logger LOG = LoggerFactory
48
                        .getLogger(MakePluginPackageExtension.class);
49

    
50
        public void execute(String actionCommand) {
51
                if ("tools-devel-pack-plugin".equalsIgnoreCase(actionCommand)) {
52
                        PluginsManager manager = PluginsLocator.getManager();
53

    
54
                        try {
55
                                PluginServices.getMDIManager().addCentredWindow(
56
                                                new MakePluginPackageWindow(manager
57
                                                                .getApplicationFolder(), manager
58
                                                                .getInstallFolder()));
59
                        } catch (Exception e) {
60
                                LOG.error("Error creating teh wizard to create an installer ",
61
                                                e);
62
                        }
63
                }
64
        }
65

    
66
        public void initialize() {
67

    
68
        }
69

    
70
        @Override
71
        public void postInitialize() {
72
                super.postInitialize();
73
                Version version = ApplicationLocator.getManager().getVersion();
74
                SwingInstallerLocator.getSwingInstallerManager().setApplicationVersion(
75
                                version.getFormat());
76
        }
77

    
78
        public boolean isEnabled() {
79
                return true;
80
        }
81

    
82
        public boolean isVisible() {
83
                return true;
84
        }
85

    
86
}