svn-gvsig-desktop / 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 @ 44880
History | View | Annotate | Download (40.5 KB)
1 |
package org.gvsig.fmap.dal.swing.impl.searchpanel; |
---|---|
2 |
|
3 |
import java.awt.BorderLayout; |
4 |
import java.awt.Cursor; |
5 |
import java.awt.Dimension; |
6 |
import java.awt.FlowLayout; |
7 |
import java.awt.event.ActionEvent; |
8 |
import java.awt.event.ActionListener; |
9 |
import java.net.URL; |
10 |
import java.text.DateFormat; |
11 |
import java.text.SimpleDateFormat; |
12 |
import java.util.ArrayList; |
13 |
import java.util.Calendar; |
14 |
import java.util.Collection; |
15 |
import java.util.Collections; |
16 |
import java.util.Date; |
17 |
import java.util.HashMap; |
18 |
import java.util.List; |
19 |
import java.util.Map; |
20 |
import javax.swing.AbstractAction; |
21 |
import javax.swing.Action; |
22 |
import static javax.swing.Action.ACTION_COMMAND_KEY; |
23 |
import static javax.swing.Action.NAME; |
24 |
import javax.swing.BorderFactory; |
25 |
import javax.swing.ImageIcon; |
26 |
import javax.swing.JButton; |
27 |
import javax.swing.JComponent; |
28 |
import javax.swing.JOptionPane; |
29 |
import javax.swing.SwingUtilities; |
30 |
import javax.swing.event.ListSelectionEvent; |
31 |
import javax.swing.event.ListSelectionListener; |
32 |
import javax.swing.table.TableModel; |
33 |
import org.apache.commons.io.FilenameUtils; |
34 |
import org.apache.commons.lang.mutable.MutableObject; |
35 |
import org.apache.commons.lang3.StringUtils; |
36 |
import org.gvsig.configurableactions.ConfigurableActionsMamager; |
37 |
import org.gvsig.expressionevaluator.Expression; |
38 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
39 |
import org.gvsig.expressionevaluator.ExpressionUtils; |
40 |
import static org.gvsig.fmap.dal.DataManager.DAL_USE_LABELS; |
41 |
import static org.gvsig.fmap.dal.DataManager.USE_LABELS_BOTH; |
42 |
import static org.gvsig.fmap.dal.DataManager.USE_LABELS_NO; |
43 |
import static org.gvsig.fmap.dal.DataManager.USE_LABELS_YES; |
44 |
import org.gvsig.fmap.dal.DataStore; |
45 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
46 |
import org.gvsig.fmap.dal.complements.Search; |
47 |
import org.gvsig.fmap.dal.exception.DataException; |
48 |
import org.gvsig.fmap.dal.feature.Feature; |
49 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
50 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
51 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
52 |
import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory; |
53 |
import org.gvsig.fmap.dal.feature.FeatureType; |
54 |
import org.gvsig.fmap.dal.feature.paging.FacadeOfAFeaturePagingHelper; |
55 |
import org.gvsig.fmap.dal.swing.AbstractDALActionFactory.AbstractDALActionContext; |
56 |
import org.gvsig.fmap.dal.swing.DALActionFactory; |
57 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
58 |
import org.gvsig.fmap.dal.swing.featurequery.FeatureQueryCalculatedColumnsPanel; |
59 |
import org.gvsig.fmap.dal.swing.impl.featuretable.SimpleFeaturesTableModel; |
60 |
import org.gvsig.fmap.dal.swing.impl.featurequery.DefaultFeatureQueryGroupByPanel; |
61 |
import org.gvsig.fmap.dal.swing.searchpanel.FeatureStoreSearchPanel; |
62 |
import org.gvsig.fmap.dal.swing.searchpanel.SearchConditionPanel; |
63 |
import org.gvsig.fmap.dal.swing.searchpanel.SearchConditionPanel.SearchConditionPanelFactory; |
64 |
import org.gvsig.tools.ToolsLocator; |
65 |
import org.gvsig.tools.dataTypes.DataType; |
66 |
import org.gvsig.tools.dynobject.Tags; |
67 |
import org.gvsig.tools.i18n.I18nManager; |
68 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
69 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
70 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
71 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
72 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
73 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
74 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
75 |
import org.gvsig.tools.util.ToolsUtilLocator; |
76 |
import org.slf4j.Logger; |
77 |
import org.slf4j.LoggerFactory; |
78 |
import org.gvsig.fmap.dal.swing.featurequery.FeatureQueryGroupByPanel; |
79 |
import org.gvsig.fmap.dal.swing.featurequery.FeatureQueryOrderPanel; |
80 |
import org.gvsig.fmap.dal.swing.impl.featurequery.DefaultFeatureQueryCalculatedColumnsPanel; |
81 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributesSelectionPanel; |
82 |
import org.gvsig.fmap.dal.swing.searchpanel.SearchParameters; |
83 |
import org.gvsig.tools.bookmarksandhistory.Bookmarks; |
84 |
import org.gvsig.tools.bookmarksandhistory.History; |
85 |
import org.gvsig.tools.swing.api.bookmarkshistory.ActionEventWithCurrentValue; |
86 |
import static org.gvsig.tools.swing.api.bookmarkshistory.ActionEventWithCurrentValue.ID_GETVALUE; |
87 |
import static org.gvsig.tools.swing.api.bookmarkshistory.ActionEventWithCurrentValue.ID_SETVALUE; |
88 |
import org.gvsig.tools.swing.api.bookmarkshistory.BookmarksController; |
89 |
import org.gvsig.tools.swing.api.bookmarkshistory.HistoryController; |
90 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
91 |
|
92 |
/**
|
93 |
*
|
94 |
* @author jjdelcerro
|
95 |
*/
|
96 |
@SuppressWarnings({"UseSpecificCatch"}) |
97 |
public class DefaultSearchPanel |
98 |
extends DefaultSearchPanelView
|
99 |
implements FeatureStoreSearchPanel {
|
100 |
|
101 |
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultSearchPanel.class); |
102 |
|
103 |
static /* friend */ Integer useLabels = null; |
104 |
private BookmarksController bookmarksController;
|
105 |
private HistoryController historyController;
|
106 |
private FeatureQuery lastQuery;
|
107 |
|
108 |
public static class UseLabelsYesAction extends AbstractAction { |
109 |
|
110 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
111 |
public UseLabelsYesAction() {
|
112 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
113 |
|
114 |
this.putValue(NAME, i18n.getTranslation("_Use_labels")); |
115 |
this.putValue(ACTION_COMMAND_KEY, "UseLabelsYes"); |
116 |
} |
117 |
|
118 |
@Override
|
119 |
public Object getValue(String key) { |
120 |
if (NAME.equals(key)) {
|
121 |
// Cuando se registra la accion aun no se han cargado las traducciones
|
122 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
123 |
return i18n.getTranslation("_Use_labels"); |
124 |
} |
125 |
return super.getValue(key); |
126 |
} |
127 |
|
128 |
@Override
|
129 |
public void actionPerformed(ActionEvent ae) { |
130 |
DefaultSearchPanel.useLabels = USE_LABELS_YES; |
131 |
} |
132 |
} |
133 |
|
134 |
public static class UseLabelsNoAction extends AbstractAction { |
135 |
|
136 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
137 |
public UseLabelsNoAction() {
|
138 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
139 |
this.putValue(NAME, i18n.getTranslation("_Use_names")); |
140 |
this.putValue(ACTION_COMMAND_KEY, "UseLabelsNo"); |
141 |
} |
142 |
|
143 |
@Override
|
144 |
public Object getValue(String key) { |
145 |
if (NAME.equals(key)) {
|
146 |
// Cuando se registra la accion aun no se han cargado las traducciones
|
147 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
148 |
return i18n.getTranslation("_Use_names"); |
149 |
} |
150 |
return super.getValue(key); |
151 |
} |
152 |
|
153 |
@Override
|
154 |
public void actionPerformed(ActionEvent ae) { |
155 |
DefaultSearchPanel.useLabels = USE_LABELS_NO; |
156 |
} |
157 |
} |
158 |
|
159 |
public static class UseLabelsBothAction extends AbstractAction { |
160 |
|
161 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
162 |
public UseLabelsBothAction() {
|
163 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
164 |
|
165 |
this.putValue(NAME, i18n.getTranslation("_Use_labels_and_names")); |
166 |
this.putValue(ACTION_COMMAND_KEY, "UseLabelsBoth"); |
167 |
} |
168 |
|
169 |
@Override
|
170 |
public Object getValue(String key) { |
171 |
if (NAME.equals(key)) {
|
172 |
// Cuando se registra la accion aun no se han cargado las traducciones
|
173 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
174 |
return i18n.getTranslation("_Use_labels_and_names"); |
175 |
} |
176 |
return super.getValue(key); |
177 |
} |
178 |
|
179 |
@Override
|
180 |
public void actionPerformed(ActionEvent ae) { |
181 |
DefaultSearchPanel.useLabels = USE_LABELS_BOTH; |
182 |
} |
183 |
} |
184 |
|
185 |
public static class SelectColumnsAction extends AbstractAction { |
186 |
|
187 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
188 |
public SelectColumnsAction() {
|
189 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
190 |
|
191 |
this.putValue(NAME, i18n.getTranslation("_Select_columns_to_display")); |
192 |
this.putValue(ACTION_COMMAND_KEY, "SelectColumns"); |
193 |
} |
194 |
|
195 |
@Override
|
196 |
public Object getValue(String key) { |
197 |
if (NAME.equals(key)) {
|
198 |
// Cuando se registra la accion aun no se han cargado las traducciones
|
199 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
200 |
return i18n.getTranslation("_Select_columns_to_display"); |
201 |
} |
202 |
return super.getValue(key); |
203 |
} |
204 |
|
205 |
@Override
|
206 |
public void actionPerformed(ActionEvent ae) { |
207 |
DefaultSearchPanel panel = (DefaultSearchPanel) ae.getSource(); |
208 |
panel.doSelectResultColumnNames(); |
209 |
} |
210 |
} |
211 |
|
212 |
public static class CalculatedColumnsAction extends AbstractAction { |
213 |
|
214 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
215 |
public CalculatedColumnsAction() {
|
216 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
217 |
|
218 |
this.putValue(NAME, i18n.getTranslation("_Calculated_columns")); |
219 |
this.putValue(ACTION_COMMAND_KEY, "CalculatedColumns"); |
220 |
} |
221 |
|
222 |
@Override
|
223 |
public Object getValue(String key) { |
224 |
if (NAME.equals(key)) {
|
225 |
// Cuando se registra la accion aun no se han cargado las traducciones
|
226 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
227 |
return i18n.getTranslation("_Calculated_columns"); |
228 |
} |
229 |
return super.getValue(key); |
230 |
} |
231 |
|
232 |
@Override
|
233 |
public void actionPerformed(ActionEvent ae) { |
234 |
DefaultSearchPanel panel = (DefaultSearchPanel) ae.getSource(); |
235 |
panel.doCalculatedColumns(); |
236 |
} |
237 |
} |
238 |
|
239 |
public static class GroupByAction extends AbstractAction { |
240 |
|
241 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
242 |
public GroupByAction() {
|
243 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
244 |
|
245 |
this.putValue(NAME, i18n.getTranslation("_Group_by")); |
246 |
this.putValue(ACTION_COMMAND_KEY, "GroupBy"); |
247 |
} |
248 |
|
249 |
@Override
|
250 |
public Object getValue(String key) { |
251 |
if (NAME.equals(key)) {
|
252 |
// Cuando se registra la accion aun no se han cargado las traducciones
|
253 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
254 |
return i18n.getTranslation("_Group_by"); |
255 |
} |
256 |
return super.getValue(key); |
257 |
} |
258 |
|
259 |
@Override
|
260 |
public void actionPerformed(ActionEvent ae) { |
261 |
DefaultSearchPanel panel = (DefaultSearchPanel) ae.getSource(); |
262 |
panel.doGroupBy(); |
263 |
} |
264 |
} |
265 |
|
266 |
public static class OrderByAction extends AbstractAction { |
267 |
|
268 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
269 |
public OrderByAction() {
|
270 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
271 |
|
272 |
this.putValue(NAME, i18n.getTranslation("_Order_by")); |
273 |
this.putValue(ACTION_COMMAND_KEY, "SelectOrderBy"); |
274 |
} |
275 |
|
276 |
@Override
|
277 |
public Object getValue(String key) { |
278 |
if (NAME.equals(key)) {
|
279 |
// Cuando se registra la accion aun no se han cargado las traducciones
|
280 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
281 |
return i18n.getTranslation("_Order_by"); |
282 |
} |
283 |
return super.getValue(key); |
284 |
} |
285 |
|
286 |
@Override
|
287 |
public void actionPerformed(ActionEvent ae) { |
288 |
DefaultSearchPanel panel = (DefaultSearchPanel) ae.getSource(); |
289 |
panel.doOrderBy(); |
290 |
} |
291 |
} |
292 |
|
293 |
private class ActionButtons { |
294 |
|
295 |
private final DALActionFactory factory; |
296 |
private final Action action; |
297 |
private final JButton button; |
298 |
|
299 |
public ActionButtons(DALActionFactory factory, Action action, JButton button) { |
300 |
this.factory = factory;
|
301 |
this.action = action;
|
302 |
this.button = button;
|
303 |
} |
304 |
} |
305 |
|
306 |
public static class SearchActionContext extends AbstractDALActionContext { |
307 |
|
308 |
private final DefaultSearchPanel panel; |
309 |
|
310 |
public SearchActionContext(DefaultSearchPanel panel) {
|
311 |
super(FeatureStoreSearchPanel.ACTION_CONTEXT_NAME);
|
312 |
this.panel = panel;
|
313 |
} |
314 |
|
315 |
@Override
|
316 |
public DataStore getStore() {
|
317 |
return this.panel.getStore(); |
318 |
} |
319 |
|
320 |
@Override
|
321 |
public JComponent getActionButton(String actionName) { |
322 |
return this.panel.getActionButton(actionName); |
323 |
} |
324 |
|
325 |
@Override
|
326 |
public int getSelectedsCount() { |
327 |
return this.panel.getSelectedFeatureCount(); |
328 |
} |
329 |
|
330 |
@Override
|
331 |
public Expression getFilterForSelecteds() { |
332 |
return this.panel.getFilterForSelectedFeature(); |
333 |
} |
334 |
|
335 |
@Override
|
336 |
public FeatureQuery getQuery() {
|
337 |
return this.panel.getQuery(); |
338 |
} |
339 |
} |
340 |
|
341 |
private final FeatureStore store; |
342 |
private final ActionListenerSupport acctionListeners; |
343 |
private final Map<String, ActionButtons> actions; |
344 |
private boolean showActions = true; |
345 |
private DefaultSearchParameters parameters;
|
346 |
|
347 |
private List<SearchConditionPanel> conditionPanels; |
348 |
|
349 |
private static final int PANEL_SIMPLIFIED = 0; |
350 |
private static final int PANEL_ADVANCED = 1; |
351 |
private static final String BOOKMARKSANDHISTORY_NAME = "SearchPanel"; |
352 |
private final Bookmarks<Object> bookmarks; |
353 |
private final History<Object> history; |
354 |
|
355 |
public DefaultSearchPanel(FeatureStore store) {
|
356 |
this.store = store;
|
357 |
this.acctionListeners = ToolsSwingLocator.getToolsSwingManager().createActionListenerSupport();
|
358 |
this.actions = new HashMap<>(); |
359 |
this.parameters = new DefaultSearchParameters(); |
360 |
FeatureQuery featureQuery = this.store.createFeatureQuery();
|
361 |
featureQuery.retrievesAllAttributes(); |
362 |
this.parameters.setQuery(featureQuery);
|
363 |
|
364 |
Search search = (Search) ToolsLocator.getComplementsManager().get( |
365 |
Search.COMPLEMENT_MANE, getFeatureType() |
366 |
); |
367 |
List<Search.OrderedAttribute> attributos = search.getOrderedAttributes(
|
368 |
Search.BASIC_TYPES_FILTER, |
369 |
Search.STR_INT_LONG_LABEL_ORDER, |
370 |
12
|
371 |
); |
372 |
for (Search.OrderedAttribute attrdesc : attributos) {
|
373 |
this.parameters.getResultColumnNames().add(attrdesc.getDescriptor().getName());
|
374 |
} |
375 |
this.bookmarks = ToolsLocator.getBookmarksAndHistoryManager().getBookmarksGroup(BOOKMARKSANDHISTORY_NAME);
|
376 |
this.history = ToolsLocator.getBookmarksAndHistoryManager().getHistoryGroup(BOOKMARKSANDHISTORY_NAME);
|
377 |
} |
378 |
|
379 |
@Override
|
380 |
public JComponent asJComponent() { |
381 |
if (this.conditionPanels == null) { |
382 |
this.initComponents();
|
383 |
} |
384 |
return this; |
385 |
} |
386 |
|
387 |
private void addActions() { |
388 |
if (!this.showActions) { |
389 |
return;
|
390 |
} |
391 |
this.pnlActions.removeAll();
|
392 |
this.pnlActions.setLayout(new FlowLayout(FlowLayout.TRAILING, 8, 4)); |
393 |
SearchActionContext actionContext = new SearchActionContext(this); |
394 |
Collection<DALActionFactory> factories = DALSwingLocator.getSwingManager().getStoreActions();
|
395 |
for (DALActionFactory factory : factories) {
|
396 |
Action action = factory.createAction(actionContext);
|
397 |
JButton button = new JButton(action); |
398 |
this.actions.put(factory.getName(), new ActionButtons(factory, action, button)); |
399 |
button.setBorder(BorderFactory.createEmptyBorder());
|
400 |
button.setBorderPainted(false);
|
401 |
button.setFocusPainted(false);
|
402 |
button.setContentAreaFilled(false);
|
403 |
button.setCursor(new Cursor(Cursor.HAND_CURSOR)); |
404 |
this.pnlActions.add(button);
|
405 |
} |
406 |
this.pnlActions.revalidate();
|
407 |
this.pnlActions.repaint();
|
408 |
} |
409 |
|
410 |
@Override
|
411 |
public void addActionListener(ActionListener listener) { |
412 |
this.acctionListeners.addActionListener(listener);
|
413 |
} |
414 |
|
415 |
@Override
|
416 |
public ActionListener[] getActionListeners() { |
417 |
return this.acctionListeners.getActionListeners(); |
418 |
} |
419 |
|
420 |
@Override
|
421 |
public void removeActionListener(ActionListener listener) { |
422 |
this.acctionListeners.removeActionListener(listener);
|
423 |
} |
424 |
|
425 |
@Override
|
426 |
public void removeAllActionListener() { |
427 |
this.acctionListeners.removeAllActionListener();
|
428 |
} |
429 |
|
430 |
@Override
|
431 |
public void fireActionEvent(ActionEvent event) { |
432 |
this.acctionListeners.fireActionEvent(event);
|
433 |
} |
434 |
|
435 |
@Override
|
436 |
public boolean hasActionListeners() { |
437 |
return this.acctionListeners.hasActionListeners(); |
438 |
} |
439 |
|
440 |
private void initComponents() { |
441 |
this.conditionPanels = new ArrayList<>(); |
442 |
|
443 |
ToolsSwingManager swingManager = ToolsSwingLocator.getToolsSwingManager(); |
444 |
swingManager.translate(this.tabSearchMode);
|
445 |
swingManager.translate(this.btnSearch);
|
446 |
swingManager.translate(this.btnClear);
|
447 |
swingManager.translate(this.lblExpressionDeBusqueda);
|
448 |
swingManager.translate(this.btnAddAccumulatedFilter);
|
449 |
swingManager.translate(this.btnRemoveAccumulatedFilter);
|
450 |
swingManager.translate(this.btnViewAccumulatedFilter);
|
451 |
|
452 |
ConfigurableActionsMamager cfgActionsManager = ToolsUtilLocator.getConfigurableActionsMamager(); |
453 |
JComponent c = cfgActionsManager.getConfigurableActionsComponent(CONFIGURABLE_PANEL_ID, this); |
454 |
this.pnlCfgActions.setLayout(new BorderLayout(0, 0)); |
455 |
this.pnlCfgActions.add(c, BorderLayout.CENTER); |
456 |
|
457 |
this.conditionPanels.add(
|
458 |
new SearchConditionPanelSimplified(
|
459 |
store, |
460 |
btnAddAccumulatedFilter, |
461 |
btnRemoveAccumulatedFilter, |
462 |
btnViewAccumulatedFilter, |
463 |
lblField1, |
464 |
lblExtraFields1, |
465 |
lblRelationalOperator1, |
466 |
cboValue1, |
467 |
lblLogicalOperators1, |
468 |
lblField2, |
469 |
lblExtraFields2, |
470 |
lblRelationalOperator2, |
471 |
cboValue2, |
472 |
lblLogicalOperators2, |
473 |
lblField3, |
474 |
lblExtraFields3, |
475 |
lblRelationalOperator3, |
476 |
cboValue3, |
477 |
lblLogicalOperators3, |
478 |
lblField4, |
479 |
lblExtraFields4, |
480 |
lblRelationalOperator4, |
481 |
cboValue4, |
482 |
null
|
483 |
) |
484 |
); |
485 |
this.conditionPanels.add(
|
486 |
new SearchConditionPanelAdvanced(
|
487 |
this.store,
|
488 |
txtAdvancedExpression, |
489 |
btnAdvancedExpression, |
490 |
btnAdvancedExpressionHistory, |
491 |
btnAdvancedExpressionBookmarks |
492 |
) |
493 |
); |
494 |
for (SearchConditionPanelFactory factory : DALSwingLocator.getManager().getSearchConditionPanels()) {
|
495 |
String factoryName = "unknown"; |
496 |
try {
|
497 |
factoryName = factory.getName(); |
498 |
if (factory.isApplicable(store)) {
|
499 |
SearchConditionPanel panel = factory.create(this);
|
500 |
this.conditionPanels.add(panel);
|
501 |
this.tabSearchMode.add(factory.getName(), panel.asJComponent());
|
502 |
} |
503 |
} catch (Throwable th) { |
504 |
LOGGER.warn("Can't create search panel '" + factoryName + "'."); |
505 |
} |
506 |
} |
507 |
|
508 |
this.btnSearch.addActionListener((ActionEvent e) -> { |
509 |
search(); |
510 |
}); |
511 |
|
512 |
this.tblResults.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> { |
513 |
for (ActionButtons actionButton : actions.values()) {
|
514 |
if (actionButton.action instanceof ListSelectionListener) { |
515 |
((ListSelectionListener) actionButton.action).valueChanged(e);
|
516 |
} |
517 |
} |
518 |
}); |
519 |
this.btnClear.addActionListener((ActionEvent e) -> { |
520 |
clear(); |
521 |
}); |
522 |
addActions(); |
523 |
|
524 |
swingManager.createTableColumnAdjuster(tblResults); |
525 |
|
526 |
this.setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT)); |
527 |
|
528 |
this.bookmarksController = ToolsSwingLocator.getToolsSwingManager().createBookmarksController(this.bookmarks, btnBookmarks); |
529 |
this.historyController = ToolsSwingLocator.getToolsSwingManager().createHistoryController(this.history, btnHistory); |
530 |
|
531 |
this.historyController.setFilter(null); |
532 |
|
533 |
ActionListener bookmarksAndHistoryListener = new ActionListener() { |
534 |
@Override
|
535 |
public void actionPerformed(ActionEvent e) { |
536 |
ActionEventWithCurrentValue<DefaultSearchParameters> b = (ActionEventWithCurrentValue<DefaultSearchParameters>) e; |
537 |
switch (b.getID()) {
|
538 |
case ID_GETVALUE:
|
539 |
DefaultSearchParameters actualParams = (DefaultSearchParameters) fetch(null);
|
540 |
b.setCurrentValue(actualParams); |
541 |
break;
|
542 |
|
543 |
case ID_SETVALUE:
|
544 |
if (b.getCurrentValue() == null) { |
545 |
return;
|
546 |
} |
547 |
DefaultSearchParameters searchParams; |
548 |
try {
|
549 |
searchParams = b.getCurrentValue().getCopy(); |
550 |
} catch (Exception ex) { |
551 |
LOGGER.warn("Not been able to clone export parameters", ex);
|
552 |
return;
|
553 |
} |
554 |
clear(); |
555 |
put(searchParams); |
556 |
break;
|
557 |
} |
558 |
|
559 |
} |
560 |
}; |
561 |
this.historyController.addActionListener(bookmarksAndHistoryListener);
|
562 |
this.bookmarksController.addActionListener(bookmarksAndHistoryListener);
|
563 |
|
564 |
search(); |
565 |
} |
566 |
|
567 |
private FeatureType getFeatureType() {
|
568 |
try {
|
569 |
return store.getDefaultFeatureType();
|
570 |
} catch (Exception ex) { |
571 |
throw new RuntimeException("Can't retrieve the feature type.", ex); |
572 |
} |
573 |
} |
574 |
|
575 |
@Override
|
576 |
public void setEnabled(boolean enabled) { |
577 |
if (this.conditionPanels == null) { |
578 |
this.initComponents();
|
579 |
} |
580 |
for (SearchConditionPanel conditionPanel : conditionPanels) {
|
581 |
conditionPanel.setEnabled(enabled); |
582 |
} |
583 |
|
584 |
this.btnClear.setEnabled(enabled);
|
585 |
this.btnSearch.setEnabled(enabled);
|
586 |
for (ActionButtons actionButton : actions.values()) {
|
587 |
actionButton.action.setEnabled(enabled); |
588 |
} |
589 |
} |
590 |
|
591 |
@Override
|
592 |
public void clear() { |
593 |
if (this.conditionPanels == null) { |
594 |
return;
|
595 |
} |
596 |
for (SearchConditionPanel conditionPanel : conditionPanels) {
|
597 |
conditionPanel.clear(); |
598 |
} |
599 |
} |
600 |
|
601 |
@Override
|
602 |
public FeatureQuery getLastQuery() {
|
603 |
return this.lastQuery; |
604 |
} |
605 |
|
606 |
public boolean isValid(StringBuilder message) { |
607 |
int searchMode = this.tabSearchMode.getSelectedIndex(); |
608 |
SearchConditionPanel panel = this.conditionPanels.get(searchMode);
|
609 |
boolean valid = panel.isValid(message);
|
610 |
return valid;
|
611 |
} |
612 |
|
613 |
@Override
|
614 |
public void search() { |
615 |
final MutableObject model = new MutableObject(null); |
616 |
|
617 |
StringBuilder message = new StringBuilder(); |
618 |
if (!this.isValid(message)) { |
619 |
ThreadSafeDialogsManager dialogManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
620 |
dialogManager.messageDialog( |
621 |
"_The_specified_search_condition_is_not_valid",
|
622 |
"_Search",
|
623 |
JOptionPane.WARNING_MESSAGE
|
624 |
); |
625 |
return;
|
626 |
} |
627 |
lblMsg.setText("Searching...");
|
628 |
setEnabled(false);
|
629 |
Thread th = new Thread(() -> { |
630 |
FeatureQuery myQuery = null;
|
631 |
SearchParameters params; |
632 |
try {
|
633 |
params = this.fetch(this.parameters.getCopy()); // esto lo actualiza a la ultima // decidir si se devuelve clonado |
634 |
Date date = Calendar.getInstance().getTime(); |
635 |
DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss"); |
636 |
String strDate = dateFormat.format(date);
|
637 |
params.setName("Params: " + strDate);
|
638 |
} catch (Exception ex) { |
639 |
LOGGER.warn("Not able to create search parameters.", ex);
|
640 |
return;
|
641 |
} |
642 |
|
643 |
try {
|
644 |
final List<Feature> features; |
645 |
|
646 |
myQuery = this.getQuery().getCopy();
|
647 |
features = store.getFeatures(myQuery); |
648 |
FacadeOfAFeaturePagingHelper facade = (FacadeOfAFeaturePagingHelper) features; |
649 |
FeatureType ftype = facade.getFeaturePagingHelper().getFeatureSet().getDefaultFeatureType(); |
650 |
// al modelo le pasamos el ftype de esas features
|
651 |
model.setValue(new SimpleFeaturesTableModel(
|
652 |
ftype, |
653 |
params.getResultColumnNames(), |
654 |
features |
655 |
) |
656 |
); |
657 |
} catch (Exception ex) { |
658 |
LOGGER.warn("Search not able to be executed. Can't get features or create table model", ex);
|
659 |
} finally {
|
660 |
SwingUtilities.invokeLater(() -> {
|
661 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
662 |
SimpleFeaturesTableModel m = (SimpleFeaturesTableModel) model.getValue(); |
663 |
tblResults.setModel(m); |
664 |
if( m.hasErrors() ) {
|
665 |
lblMsg.setText("_Errors_occurred_during_search");
|
666 |
} else {
|
667 |
lblMsg.setText(String.format("%d " + i18n.getTranslation("_elements"), m.getRowCount())); |
668 |
} |
669 |
setEnabled(true);
|
670 |
}); |
671 |
if (this.parameters != null && this.parameters.getQuery() != null) { |
672 |
this.history.add(params);
|
673 |
} |
674 |
} |
675 |
}); |
676 |
th.start(); |
677 |
} |
678 |
|
679 |
public void setResultColumnNames(List<String> names) { |
680 |
this.parameters.getResultColumnNames().clear();
|
681 |
this.parameters.getResultColumnNames().addAll(names);
|
682 |
if (this.conditionPanels == null) { |
683 |
return;
|
684 |
} |
685 |
SimpleFeaturesTableModel model; |
686 |
model = (SimpleFeaturesTableModel) this.tblResults.getModel();
|
687 |
List<Feature> features = store.getFeatures(this.parameters.getQuery()); |
688 |
FacadeOfAFeaturePagingHelper facade = (FacadeOfAFeaturePagingHelper) features; |
689 |
FeatureType ftype = facade.getFeaturePagingHelper().getFeatureSet().getDefaultFeatureType(); |
690 |
model = new SimpleFeaturesTableModel(
|
691 |
ftype, |
692 |
this.parameters.getResultColumnNames(),
|
693 |
features |
694 |
); |
695 |
tblResults.setModel(model); |
696 |
} |
697 |
|
698 |
@Override
|
699 |
public boolean setFilter(Expression filter) { |
700 |
try {
|
701 |
if (this.conditionPanels == null) { |
702 |
this.initComponents();
|
703 |
} |
704 |
if (ExpressionUtils.isPhraseEmpty(filter)) {
|
705 |
this.clear();
|
706 |
return true; |
707 |
} |
708 |
int panel = 0; |
709 |
int selected = PANEL_ADVANCED;
|
710 |
for (SearchConditionPanel conditionPanel : conditionPanels) {
|
711 |
if (panel != PANEL_ADVANCED && conditionPanel.set(filter)) {
|
712 |
selected = panel; |
713 |
} |
714 |
panel++; |
715 |
} |
716 |
this.tabSearchMode.setSelectedIndex(selected);
|
717 |
|
718 |
// SimpleFeaturesTableModel model = new SimpleFeaturesTableModel(this.getStore());
|
719 |
// tblResults.setModel(model);
|
720 |
// lblMsg.setText("");
|
721 |
return true; |
722 |
} catch (Exception ex) { |
723 |
LOGGER.warn("Can't set current search", ex);
|
724 |
return false; |
725 |
} |
726 |
} |
727 |
|
728 |
@Override
|
729 |
public List<SearchConditionPanel> getConditionPanels() { |
730 |
return Collections.unmodifiableList(this.conditionPanels); |
731 |
} |
732 |
|
733 |
@Override
|
734 |
public SearchConditionPanel getConditionPanel(String name) { |
735 |
for (SearchConditionPanel panel : conditionPanels) {
|
736 |
if (StringUtils.equalsIgnoreCase(name, panel.getFactory().getName())) {
|
737 |
return panel;
|
738 |
} |
739 |
} |
740 |
return null; |
741 |
} |
742 |
|
743 |
@Override
|
744 |
public Expression getFilterForSelectedFeature() { |
745 |
if (this.conditionPanels == null) { |
746 |
return null; |
747 |
} |
748 |
int selectedRow = this.tblResults.getSelectedRow(); |
749 |
if (selectedRow < 0) { |
750 |
return null; |
751 |
} |
752 |
try {
|
753 |
List<Feature> features = ((SimpleFeaturesTableModel) this.tblResults.getModel()).getFeatures(); |
754 |
Feature feature = features.get(selectedRow); |
755 |
|
756 |
ExpressionBuilder builder = ExpressionUtils.createExpressionBuilder(); |
757 |
FeatureType ftype = this.store.getDefaultFeatureType();
|
758 |
for (FeatureAttributeDescriptor attrdesc : ftype.getPrimaryKey()) {
|
759 |
builder.and( |
760 |
builder.eq( |
761 |
builder.column(attrdesc.getName()), |
762 |
builder.constant(feature.get(attrdesc.getName())) |
763 |
) |
764 |
); |
765 |
} |
766 |
Expression filter = ExpressionUtils.createExpression(builder.toString());
|
767 |
return filter;
|
768 |
} catch (Exception ex) { |
769 |
LOGGER.warn("Can't build search for the selected feature.", ex);
|
770 |
return null; |
771 |
} |
772 |
} |
773 |
|
774 |
@Override
|
775 |
public FeatureStore getStore() {
|
776 |
return store;
|
777 |
} |
778 |
|
779 |
private void doOrderBy() { |
780 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
781 |
WindowManager_v2 windowManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
782 |
FeatureQueryOrderPanel orderPanel = DALSwingLocator.getDataSwingManager().createFeatureStoreOrderPanel(); |
783 |
orderPanel.setStore(store); |
784 |
orderPanel.put(parameters.getQuery()); |
785 |
Dialog dialog = windowManager.createDialog(
|
786 |
orderPanel.asJComponent(), |
787 |
i18n.getTranslation("_Select_order"),
|
788 |
null,
|
789 |
WindowManager_v2.BUTTONS_OK_CANCEL |
790 |
); |
791 |
dialog.addActionListener((ActionEvent e) -> {
|
792 |
if (dialog.getAction() == WindowManager_v2.BUTTON_OK) {
|
793 |
orderPanel.fetch(this.parameters.getQuery());
|
794 |
search(); |
795 |
} |
796 |
}); |
797 |
dialog.show(WindowManager.MODE.DIALOG); |
798 |
|
799 |
} |
800 |
|
801 |
@Override
|
802 |
public ImageIcon loadImage(String imageName) { |
803 |
String name = FilenameUtils.getBaseName(imageName);
|
804 |
IconTheme theme = ToolsSwingLocator.getIconThemeManager().getDefault(); |
805 |
if (theme.exists(name)) {
|
806 |
return theme.get(name);
|
807 |
} |
808 |
URL url = this.getClass().getResource(name + ".png"); |
809 |
if (url == null) { |
810 |
return null; |
811 |
} |
812 |
return new ImageIcon(url); |
813 |
} |
814 |
|
815 |
@Override
|
816 |
public int getSelectedFeatureCount() { |
817 |
if (this.conditionPanels == null) { |
818 |
return 0; |
819 |
} |
820 |
return this.tblResults.getSelectedRowCount(); |
821 |
} |
822 |
|
823 |
@Override
|
824 |
public JComponent getActionButton(String name) { |
825 |
ActionButtons actionButton = this.actions.get(name);
|
826 |
if (actionButton == null) { |
827 |
return null; |
828 |
} |
829 |
return actionButton.button;
|
830 |
} |
831 |
|
832 |
@Override
|
833 |
public void setShowActions(boolean showActions) { |
834 |
this.showActions = showActions;
|
835 |
} |
836 |
|
837 |
@Override
|
838 |
public boolean isShowActions() { |
839 |
return this.showActions; |
840 |
} |
841 |
|
842 |
public static String getAttributeDescriptorLabel(FeatureAttributeDescriptor attrdesc, String tableName) { |
843 |
String theLabel;
|
844 |
int theUseLabels;
|
845 |
if (useLabels == null) { |
846 |
Tags tags = attrdesc.getTags(); |
847 |
if (tags.has(DAL_USE_LABELS)) {
|
848 |
theUseLabels = tags.getInt(DAL_USE_LABELS, USE_LABELS_NO); |
849 |
} else {
|
850 |
tags = attrdesc.getFeatureType().getTags(); |
851 |
theUseLabels = tags.getInt(DAL_USE_LABELS, USE_LABELS_NO); |
852 |
} |
853 |
} else {
|
854 |
theUseLabels = useLabels; |
855 |
} |
856 |
switch (theUseLabels) {
|
857 |
case USE_LABELS_YES:
|
858 |
if (StringUtils.isBlank(tableName)) {
|
859 |
theLabel = attrdesc.getLocalizedLabel(); |
860 |
} else {
|
861 |
theLabel = String.format("%s [%s]", attrdesc.getLocalizedLabel(), tableName); |
862 |
} |
863 |
break;
|
864 |
default:
|
865 |
case USE_LABELS_NO:
|
866 |
if (StringUtils.isBlank(tableName)) {
|
867 |
theLabel = attrdesc.getName(); |
868 |
} else {
|
869 |
theLabel = String.format("%s [%s]", attrdesc.getName(), tableName); |
870 |
} |
871 |
break;
|
872 |
case USE_LABELS_BOTH:
|
873 |
if (StringUtils.isBlank(tableName)) {
|
874 |
theLabel = String.format("%s [%s]", attrdesc.getLocalizedLabel(), attrdesc.getName()); |
875 |
} else {
|
876 |
theLabel = String.format("%s [%s/%s]", attrdesc.getLocalizedLabel(), attrdesc.getName(), tableName); |
877 |
} |
878 |
break;
|
879 |
} |
880 |
return theLabel;
|
881 |
} |
882 |
|
883 |
private void doCalculatedColumns() { |
884 |
WindowManager_v2 winmanager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
885 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
886 |
final FeatureQueryCalculatedColumnsPanel panel = new DefaultFeatureQueryCalculatedColumnsPanel(); |
887 |
panel.setStore(this.store);
|
888 |
panel.put(this.parameters.getQuery());
|
889 |
final Dialog dialog = winmanager.createDialog( |
890 |
panel.asJComponent(), |
891 |
i18n.getTranslation("_Calculated_columns"),
|
892 |
null,
|
893 |
WindowManager_v2.BUTTONS_OK_CANCEL |
894 |
); |
895 |
dialog.addActionListener((ActionEvent e) -> {
|
896 |
if (dialog.getAction() == WindowManager_v2.BUTTONS_OK) {
|
897 |
panel.fetch(this.parameters.getQuery());
|
898 |
search(); |
899 |
} |
900 |
}); |
901 |
dialog.show(WindowManager.MODE.DIALOG); |
902 |
} |
903 |
|
904 |
private void doGroupBy() { |
905 |
DataStoreProviderFactory dataFactory = this.store.getProviderFactory();
|
906 |
int allowGroupBy = ((FeatureStoreProviderFactory) dataFactory).allowGroupBy();
|
907 |
if (allowGroupBy != DataType.YES) {
|
908 |
// FIXME: mensaje al usaurio.
|
909 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
910 |
ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager(); |
911 |
dialogs.messageDialog( |
912 |
i18n.getTranslation("_The_group_function_is_not_available_for_this_table"),
|
913 |
i18n.getTranslation("_Information"),
|
914 |
JOptionPane.INFORMATION_MESSAGE
|
915 |
); |
916 |
return;
|
917 |
} |
918 |
|
919 |
WindowManager_v2 winmanager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
920 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
921 |
final FeatureQueryGroupByPanel panel = new DefaultFeatureQueryGroupByPanel(); |
922 |
panel.setStore(this.store);
|
923 |
panel.put(this.parameters.getQuery());
|
924 |
final Dialog dialog = winmanager.createDialog( |
925 |
panel.asJComponent(), |
926 |
i18n.getTranslation("_Select_group_columns_and_aggregate_functions"),
|
927 |
null,
|
928 |
WindowManager_v2.BUTTONS_OK_CANCEL |
929 |
); |
930 |
dialog.addActionListener((ActionEvent e) -> {
|
931 |
if (dialog.getAction() == WindowManager_v2.BUTTONS_OK) {
|
932 |
panel.fetch(this.parameters.getQuery());
|
933 |
search(); |
934 |
} |
935 |
}); |
936 |
dialog.show(WindowManager.MODE.DIALOG); |
937 |
} |
938 |
|
939 |
private void doSelectResultColumnNames() { |
940 |
WindowManager_v2 winmanager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
941 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
942 |
final FeatureAttributesSelectionPanel panel = DALSwingLocator.getManager().createFeatureAttributeSelectionPanel();
|
943 |
FeatureType ftype = this.getFeatureType();
|
944 |
try {
|
945 |
Feature f = store.findFirst(this.parameters.getQuery());
|
946 |
if( f!=null ) { |
947 |
ftype = f.getType(); |
948 |
} |
949 |
} catch (Throwable ex) { |
950 |
LOGGER.warn("Can't retrieve the feature type from the first feature.",ex);
|
951 |
} |
952 |
panel.setFeatureType(ftype); |
953 |
panel.setSelectedNames(this.parameters.getResultColumnNames());
|
954 |
final Dialog dialog = winmanager.createDialog( |
955 |
panel.asJComponent(), |
956 |
i18n.getTranslation("_Select_the_columns_to_display"),
|
957 |
null,
|
958 |
WindowManager_v2.BUTTONS_OK_CANCEL |
959 |
); |
960 |
dialog.addActionListener((ActionEvent e) -> {
|
961 |
if (dialog.getAction() == WindowManager_v2.BUTTONS_OK) {
|
962 |
this.setResultColumnNames(panel.getSelectedNames());
|
963 |
} |
964 |
}); |
965 |
dialog.show(WindowManager.MODE.DIALOG); |
966 |
} |
967 |
|
968 |
@Override
|
969 |
public void put(SearchParameters inParams) { |
970 |
for (SearchConditionPanel conditionPanel : this.conditionPanels) { |
971 |
try {
|
972 |
conditionPanel.put(inParams); |
973 |
} catch (Exception ex) { |
974 |
LOGGER.warn("Can't open panel", ex);
|
975 |
} |
976 |
} |
977 |
this.parameters = (DefaultSearchParameters) inParams;
|
978 |
|
979 |
} |
980 |
|
981 |
private FeatureQuery getQuery() {
|
982 |
FeatureQuery query; |
983 |
try {
|
984 |
int searchMode = this.tabSearchMode.getSelectedIndex(); |
985 |
SearchConditionPanel panel = this.conditionPanels.get(searchMode);
|
986 |
Expression filter = panel.get();
|
987 |
if (searchMode != PANEL_ADVANCED) {
|
988 |
this.conditionPanels.get(PANEL_ADVANCED).set(filter);
|
989 |
} |
990 |
query = (FeatureQuery) this.parameters.getQuery().clone();
|
991 |
query.retrievesAllAttributes(); |
992 |
if (ExpressionUtils.isPhraseEmpty(filter)) {
|
993 |
return query;
|
994 |
} |
995 |
query.setFilter(filter); |
996 |
query.retrievesAllAttributes(); |
997 |
return query;
|
998 |
} catch (Exception ex) { |
999 |
LOGGER.warn("Can't build query.", ex);
|
1000 |
return null; |
1001 |
} |
1002 |
} |
1003 |
|
1004 |
@Override
|
1005 |
public SearchParameters fetch(SearchParameters outParams) {
|
1006 |
// Actualiza el fquery del parameters con los paneles
|
1007 |
for (SearchConditionPanel conditionPanel : conditionPanels) {
|
1008 |
try {
|
1009 |
conditionPanel.fetch(this.parameters);
|
1010 |
} catch (Exception ex) { |
1011 |
LOGGER.warn("Panel not able to fetch values", ex);
|
1012 |
} |
1013 |
} |
1014 |
|
1015 |
// Actualiza el filtro con el panel activo
|
1016 |
int searchMode = this.tabSearchMode.getSelectedIndex(); |
1017 |
SearchConditionPanel panel = this.conditionPanels.get(searchMode);
|
1018 |
Expression filter = panel.get();
|
1019 |
if (searchMode != PANEL_ADVANCED) {
|
1020 |
this.conditionPanels.get(PANEL_ADVANCED).set(filter);
|
1021 |
} |
1022 |
FeatureQuery query = (FeatureQuery) this.parameters.getQuery();
|
1023 |
this.lastQuery = query.getCopy();
|
1024 |
query.retrievesAllAttributes(); |
1025 |
query.clearFilter(); |
1026 |
if (!ExpressionUtils.isPhraseEmpty(filter)) {
|
1027 |
query.setFilter(filter); |
1028 |
query.retrievesAllAttributes(); |
1029 |
} |
1030 |
|
1031 |
if (outParams == null) { |
1032 |
return this.parameters.getCopy(); |
1033 |
} |
1034 |
outParams.copyFrom(this.parameters.getCopy());
|
1035 |
return outParams;
|
1036 |
} |
1037 |
|
1038 |
public static void selfRegister() { |
1039 |
String[][] iconNames = new String[][]{ |
1040 |
new String[]{"dalswing", "featurestore-column"}, |
1041 |
new String[]{"dalswing", "featurestore-foreing-key"}, |
1042 |
new String[]{"dalswing", "featurestore-table"}, |
1043 |
new String[]{"dalswing", "search-action-showform"}, |
1044 |
new String[]{"dalswing", "search-action-select"}, |
1045 |
new String[]{"dalswing", "search-action-select-add"}, |
1046 |
new String[]{"dalswing", "search-action-select-filter"} |
1047 |
}; |
1048 |
IconTheme theme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
1049 |
for (String[] icon : iconNames) { |
1050 |
URL url = DefaultSearchPanel.class.getResource(icon[1] + ".png"); |
1051 |
theme.registerDefault("DALSwing", icon[0], icon[1], null, url); |
1052 |
} |
1053 |
|
1054 |
ConfigurableActionsMamager cfgActionsManager = ToolsUtilLocator.getConfigurableActionsMamager(); |
1055 |
cfgActionsManager.addConfigurableAction(CONFIGURABLE_PANEL_ID, new UseLabelsYesAction());
|
1056 |
cfgActionsManager.addConfigurableAction(CONFIGURABLE_PANEL_ID, new UseLabelsNoAction());
|
1057 |
cfgActionsManager.addConfigurableAction(CONFIGURABLE_PANEL_ID, new UseLabelsBothAction());
|
1058 |
cfgActionsManager.addConfigurableAction(CONFIGURABLE_PANEL_ID, new SelectColumnsAction());
|
1059 |
cfgActionsManager.addConfigurableAction(CONFIGURABLE_PANEL_ID, new CalculatedColumnsAction());
|
1060 |
cfgActionsManager.addConfigurableAction(CONFIGURABLE_PANEL_ID, new GroupByAction());
|
1061 |
cfgActionsManager.addConfigurableAction(CONFIGURABLE_PANEL_ID, new OrderByAction());
|
1062 |
} |
1063 |
} |