Revision 44113 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureSelection.java
DefaultFeatureSelection.java | ||
---|---|---|
34 | 34 |
import org.gvsig.fmap.dal.exception.DataRuntimeException; |
35 | 35 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
36 | 36 |
import org.gvsig.fmap.dal.feature.Feature; |
37 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
37 | 38 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
38 | 39 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
39 | 40 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
40 | 41 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
42 |
import org.gvsig.fmap.dal.feature.FeatureStoreNotification; |
|
41 | 43 |
import org.gvsig.fmap.dal.feature.FeatureType; |
42 | 44 |
import org.gvsig.fmap.dal.feature.exception.ReversedSelectionIteratorException; |
43 | 45 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeatureReferenceSelection.SelectionData; |
44 | 46 |
import org.gvsig.fmap.dal.feature.impl.featureset.AbstractFeatureSet; |
47 |
import org.gvsig.fmap.dal.feature.impl.featureset.DefaultFeatureSet; |
|
45 | 48 |
import org.gvsig.fmap.dal.feature.impl.undo.FeatureCommandsStack; |
46 | 49 |
import org.gvsig.tools.ToolsLocator; |
47 | 50 |
import org.gvsig.tools.dispose.DisposableIterator; |
... | ... | |
191 | 194 |
|
192 | 195 |
// Load a Set with all the store features |
193 | 196 |
try { |
194 |
featureSet = featureStore.getFeatureSet(); |
|
195 |
//if (fastIterator) { |
|
197 |
featureSet = new IgnoreInsertAndUpdateFeatureSet( |
|
198 |
(DefaultFeatureStore) featureStore, |
|
199 |
new DefaultFeatureQuery(featureStore.getDefaultFeatureType()) |
|
200 |
); |
|
196 | 201 |
iterator = featureSet.fastIterator(); |
197 |
// } else { |
|
198 |
// iterator = featureSet.iterator(); |
|
199 |
// } |
|
200 | 202 |
} catch (DataException ex) { |
201 | 203 |
throw new ReversedSelectionIteratorException(ex); |
202 | 204 |
} |
... | ... | |
764 | 766 |
} |
765 | 767 |
} |
766 | 768 |
|
769 |
private static class IgnoreInsertAndUpdateFeatureSet extends DefaultFeatureSet { |
|
770 |
|
|
771 |
public IgnoreInsertAndUpdateFeatureSet(DefaultFeatureStore store, FeatureQuery query) throws DataException { |
|
772 |
super(store, query); |
|
773 |
} |
|
774 |
|
|
775 |
public void update(Observable obsevable, Object notification) { |
|
776 |
String type = ((FeatureStoreNotification) notification).getType(); |
|
777 |
if (type.equalsIgnoreCase(FeatureStoreNotification.AFTER_INSERT) |
|
778 |
|| type.equalsIgnoreCase(FeatureStoreNotification.AFTER_UPDATE)) { |
|
779 |
return; |
|
780 |
} |
|
781 |
super.update(obsevable, notification); |
|
782 |
} |
|
783 |
|
|
784 |
} |
|
785 |
|
|
786 |
|
|
767 | 787 |
} |
Also available in: Unified diff