Revision 45246 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 | ||
---|---|---|
653 | 653 |
for (SearchConditionPanel conditionPanel : conditionPanels) { |
654 | 654 |
conditionPanel.clear(); |
655 | 655 |
} |
656 |
FeatureQuery emptyQuery = this.store.createFeatureQuery(); |
|
657 |
emptyQuery.retrievesAllAttributes(); |
|
658 |
this.parameters.setQuery(emptyQuery); |
|
659 |
resetTable(); |
|
656 | 660 |
} |
657 | 661 |
|
658 | 662 |
@Override |
... | ... | |
1022 | 1026 |
|
1023 | 1027 |
WindowManager_v2 winmanager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
1024 | 1028 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
1025 |
final FeatureQueryGroupByPanel panel = new DefaultFeatureQueryGroupByPanel(); |
|
1026 |
panel.setStore(this.store); |
|
1027 |
panel.put(this.parameters.getQuery()); |
|
1029 |
final FeatureQueryGroupByPanel panelGroupBy = new DefaultFeatureQueryGroupByPanel();
|
|
1030 |
panelGroupBy.setStore(this.store);
|
|
1031 |
panelGroupBy.put(this.parameters.getQuery());
|
|
1028 | 1032 |
final Dialog dialog = winmanager.createDialog( |
1029 |
panel.asJComponent(), |
|
1033 |
panelGroupBy.asJComponent(),
|
|
1030 | 1034 |
i18n.getTranslation("_Select_group_columns_and_aggregate_functions"), |
1031 | 1035 |
null, |
1032 | 1036 |
WindowManager_v2.BUTTONS_OK_CANCEL |
1033 | 1037 |
); |
1034 | 1038 |
dialog.addActionListener((ActionEvent e) -> { |
1035 | 1039 |
if (dialog.getAction() == WindowManager_v2.BUTTONS_OK) { |
1036 |
panel.fetch(this.parameters.getQuery()); |
|
1040 |
panelGroupBy.fetch(this.parameters.getQuery());
|
|
1037 | 1041 |
search(); |
1038 | 1042 |
} |
1039 | 1043 |
}); |
... | ... | |
1043 | 1047 |
private void doSelectResultColumnNames() { |
1044 | 1048 |
WindowManager_v2 winmanager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
1045 | 1049 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
1046 |
final FeatureAttributesSelectionPanel panel = DALSwingLocator.getManager().createFeatureAttributeSelectionPanel(); |
|
1047 |
panel.allowCalculatedAttributes(false); |
|
1050 |
final FeatureAttributesSelectionPanel panelSelectColumns = DALSwingLocator.getManager().createFeatureAttributeSelectionPanel();
|
|
1051 |
panelSelectColumns.allowCalculatedAttributes(false);
|
|
1048 | 1052 |
FeatureType ftype = this.getFeatureType(); |
1049 | 1053 |
try { |
1050 | 1054 |
Feature f = store.findFirst(this.parameters.getQuery()); |
... | ... | |
1054 | 1058 |
} catch (Throwable ex) { |
1055 | 1059 |
LOGGER.warn("Can't retrieve the feature type from the first feature.",ex); |
1056 | 1060 |
} |
1057 |
panel.setFeatureType(ftype); |
|
1058 |
panel.setSelectedNames(this.parameters.getResultColumnNames()); |
|
1061 |
panelSelectColumns.setFeatureType(ftype);
|
|
1062 |
panelSelectColumns.setSelectedNames(this.parameters.getResultColumnNames());
|
|
1059 | 1063 |
final Dialog dialog = winmanager.createDialog( |
1060 |
panel.asJComponent(), |
|
1064 |
panelSelectColumns.asJComponent(),
|
|
1061 | 1065 |
i18n.getTranslation("_Select_the_columns_to_display"), |
1062 | 1066 |
null, |
1063 | 1067 |
WindowManager_v2.BUTTONS_OK_CANCEL |
1064 | 1068 |
); |
1065 | 1069 |
dialog.addActionListener((ActionEvent e) -> { |
1066 | 1070 |
if (dialog.getAction() == WindowManager_v2.BUTTONS_OK) { |
1067 |
this.setResultColumnNames(panel.getSelectedNames()); |
|
1071 |
this.setResultColumnNames(panelSelectColumns.getSelectedNames());
|
|
1068 | 1072 |
} |
1069 | 1073 |
}); |
1070 | 1074 |
dialog.show(WindowManager.MODE.DIALOG); |
Also available in: Unified diff