Revision 45162 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
DefaultSearchPanel.java | ||
---|---|---|
37 | 37 |
import org.apache.commons.io.FilenameUtils; |
38 | 38 |
import org.apache.commons.lang.mutable.MutableObject; |
39 | 39 |
import org.apache.commons.lang3.StringUtils; |
40 |
import org.apache.commons.lang3.mutable.MutableLong; |
|
40 | 41 |
import org.gvsig.configurableactions.ConfigurableActionsMamager; |
41 | 42 |
import org.gvsig.expressionevaluator.Expression; |
42 | 43 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
... | ... | |
661 | 662 |
LOGGER.warn("Not able to create search parameters.", ex); |
662 | 663 |
return; |
663 | 664 |
} |
664 |
|
|
665 |
|
|
666 |
final MutableLong rowCount=new MutableLong(); |
|
665 | 667 |
try { |
666 | 668 |
final List<Feature> features; |
667 | 669 |
|
... | ... | |
669 | 671 |
features = store.getFeatures(myQuery, 20); |
670 | 672 |
FacadeOfAFeaturePagingHelper facade = (FacadeOfAFeaturePagingHelper) features; |
671 | 673 |
FeatureType ftype = facade.getFeaturePagingHelper().getFeatureSet().getDefaultFeatureType(); |
672 |
// al modelo le pasamos el ftype de esas features |
|
673 |
model.setValue(new SimpleFeaturesTableModel( |
|
674 |
ftype, |
|
675 |
searchParams.getResultColumnNames(), |
|
676 |
features |
|
677 |
) |
|
678 |
); |
|
674 |
// al modelo le pasamos el ftype de esas features |
|
675 |
SimpleFeaturesTableModel tableModel = new SimpleFeaturesTableModel( |
|
676 |
ftype, |
|
677 |
searchParams.getResultColumnNames(), |
|
678 |
features |
|
679 |
); |
|
680 |
model.setValue(tableModel); |
|
681 |
rowCount.setValue(tableModel.getRowCount()); |
|
679 | 682 |
} catch (Exception ex) { |
680 | 683 |
LOGGER.warn("Search not able to be executed. Can't get features or create table model", ex); |
681 | 684 |
} finally { |
... | ... | |
690 | 693 |
if( m.hasErrors() ) { |
691 | 694 |
lblMsg.setText("_Errors_occurred_during_search"); |
692 | 695 |
} else { |
693 |
lblMsg.setText(String.format("%d " + i18n.getTranslation("_elements"), m.getRowCount()));
|
|
696 |
lblMsg.setText(String.format("%d " + i18n.getTranslation("_elements"), rowCount.getValue()));
|
|
694 | 697 |
} |
695 | 698 |
setEnabled(true); |
696 | 699 |
}); |
Also available in: Unified diff