Statistics
| Revision:

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 / ShowDevelInfoExtension.java @ 40558

History | View | Annotate | Download (3.2 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 org.gvsig.andami.PluginsLocator;
27
import org.gvsig.andami.actioninfo.ActionInfo;
28
import org.gvsig.andami.actioninfo.ActionInfoManager;
29
import org.gvsig.andami.plugins.Extension;
30
import org.gvsig.app.extension.develtools.ActionsInfoDevelTool;
31
import org.gvsig.app.extension.develtools.IconThemeDevelTool;
32
import org.gvsig.app.extension.develtools.MenusDevelTool;
33
import org.gvsig.app.extension.develtools.PersistenceDevelTool;
34
import org.gvsig.tools.ToolsLocator;
35
import org.gvsig.tools.persistence.PersistenceManager;
36
import org.gvsig.tools.persistence.exception.PersistenceException;
37
import org.slf4j.Logger;
38
import org.slf4j.LoggerFactory;
39

    
40
public class ShowDevelInfoExtension extends Extension {
41

    
42
        private static Logger logger = LoggerFactory
43
                        .getLogger(ShowDevelInfoExtension.class);
44

    
45
        public void initialize() {
46
                // Do nothing
47
        }
48

    
49
        public void postInitialize() {
50
                super.postInitialize();
51
//                ActionInfoManager actionMgr = PluginsLocator.getActionInfoManager();
52
//                actionMgr.redirect("tools-devel-disposables-show-pendings", "layer-info-by-point");
53
                
54
                PersistenceManager manager = ToolsLocator.getPersistenceManager();
55
                
56
                try {
57
                        manager.setAutoValidation(PersistenceManager.MANDATORY_IF_DECLARED);
58
                } catch (PersistenceException e) {
59
                        logger.warn(
60
                                        "Error modificando el modo de autovalidacion de persistencia.",
61
                                        e);
62
                }
63

    
64
        }
65

    
66
        public void execute(String actionCommand) {
67
                if ("tools-devel-show-persistencefactories".equalsIgnoreCase(actionCommand)) {
68
                        new PersistenceDevelTool().showPersistenceFactories();
69
                } else if ("tools-devel-show-icontheme".equalsIgnoreCase(actionCommand)) {
70
                        new IconThemeDevelTool().showDefaultIconTheme();
71
                } else if ("tools-devel-show-actions".equalsIgnoreCase(actionCommand)) {
72
                        new ActionsInfoDevelTool().showActions();
73
                } else if ("tools-devel-show-menus".equalsIgnoreCase(actionCommand)) {
74
                        new MenusDevelTool().showAllMenus();
75
                } else if ("tools-devel-show-menus-by-plugin".equalsIgnoreCase(actionCommand)) {
76
                        new MenusDevelTool().showAllMenusByPlugin();
77
                } else if ("tools-devel-show-plugin-report".equalsIgnoreCase(actionCommand)) {
78
                        new ActionsInfoDevelTool().showReportOfPlugin();
79
                }
80
        }
81

    
82

    
83
        public boolean isEnabled() {
84
                return true;
85
        }
86

    
87
        public boolean isVisible() {
88
                return true;
89
        }
90
}