Revision 46371 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/clipboard/CopyFeaturesToClipboardExtension.java
CopyFeaturesToClipboardExtension.java | ||
---|---|---|
36 | 36 |
import org.gvsig.app.project.documents.view.ViewDocument; |
37 | 37 |
import org.gvsig.app.project.documents.view.ViewManager; |
38 | 38 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
39 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
39 | 40 |
import org.gvsig.fmap.mapcontext.MapContext; |
40 | 41 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
41 | 42 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
103 | 104 |
if( layer==null ) { |
104 | 105 |
return false; |
105 | 106 |
} |
106 |
if (!layer.isAvailable()) { |
|
107 |
if (!layer.isAvailable() || !layer.isVisible() ) {
|
|
107 | 108 |
// This can happen when opening a persisted project |
108 | 109 |
// and there is a "slow" layer (GeoDB) |
109 | 110 |
return false; |
110 | 111 |
} |
111 | 112 |
try { |
112 |
return !layer.getFeatureStore().isFeatureSelectionEmpty(); |
|
113 |
FeatureStore store = layer.getFeatureStore(); |
|
114 |
if( store==null ) { |
|
115 |
return false; |
|
116 |
} |
|
117 |
return !store.isFeatureSelectionEmpty(); |
|
113 | 118 |
} catch (Exception ex) { |
114 | 119 |
LOGGER.warn("Can't get selection from layer '"+layer.getName()+"'.", ex); |
115 | 120 |
return false; |
Also available in: Unified diff