Revision 45295 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/actions/SelectionSetAction.java
SelectionSetAction.java | ||
---|---|---|
16 | 16 |
import org.slf4j.Logger; |
17 | 17 |
import org.slf4j.LoggerFactory; |
18 | 18 |
import org.gvsig.fmap.dal.swing.DALActionFactory.DALActionContext; |
19 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
19 | 20 |
|
20 | 21 |
/** |
21 | 22 |
* |
... | ... | |
64 | 65 |
|
65 | 66 |
@Override |
66 | 67 |
public void actionPerformed(ActionEvent e) { |
68 |
FeatureSet selection = null; |
|
67 | 69 |
try { |
68 | 70 |
DataStore store = this.context.getStore(); |
69 | 71 |
if( !(store instanceof FeatureStore) ) { |
... | ... | |
81 | 83 |
} |
82 | 84 |
FeatureQuery query = featureStore.createFeatureQuery(); |
83 | 85 |
query.setFilter(filter); |
84 |
FeatureSet selection = featureStore.getFeatureSet(query);
|
|
86 |
selection = featureStore.getFeatureSet(query); |
|
85 | 87 |
currentSelection.deselectAll(); |
86 | 88 |
currentSelection.select(selection); |
87 | 89 |
} catch (Exception ex) { |
88 | 90 |
LOGGER.warn("Can't build selecction.", ex); |
91 |
} finally { |
|
92 |
DisposeUtils.disposeQuietly(selection); |
|
89 | 93 |
} |
90 | 94 |
} |
91 | 95 |
|
Also available in: Unified diff