root / tags / v2_0_0_Build_2050 / applications / appgvSIG / src / org / gvsig / app / extension / ShowDevelInfoExtension.java @ 38653
History | View | Annotate | Download (2.13 KB)
1 |
package org.gvsig.app.extension; |
---|---|
2 |
|
3 |
import org.gvsig.andami.PluginsLocator; |
4 |
import org.gvsig.andami.actioninfo.ActionInfo; |
5 |
import org.gvsig.andami.actioninfo.ActionInfoManager; |
6 |
import org.gvsig.andami.plugins.Extension; |
7 |
import org.gvsig.app.extension.develtools.ActionsInfoDevelTool; |
8 |
import org.gvsig.app.extension.develtools.IconThemeDevelTool; |
9 |
import org.gvsig.app.extension.develtools.MenusDevelTool; |
10 |
import org.gvsig.app.extension.develtools.PersistenceDevelTool; |
11 |
import org.gvsig.tools.ToolsLocator; |
12 |
import org.gvsig.tools.persistence.PersistenceManager; |
13 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
14 |
import org.slf4j.Logger; |
15 |
import org.slf4j.LoggerFactory; |
16 |
|
17 |
public class ShowDevelInfoExtension extends Extension { |
18 |
|
19 |
private static Logger logger = LoggerFactory |
20 |
.getLogger(ShowDevelInfoExtension.class); |
21 |
|
22 |
public void initialize() { |
23 |
// Do nothing
|
24 |
} |
25 |
|
26 |
public void postInitialize() { |
27 |
super.postInitialize();
|
28 |
// ActionInfoManager actionMgr = PluginsLocator.getActionInfoManager();
|
29 |
// actionMgr.redirect("tools-devel-disposables-show-pendings", "layer-info-by-point");
|
30 |
|
31 |
PersistenceManager manager = ToolsLocator.getPersistenceManager(); |
32 |
|
33 |
try {
|
34 |
manager.setAutoValidation(PersistenceManager.MANDATORY_IF_DECLARED); |
35 |
} catch (PersistenceException e) {
|
36 |
logger.warn( |
37 |
"Error modificando el modo de autovalidacion de persistencia.",
|
38 |
e); |
39 |
} |
40 |
|
41 |
} |
42 |
|
43 |
public void execute(String actionCommand) { |
44 |
if ("tools-devel-show-persistencefactories".equalsIgnoreCase(actionCommand)) { |
45 |
new PersistenceDevelTool().showPersistenceFactories();
|
46 |
} else if ("tools-devel-show-icontheme".equalsIgnoreCase(actionCommand)) { |
47 |
new IconThemeDevelTool().showDefaultIconTheme();
|
48 |
} else if ("tools-devel-show-actions".equalsIgnoreCase(actionCommand)) { |
49 |
new ActionsInfoDevelTool().showActions();
|
50 |
} else if ("tools-devel-show-menus".equalsIgnoreCase(actionCommand)) { |
51 |
new MenusDevelTool().showAllMenus();
|
52 |
} else if ("tools-devel-show-menus-by-plugin".equalsIgnoreCase(actionCommand)) { |
53 |
new MenusDevelTool().showAllMenusByPlugin();
|
54 |
} |
55 |
} |
56 |
|
57 |
|
58 |
public boolean isEnabled() { |
59 |
return true; |
60 |
} |
61 |
|
62 |
public boolean isVisible() { |
63 |
return true; |
64 |
} |
65 |
} |