root / tags / v2_0_0_Build_2056 / extensions / extEditing / src / org / gvsig / editing / project / documents / view / toc / actions / StopEditingTocMenuEntry.java @ 39004
History | View | Annotate | Download (1.38 KB)
1 |
package org.gvsig.editing.project.documents.view.toc.actions; |
---|---|
2 |
|
3 |
import org.gvsig.andami.PluginServices; |
4 |
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction; |
5 |
import org.gvsig.app.project.documents.view.toc.ITocItem; |
6 |
import org.gvsig.editing.StopEditing; |
7 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
8 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
9 |
|
10 |
|
11 |
/**
|
12 |
* Termina la edici?n de la capa seleccionada.
|
13 |
*
|
14 |
* @author Vicente Caballero Navarro
|
15 |
*/
|
16 |
public class StopEditingTocMenuEntry extends AbstractTocContextMenuAction { |
17 |
public String getGroup() { |
18 |
return "edition"; |
19 |
} |
20 |
|
21 |
public int getGroupOrder() { |
22 |
return 1; |
23 |
} |
24 |
|
25 |
public int getOrder() { |
26 |
return 2; |
27 |
} |
28 |
|
29 |
public String getText() { |
30 |
return PluginServices.getText(this, "stop_edition"); |
31 |
} |
32 |
|
33 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
34 |
return true; |
35 |
} |
36 |
|
37 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
38 |
return (isTocItemBranch(item)) && (selectedItems.length == 1 && selectedItems[0].isAvailable() && selectedItems[0] instanceof FLyrVect) && ((FLyrVect)selectedItems[0]).isEditing(); |
39 |
} |
40 |
|
41 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
42 |
StopEditing stopEditind=(StopEditing)PluginServices.getExtension(StopEditing.class); |
43 |
stopEditind.execute("layer-stop-editing");
|
44 |
// This is done inside execute
|
45 |
// PluginServices.getMainFrame().enableControls();
|
46 |
} |
47 |
} |