Revision 45247
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/searchpanel/DefaultSearchPanel.java | ||
---|---|---|
22 | 22 |
import java.util.List; |
23 | 23 |
import java.util.Map; |
24 | 24 |
import java.util.Objects; |
25 |
import java.util.logging.Level; |
|
25 | 26 |
import javax.swing.AbstractAction; |
26 | 27 |
import javax.swing.Action; |
27 | 28 |
import static javax.swing.Action.ACTION_COMMAND_KEY; |
... | ... | |
52 | 53 |
import org.gvsig.fmap.dal.DataStore; |
53 | 54 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
54 | 55 |
import org.gvsig.fmap.dal.complements.Search; |
56 |
import org.gvsig.fmap.dal.exception.DataException; |
|
55 | 57 |
import org.gvsig.fmap.dal.feature.Feature; |
56 | 58 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
57 | 59 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
... | ... | |
588 | 590 |
dispose(); |
589 | 591 |
} |
590 | 592 |
}); |
591 |
this.tblResults.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
|
593 |
this.tblResults.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
|
592 | 594 |
this.tblResults.addKeyListener(new KeyAdapter() { |
593 | 595 |
@Override |
594 | 596 |
public void keyPressed(KeyEvent e) { |
... | ... | |
656 | 658 |
FeatureQuery emptyQuery = this.store.createFeatureQuery(); |
657 | 659 |
emptyQuery.retrievesAllAttributes(); |
658 | 660 |
this.parameters.setQuery(emptyQuery); |
661 |
// Mantener las columnas visualizadas |
|
662 |
// Elimina las que no existen en el store como campos calculados que |
|
663 |
// pudieran existir en el fquery |
|
664 |
List<String> resultColumnNames = this.parameters.getResultColumnNames(); |
|
665 |
ArrayList<String> toDeleteAlreadyDontExist = new ArrayList<String>(); |
|
666 |
for (String resultColumnName : resultColumnNames) { |
|
667 |
try { |
|
668 |
FeatureAttributeDescriptor attr = this.store.getDefaultFeatureType().getAttributeDescriptor(resultColumnName); |
|
669 |
if (attr == null) { |
|
670 |
toDeleteAlreadyDontExist.add(attr.getName()); |
|
671 |
} |
|
672 |
} catch (DataException ex) { |
|
673 |
|
|
674 |
} |
|
675 |
} |
|
676 |
resultColumnNames.removeAll(toDeleteAlreadyDontExist); |
|
659 | 677 |
resetTable(); |
660 | 678 |
} |
661 | 679 |
|
Also available in: Unified diff