Revision 9532 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/actions/PasteLayersTocMenuEntry.java
PasteLayersTocMenuEntry.java | ||
---|---|---|
4 | 4 |
import org.exolab.castor.xml.ValidationException; |
5 | 5 |
|
6 | 6 |
import com.iver.andami.PluginServices; |
7 |
import com.iver.cit.gvsig.ProjectExtension; |
|
7 | 8 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
8 | 9 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
10 |
import com.iver.cit.gvsig.project.Project; |
|
9 | 11 |
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction; |
10 | 12 |
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem; |
11 | 13 |
import com.iver.utiles.XMLEntity; |
... | ... | |
13 | 15 |
public class PasteLayersTocMenuEntry extends AbstractTocContextMenuAction { |
14 | 16 |
private XMLEntity xml=null; |
15 | 17 |
private CopyPasteLayersUtiles utiles = CopyPasteLayersUtiles.getInstance(); |
16 |
|
|
17 | 18 |
|
19 |
|
|
18 | 20 |
public String getGroup() { |
19 | 21 |
return "copyPasteLayer"; |
20 | 22 |
} |
... | ... | |
52 | 54 |
String sourceString = PluginServices.getFromClipboard(); |
53 | 55 |
if (sourceString == null) return null; |
54 | 56 |
|
55 |
XMLEntity xml;
|
|
57 |
XMLEntity xml; |
|
56 | 58 |
try { |
57 | 59 |
xml = XMLEntity.parse(sourceString); |
58 | 60 |
} catch (MarshalException e) { |
... | ... | |
60 | 62 |
} catch (ValidationException e) { |
61 | 63 |
return null; |
62 | 64 |
} |
63 |
|
|
64 | 65 |
|
66 |
|
|
65 | 67 |
if (!this.utiles.checkXMLRootNode(xml)) return null; |
66 | 68 |
|
67 | 69 |
if (xml.findChildren("type","layers") == null) return null; |
... | ... | |
87 | 89 |
|
88 | 90 |
getMapContext().endAtomicEvent(); |
89 | 91 |
|
90 |
if (isOK) getMapContext().invalidate(); |
|
92 |
if (isOK) { |
|
93 |
getMapContext().invalidate(); |
|
94 |
Project project=((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject(); |
|
95 |
project.setModified(true); |
|
96 |
} |
|
91 | 97 |
} |
92 | 98 |
|
93 | 99 |
|
Also available in: Unified diff