//if the filter action is true, filter our results by the AOI service
if(isAOIFilter()){
filter = addAOIFilter(filter, schema.getCoordinateReferenceSystem());
}
final Query query = new DefaultQuery(schema.getName().getLocalPart(), filter, queryAtts.toArray(new String[0]));
FeatureCollection<SimpleFeatureType, SimpleFeature> featuresF = featureSource.getFeatures(query);
final FeatureCollection<SimpleFeatureType, SimpleFeature> features = featuresF;
Display.getDefault().asyncExec(new Runnable(){
public void run() {
if (!table.showWarning(table.getControl().getDisplay())){
//user doesn't want to show table.
return;
}
// we don't need to display the geometries, that's what the map is for.
queryAtts.add(0,ANY);
queryAtts.add(CQL);
attributeCombo.setItems(queryAtts.toArray(new String[0]));
attributeCombo.select(0);
AdaptableFeatureCollection adaptableCollection = new AdaptableFeatureCollection(features);
adaptableCollection.addAdapter(featureSource); // used to listen for changes
if( featureSource instanceof FeatureStore )
enableEditing(featureTypeCellModifier, query, adaptableCollection);
table.setFeatures(adaptableCollection);
}
private void enableEditing( final FeatureTypeCellModifier featureTypeCellModifier, final Query query, AdaptableFeatureCollection adaptableCollection ) {
adaptableCollection.addAdapter(featureTypeCellModifier);
ICellEditorListener[] keyBindingActivators=new ICellEditorListener[query.getPropertyNames().length];
for( int i = 0; i < keyBindingActivators.length; i++ ) {
keyBindingActivators[i]=new ICellEditorListener(){
public void applyEditorValue() {
ApplicationGIS.getToolManager().registerActionsWithPart(TableView.this);
}