Revision 42807 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/paging/impl/FeaturePagingHelperImpl.java

View differences:

FeaturePagingHelperImpl.java
80 80
    private Feature[] features = null;
81 81

  
82 82
    private boolean initialization_completed = false;
83

  
84
    private FeatureSelection selection = null;
83 85
    /**
84 86
     * Constructs a FeaturePagingHelperImpl from data of a FeatureStore.
85 87
     *
......
173 175
    public boolean isSelectionUp() {
174 176
        return selectionUp;
175 177
    }
176

  
178
    
179
    public FeatureSelection getSelection() {
180
        if (selection == null) {
181
            try {
182
                return getFeatureStore().getFeatureSelection();
183
            } catch (Exception e) {
184
                LOG.warn("Error getting the selection", e);
185
            }
186
        }
187
        return selection;
188
    }
189
    
190
    public void setSelection(FeatureSelection selection) {
191
        this.selection = selection;
192
    }
193
    
194
    @Override
177 195
    public void setSelectionUp(boolean selectionUp) {
178 196
        this.selectionUp = selectionUp;
179 197
        try {
180
            FeatureSelection currentSelection = getFeatureStore().getFeatureSelection();
198
            FeatureSelection currentSelection = getSelection();
181 199
            if (selectionUp && !currentSelection.isEmpty()) {
182 200
                initialSelection =(FeatureSelection) currentSelection.clone();
183 201
                setCalculator(new OneSubsetOneSetPagingCalculator(

Also available in: Unified diff