Revision 41559 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/ViewManager.java
ViewManager.java | ||
---|---|---|
44 | 44 |
import org.gvsig.app.project.documents.gui.WindowLayout; |
45 | 45 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
46 | 46 |
import org.gvsig.app.project.documents.view.gui.ViewProperties; |
47 |
import org.gvsig.app.project.documents.view.toc.AbstractActionInfoAdapterToTocContextMenuAction; |
|
47 | 48 |
import org.gvsig.fmap.mapcontext.MapContext; |
48 | 49 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
49 | 50 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
... | ... | |
136 | 137 |
} |
137 | 138 |
|
138 | 139 |
public void addTOCContextAction(ActionInfo action) { |
139 |
this.addTOCContextAction(action.getName(), new ActionInfoAdapterToContextMenuAction(action)); |
|
140 |
this.addTOCContextAction(action.getName(), new ActionInfoAdapterToContextMenuAction(action, "default", 10000));
|
|
140 | 141 |
} |
141 | 142 |
|
142 |
class ActionInfoAdapterToContextMenuAction implements IContextMenuAction { |
|
143 |
ActionInfo action = null; |
|
144 |
ActionInfoAdapterToContextMenuAction(ActionInfo action) { |
|
145 |
this.action = action; |
|
143 |
public void addTOCContextAction(ActionInfo action, String group, int groupOrder) { |
|
144 |
this.addTOCContextAction(action.getName(), new ActionInfoAdapterToContextMenuAction(action, group, groupOrder)); |
|
145 |
} |
|
146 |
|
|
147 |
class ActionInfoAdapterToContextMenuAction extends AbstractActionInfoAdapterToTocContextMenuAction { |
|
148 |
|
|
149 |
ActionInfoAdapterToContextMenuAction(ActionInfo action, String group, int groupOrder) { |
|
150 |
super(action, group, groupOrder); |
|
146 | 151 |
} |
147 |
public boolean isVisible(Object item, Object[] selectedItems) { |
|
148 |
return this.action.isVisible(); |
|
149 |
} |
|
150 |
public boolean isEnabled(Object item, Object[] selectedItems) { |
|
151 |
return this.action.isEnabled(); |
|
152 |
} |
|
153 |
public void execute(Object item, Object[] selectedItems) { |
|
154 |
this.action.execute(selectedItems); |
|
155 |
} |
|
156 |
public String getGroup() { |
|
157 |
return null; |
|
158 |
} |
|
159 |
public int getGroupOrder() { |
|
160 |
return 0; |
|
161 |
} |
|
162 |
public int getOrder() { |
|
163 |
return (int) this.action.getPosition(); |
|
164 |
} |
|
165 |
public String getText() { |
|
166 |
return this.action.getLabel(); |
|
167 |
} |
|
168 |
public String getDescription() { |
|
169 |
return this.action.getTooltip(); |
|
170 |
} |
|
171 | 152 |
} |
172 | 153 |
|
154 |
/** |
|
155 |
* @deprecated use addTOCContextAction(ActionInfo action, String group, int groupOrder) |
|
156 |
* @param id |
|
157 |
* @param action |
|
158 |
*/ |
|
173 | 159 |
public void addTOCContextAction(String id, IContextMenuAction action) { |
174 | 160 |
initializeRegisterTOCActions(); |
175 | 161 |
ExtensionPoint exPoint = ToolsLocator.getExtensionPointManager().add( |
Also available in: Unified diff