22 |
22 |
import org.gvsig.fmap.dal.swing.DataSwingManager;
|
23 |
23 |
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.AggregateOperation.AggregateOperationFactory;
|
24 |
24 |
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.FirstAggregateOperation.FirstAggregateOperationFactory;
|
|
25 |
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.NullAggregateOperation.NullAggregateOperationFactory;
|
25 |
26 |
import org.gvsig.fmap.dal.swing.searchPostProcess.AbstractSearchPostProcessFactory;
|
26 |
27 |
import org.gvsig.fmap.dal.swing.searchPostProcess.SearchPostProcess;
|
27 |
28 |
import org.gvsig.fmap.dal.swing.searchPostProcess.SearchPostProcessFactory;
|
... | ... | |
162 |
163 |
if (StringUtils.equals(featureAttributeDescriptor.getName(), attr)) {
|
163 |
164 |
Class attrClass = featureAttributeDescriptor.getDataType().getDefaultClass();
|
164 |
165 |
List<DynObjectValueItem> availableOperations = fillAggregateOperations (attrClass);
|
165 |
|
String newOperation = getOperation(attrClass, operation);
|
166 |
166 |
if (availableOperations.size() > 0) {
|
167 |
167 |
if(searchParams.getResultColumnNames().contains(attr)){
|
|
168 |
String newOperation = getOperation(attrClass, operation);
|
168 |
169 |
dynField = (DynField_v2) dynClass.addDynFieldString(attr);
|
169 |
170 |
dynField.setAvailableValues(availableOperations);
|
170 |
171 |
dynField.setDefaultFieldValue(newOperation);
|
171 |
172 |
dynField.setGroup(i18n.getTranslation("_Visible_columns"));
|
172 |
173 |
dynField.setOrder(2000+n);
|
173 |
174 |
} else {
|
|
175 |
String newOperation = getOperation(attrClass, NullAggregateOperationFactory.NAME);
|
174 |
176 |
dynField = (DynField_v2) dynClass.addDynFieldString(attr);
|
175 |
177 |
dynField.setAvailableValues(availableOperations);
|
176 |
178 |
dynField.setDefaultFieldValue(newOperation);
|
... | ... | |
185 |
187 |
if (StringUtils.equals(extraColumns.get(i).getName(), attr)) {
|
186 |
188 |
Class attrClass = ((FeatureAttributeDescriptor) extraColumns.get(i)).getDataType().getDefaultClass();;
|
187 |
189 |
List<DynObjectValueItem> availableOperations = fillAggregateOperations (attrClass);
|
188 |
|
String newOperation = getOperation(attrClass, operation);
|
189 |
190 |
if (availableOperations.size() > 0) {
|
190 |
191 |
if(searchParams.getResultColumnNames().contains(attr)){
|
|
192 |
String newOperation = getOperation(attrClass, operation);
|
191 |
193 |
dynField = (DynField_v2) dynClass.addDynFieldString(attr);
|
192 |
194 |
dynField.setAvailableValues(availableOperations);
|
193 |
195 |
dynField.setDefaultFieldValue(newOperation);
|
194 |
196 |
dynField.setGroup(i18n.getTranslation("_Visible_columns"));
|
195 |
197 |
dynField.setOrder(2000+n);
|
196 |
198 |
} else {
|
|
199 |
String newOperation = getOperation(attrClass, NullAggregateOperationFactory.NAME);
|
197 |
200 |
dynField = (DynField_v2) dynClass.addDynFieldString(attr);
|
198 |
201 |
dynField.setAvailableValues(availableOperations);
|
199 |
202 |
dynField.setDefaultFieldValue(newOperation);
|
... | ... | |
286 |
289 |
private List<DynObjectValueItem> getAtributeNames(FeatureStore input) {
|
287 |
290 |
FeatureType ft = input.getDefaultFeatureTypeQuietly();
|
288 |
291 |
List<DynObjectValueItem> values = new ArrayList();
|
|
292 |
I18nManager i18n = ToolsLocator.getI18nManager();
|
289 |
293 |
for (FeatureAttributeDescriptor attr : ft) {
|
290 |
294 |
DataType dataType = attr.getDataType();
|
291 |
295 |
if (!dataType.isContainer()){
|
292 |
|
values.add( new DynObjectValueItem(attr.getName(), attr.getLabel()));
|
|
296 |
values.add( new DynObjectValueItem(attr.getName(), i18n.getTranslation(attr.getLabel())));
|
293 |
297 |
}
|
294 |
298 |
}
|
295 |
299 |
// return values.toArray(new DynObjectValueItem[values.size()]);
|