svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / toc / AbstractActionInfoAdapterToTocContextMenuAction.java @ 41082
History | View | Annotate | Download (1.48 KB)
1 | 41082 | jjdelcerro | package org.gvsig.app.project.documents.view.toc; |
---|---|---|---|
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.fmap.mapcontext.layers.FLayer; |
||
7 | import org.gvsig.tools.ToolsLocator; |
||
8 | import org.gvsig.tools.i18n.I18nManager; |
||
9 | |||
10 | public class AbstractActionInfoAdapterToTocContextMenuAction extends AbstractTocContextMenuAction { |
||
11 | |||
12 | protected ActionInfo action = null; |
||
13 | protected String group = null; |
||
14 | protected int groupOrder = 1; |
||
15 | protected int order = 1; |
||
16 | |||
17 | protected AbstractActionInfoAdapterToTocContextMenuAction(String actionName, String group, int groupOrder, int order) { |
||
18 | ActionInfoManager actionManager = PluginsLocator.getActionInfoManager(); |
||
19 | this.action = actionManager.getAction(actionName);
|
||
20 | this.group = group;
|
||
21 | this.groupOrder = groupOrder;
|
||
22 | this.order = order;
|
||
23 | } |
||
24 | |||
25 | public String getGroup() { |
||
26 | return this.group; |
||
27 | } |
||
28 | |||
29 | public int getGroupOrder() { |
||
30 | return this.groupOrder; |
||
31 | } |
||
32 | |||
33 | public int getOrder() { |
||
34 | return this.order; |
||
35 | } |
||
36 | |||
37 | public String getText() { |
||
38 | I18nManager i18nManager = ToolsLocator.getI18nManager(); |
||
39 | return i18nManager.getTranslation( this.action.getLabel() ); |
||
40 | } |
||
41 | |||
42 | public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
||
43 | return this.action.isEnabled(); |
||
44 | } |
||
45 | |||
46 | public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
||
47 | return this.action.isVisible(); |
||
48 | } |
||
49 | |||
50 | public void execute(ITocItem item, FLayer[] selectedItems) { |
||
51 | this.action.execute(selectedItems);
|
||
52 | } |
||
53 | } |