Revision 47418
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 | ||
---|---|---|
1336 | 1336 |
if( selectedRows.length > maxfeatures ) { |
1337 | 1337 |
this.taskStatusController.message("Too many items selecteds"); |
1338 | 1338 |
} |
1339 |
if (this.tabResults.getSelectedIndex() == 1) { |
|
1339 |
if (this.tabResults.getSelectedIndex() == 0) { |
|
1340 |
try { |
|
1341 |
FeatureType ftype = this.store.getDefaultFeatureType(); |
|
1342 |
ExpressionBuilder builder = ExpressionUtils.createExpressionBuilder(); |
|
1343 |
List<Feature> features = ((SimpleFeaturesTableModelImpl) this.tblResults.getModel()).getFeatures(); |
|
1344 |
for (int i = 0; i < selectedRows.length && i<maxfeatures ; i++) { |
|
1345 |
Feature feature = features.get(selectedRows[i]); |
|
1346 |
for (FeatureAttributeDescriptor attrdesc : ftype.getPrimaryKey()) { |
|
1347 |
builder.or( |
|
1348 |
builder.eq( |
|
1349 |
builder.column(attrdesc.getName()), |
|
1350 |
builder.constant(feature.get(attrdesc.getName())) |
|
1351 |
) |
|
1352 |
); |
|
1353 |
} |
|
1354 |
} |
|
1355 |
Expression filter = ExpressionUtils.createExpression(builder.toString()); |
|
1356 |
return filter; |
|
1357 |
} catch (Exception ex) { |
|
1358 |
LOGGER.warn("Can't build search for the selected feature.", ex); |
|
1359 |
return null; |
|
1360 |
} |
|
1361 |
} else { |
|
1340 | 1362 |
if (this.currentPostProcess == null) { |
1341 | 1363 |
return null; |
1342 | 1364 |
} |
... | ... | |
1347 | 1369 |
Feature feature = features.get(selectedRows[i]); |
1348 | 1370 |
FeatureType ftype = this.postProcessStore.getDefaultFeatureType(); |
1349 | 1371 |
for (FeatureAttributeDescriptor attrdesc : ftype.getPrimaryKey()) { |
1350 |
builder.and(
|
|
1372 |
builder.or(
|
|
1351 | 1373 |
builder.eq( |
1352 | 1374 |
builder.column(attrdesc.getName()), |
1353 | 1375 |
builder.constant(feature.get(attrdesc.getName())) |
... | ... | |
1361 | 1383 |
LOGGER.warn("Can't build search for the selected feature.", ex); |
1362 | 1384 |
return null; |
1363 | 1385 |
} |
1364 |
} else { |
|
1365 |
try { |
|
1366 |
FeatureType ftype = this.store.getDefaultFeatureType(); |
|
1367 |
ExpressionBuilder builder = ExpressionUtils.createExpressionBuilder(); |
|
1368 |
List<Feature> features = ((SimpleFeaturesTableModelImpl) this.tblResults.getModel()).getFeatures(); |
|
1369 |
for (int i = 0; i < selectedRows.length && i<maxfeatures ; i++) { |
|
1370 |
Feature feature = features.get(selectedRows[i]); |
|
1371 |
for (FeatureAttributeDescriptor attrdesc : ftype.getPrimaryKey()) { |
|
1372 |
builder.and( |
|
1373 |
builder.eq( |
|
1374 |
builder.column(attrdesc.getName()), |
|
1375 |
builder.constant(feature.get(attrdesc.getName())) |
|
1376 |
) |
|
1377 |
); |
|
1378 |
} |
|
1379 |
} |
|
1380 |
Expression filter = ExpressionUtils.createExpression(builder.toString()); |
|
1381 |
return filter; |
|
1382 |
} catch (Exception ex) { |
|
1383 |
LOGGER.warn("Can't build search for the selected feature.", ex); |
|
1384 |
return null; |
|
1385 |
} |
|
1386 | 1386 |
} |
1387 | 1387 |
} |
1388 | 1388 |
|
Also available in: Unified diff