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