Revision 41094
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/actions/CopyPasteLayersUtils.java | ||
---|---|---|
139 | 139 |
} |
140 | 140 |
|
141 | 141 |
} |
142 |
|
|
143 |
public static boolean isClipboardEmpty() { |
|
144 |
File f = new File(getClipboardFolder(), CLIPBOARD_FILE_NAME); |
|
145 |
return !f.exists(); |
|
146 |
} |
|
142 | 147 |
|
143 | 148 |
/** |
144 | 149 |
* Returns the content of the clipboard as an instance |
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/actions/PasteLayersTocMenuEntry.java | ||
---|---|---|
67 | 67 |
if (isTocItemBranch(item)) { |
68 | 68 |
FLayer lyr = getNodeLayer(item); |
69 | 69 |
if (lyr instanceof FLayers) { |
70 |
FLayers aux = this.getFLayersFromClipboard(); |
|
71 |
return aux != null; |
|
70 |
/* |
|
71 |
* We cannot parse it here because it can |
|
72 |
* lead to bad error dialog. We accept anything. |
|
73 |
* When user tries to paste, the error |
|
74 |
* message will show if there is a problem. |
|
75 |
*/ |
|
76 |
return !CopyPasteLayersUtils.isClipboardEmpty(); |
|
72 | 77 |
} |
73 | 78 |
|
74 | 79 |
} else if (!isTocItemLeaf(item)) { |
75 | 80 |
if (getNodeLayer(item) == null) { |
76 |
FLayers aux = this.getFLayersFromClipboard(); |
|
77 |
return aux != null; |
|
81 |
/* |
|
82 |
* We cannot parse it here because it can |
|
83 |
* lead to bad error dialog. We accept anything. |
|
84 |
* When user tries to paste, the error |
|
85 |
* message will show if there is a problem. |
|
86 |
*/ |
|
87 |
return !CopyPasteLayersUtils.isClipboardEmpty(); |
|
78 | 88 |
} |
79 | 89 |
} |
80 | 90 |
return false; |
Also available in: Unified diff