Revision 46482
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 | ||
---|---|---|
919 | 919 |
} |
920 | 920 |
|
921 | 921 |
@Override |
922 |
public void search() {
|
|
922 |
public int search() {
|
|
923 | 923 |
StringBuilder message = new StringBuilder(); |
924 | 924 |
if (!this.isValid(message)) { |
925 | 925 |
ThreadSafeDialogsManager dialogManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
... | ... | |
928 | 928 |
"_Search", |
929 | 929 |
JOptionPane.WARNING_MESSAGE |
930 | 930 |
); |
931 |
return; |
|
931 |
return STATUS_NOT_VALID;
|
|
932 | 932 |
} |
933 | 933 |
lblMsg.setText(ToolsLocator.getI18nManager().getTranslation("_Searching") + "..."); |
934 | 934 |
setEnabled(false); |
... | ... | |
959 | 959 |
} |
960 | 960 |
}); |
961 | 961 |
th.start(); |
962 |
return STATUS_OK; |
|
962 | 963 |
} |
963 | 964 |
|
964 |
private void doSearch(SearchParameters searchParams) { |
|
965 |
public int search(SearchParameters searchParams) { |
|
966 |
return search(searchParams); |
|
967 |
} |
|
968 |
|
|
969 |
private int doSearch(SearchParameters searchParams) { |
|
965 | 970 |
final MutableObject model = new MutableObject(null); |
966 | 971 |
final MutableLong rowCount = new MutableLong(); |
967 | 972 |
Cursor savedCursor = this.getCursor(); |
... | ... | |
996 | 1001 |
status.setTitle(ToolsLocator.getI18nManager().getTranslation("_Errors_getting_new_feature_set") + "..."); |
997 | 1002 |
status.abort(); |
998 | 1003 |
resetTable(); |
1004 |
return STATUS_ERROR1; |
|
999 | 1005 |
} finally { |
1000 | 1006 |
SwingUtilities.invokeLater(() -> { |
1001 | 1007 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
... | ... | |
1025 | 1031 |
} |
1026 | 1032 |
}); |
1027 | 1033 |
} |
1034 |
return STATUS_OK; |
|
1028 | 1035 |
} |
1029 | 1036 |
|
1037 |
@Override |
|
1038 |
public SimpleFeaturesTableModel getResultsTableModel() { |
|
1039 |
return this.resultModel; |
|
1040 |
} |
|
1041 |
|
|
1030 | 1042 |
private Map<String, TableCellRenderer> getCustomRenderers(SearchParameters parameters) { |
1031 | 1043 |
FeatureType ft = this.store.getDefaultFeatureTypeQuietly(); |
1032 | 1044 |
HashMap<String, TableCellRenderer> renderers = new HashMap<String, TableCellRenderer>(); |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.api/src/main/java/org/gvsig/fmap/dal/swing/searchpanel/FeatureStoreSearchPanel.java | ||
---|---|---|
7 | 7 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
8 | 8 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
9 | 9 |
import org.gvsig.fmap.dal.feature.FeatureType; |
10 |
import org.gvsig.fmap.dal.swing.featuretable.SimpleFeaturesTableModel; |
|
10 | 11 |
import org.gvsig.tools.dispose.Disposable; |
11 | 12 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
12 | 13 |
import org.gvsig.tools.swing.api.Component; |
... | ... | |
29 | 30 |
public static final int NULL_AS_TRUE = 1; |
30 | 31 |
public static final int NULL_AS_FALSE = 2; |
31 | 32 |
|
33 |
public static final int STATUS_OK = 0; |
|
34 |
public static final int STATUS_NOT_VALID = 1; |
|
35 |
public static final int STATUS_ERROR1 = 2; |
|
36 |
public static final int STATUS_ERROR2 = 3; |
|
37 |
|
|
32 | 38 |
public void clear(); |
33 | 39 |
|
34 | 40 |
public void setEnabled(boolean enabled); |
... | ... | |
59 | 65 |
|
60 | 66 |
public SearchConditionPanel getConditionPanel(String name); |
61 | 67 |
|
62 |
public void search(); |
|
68 |
/** |
|
69 |
* Performs the search with the existing values in the user |
|
70 |
* interface asynchronously. |
|
71 |
* |
|
72 |
* @return status of the search (ok, error,...) |
|
73 |
*/ |
|
74 |
public int search(); |
|
63 | 75 |
|
64 |
public void put(SearchParameters inParams); |
|
76 |
/** |
|
77 |
* Performs the search with the indicated parameters synchronously. |
|
78 |
* |
|
79 |
* @param params |
|
80 |
* @return status of the search (ok, error,...) |
|
81 |
*/ |
|
82 |
public int search(SearchParameters params); |
|
83 |
|
|
84 |
public SimpleFeaturesTableModel getResultsTableModel(); |
|
85 |
|
|
86 |
public void put(SearchParameters params); |
|
65 | 87 |
|
66 |
public SearchParameters fetch(SearchParameters inParams);
|
|
88 |
public SearchParameters fetch(SearchParameters params);
|
|
67 | 89 |
|
68 | 90 |
public void setFilterOnlyMode(boolean filterOnlyMode); |
69 | 91 |
|
Also available in: Unified diff