Revision 10626 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/actions/EliminarCapaTocMenuEntry.java
EliminarCapaTocMenuEntry.java | ||
---|---|---|
9 | 9 |
import com.iver.cit.gvsig.ProjectExtension; |
10 | 10 |
import com.iver.cit.gvsig.fmap.layers.CancelationException; |
11 | 11 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
12 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
|
13 | 12 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData; |
14 | 13 |
import com.iver.cit.gvsig.project.Project; |
14 |
import com.iver.cit.gvsig.project.documents.ProjectDocument; |
|
15 | 15 |
import com.iver.cit.gvsig.project.documents.table.ProjectTable; |
16 |
import com.iver.cit.gvsig.project.documents.table.ProjectTableFactory; |
|
16 | 17 |
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction; |
17 | 18 |
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem; |
18 | 19 |
|
... | ... | |
61 | 62 |
* |
62 | 63 |
* $Id$ |
63 | 64 |
* $Log$ |
64 |
* Revision 1.3 2007-01-04 07:24:31 caballero |
|
65 |
* Revision 1.4 2007-03-06 16:37:08 caballero |
|
66 |
* Exceptions |
|
67 |
* |
|
68 |
* Revision 1.3 2007/01/04 07:24:31 caballero |
|
65 | 69 |
* isModified |
66 | 70 |
* |
67 | 71 |
* Revision 1.2 2006/12/19 09:09:07 jmvivo |
... | ... | |
122 | 126 |
getMapContext().beginAtomicEvent(); |
123 | 127 |
for (int i = actives.length-1; i>=0; i--){ |
124 | 128 |
try { |
129 |
//actives[i].getParentLayer().removeLayer(actives[i]); |
|
130 |
//FLayers lyrs=getMapContext().getLayers(); |
|
131 |
//lyrs.addLayer(actives[i]); |
|
125 | 132 |
actives[i].getParentLayer().removeLayer(actives[i]); |
126 |
FLayers lyrs=getMapContext().getLayers(); |
|
127 |
lyrs.addLayer(actives[i]); |
|
128 |
actives[i].getParentLayer().removeLayer(actives[i]); |
|
129 | 133 |
|
130 | 134 |
if (actives[i] instanceof AlphanumericData){ |
131 | 135 |
Project project = ((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject(); |
132 | 136 |
ProjectTable pt = project.getTable((AlphanumericData) actives[i]); |
133 | 137 |
|
134 |
ArrayList tables = project.getTables();
|
|
138 |
ArrayList tables = project.getDocumentsByType(ProjectTableFactory.registerName);
|
|
135 | 139 |
for (int j = 0; j < tables.size(); j++) { |
136 | 140 |
if (tables.get(j) == pt){ |
137 |
project.delTable(j);
|
|
141 |
project.delDocument((ProjectDocument)tables.get(j));
|
|
138 | 142 |
break; |
139 | 143 |
} |
140 | 144 |
} |
Also available in: Unified diff