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 @ 44455
History | View | Annotate | Download (3.24 KB)
1 | 40558 | jjdelcerro | /**
|
---|---|---|---|
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 | 40435 | jjdelcerro | package org.gvsig.app.extension; |
25 | |||
26 | import org.gvsig.andami.plugins.Extension; |
||
27 | import org.gvsig.app.extension.develtools.ActionsInfoDevelTool; |
||
28 | import org.gvsig.app.extension.develtools.IconThemeDevelTool; |
||
29 | import org.gvsig.app.extension.develtools.MenusDevelTool; |
||
30 | import org.gvsig.app.extension.develtools.PersistenceDevelTool; |
||
31 | import org.gvsig.tools.ToolsLocator; |
||
32 | import org.gvsig.tools.persistence.PersistenceManager; |
||
33 | import org.gvsig.tools.persistence.exception.PersistenceException; |
||
34 | import org.slf4j.Logger; |
||
35 | import org.slf4j.LoggerFactory; |
||
36 | |||
37 | public class ShowDevelInfoExtension extends Extension { |
||
38 | |||
39 | 43099 | jjdelcerro | private static final Logger logger = LoggerFactory |
40 | 40435 | jjdelcerro | .getLogger(ShowDevelInfoExtension.class); |
41 | |||
42 | 43099 | jjdelcerro | @Override
|
43 | 40435 | jjdelcerro | public void initialize() { |
44 | // Do nothing
|
||
45 | } |
||
46 | |||
47 | 43099 | jjdelcerro | @Override
|
48 | 40435 | jjdelcerro | public void postInitialize() { |
49 | super.postInitialize();
|
||
50 | // ActionInfoManager actionMgr = PluginsLocator.getActionInfoManager();
|
||
51 | // actionMgr.redirect("tools-devel-disposables-show-pendings", "layer-info-by-point");
|
||
52 | |||
53 | PersistenceManager manager = ToolsLocator.getPersistenceManager(); |
||
54 | |||
55 | try {
|
||
56 | manager.setAutoValidation(PersistenceManager.MANDATORY_IF_DECLARED); |
||
57 | } catch (PersistenceException e) {
|
||
58 | logger.warn( |
||
59 | "Error modificando el modo de autovalidacion de persistencia.",
|
||
60 | e); |
||
61 | } |
||
62 | |||
63 | } |
||
64 | |||
65 | 43099 | jjdelcerro | @Override
|
66 | 40435 | jjdelcerro | 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 | 43099 | jjdelcerro | } else if ("tools-devel-show-toolbars".equalsIgnoreCase(actionCommand)) { |
74 | new ActionsInfoDevelTool().showToolBars();
|
||
75 | 40435 | jjdelcerro | } else if ("tools-devel-show-menus".equalsIgnoreCase(actionCommand)) { |
76 | new MenusDevelTool().showAllMenus();
|
||
77 | } else if ("tools-devel-show-menus-by-plugin".equalsIgnoreCase(actionCommand)) { |
||
78 | new MenusDevelTool().showAllMenusByPlugin();
|
||
79 | } else if ("tools-devel-show-plugin-report".equalsIgnoreCase(actionCommand)) { |
||
80 | new ActionsInfoDevelTool().showReportOfPlugin();
|
||
81 | } |
||
82 | } |
||
83 | |||
84 | |||
85 | public boolean isEnabled() { |
||
86 | return true; |
||
87 | } |
||
88 | |||
89 | public boolean isVisible() { |
||
90 | return true; |
||
91 | } |
||
92 | } |