root / tags / v1_0_2_Build_906 / applications / appgvSIG / src / com / iver / cit / gvsig / gui / filter / FilterDialog.java @ 10972
History | View | Annotate | Download (28.4 KB)
1 | 1103 | fjp | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | *
|
||
19 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | 856 | fernando | package com.iver.cit.gvsig.gui.filter; |
42 | |||
43 | 1830 | fernando | import java.text.DateFormat; |
44 | import java.text.NumberFormat; |
||
45 | import java.text.ParseException; |
||
46 | import java.util.ArrayList; |
||
47 | import java.util.Comparator; |
||
48 | import java.util.Date; |
||
49 | import java.util.HashSet; |
||
50 | import java.util.Iterator; |
||
51 | import java.util.TreeSet; |
||
52 | import java.util.regex.Matcher; |
||
53 | import java.util.regex.Pattern; |
||
54 | |||
55 | import javax.swing.DefaultListModel; |
||
56 | import javax.swing.JPanel; |
||
57 | |||
58 | import org.apache.log4j.Logger; |
||
59 | |||
60 | import com.hardcode.gdbms.engine.data.driver.DriverException; |
||
61 | 1146 | fernando | import com.hardcode.gdbms.engine.instruction.IncompatibleTypesException; |
62 | import com.hardcode.gdbms.engine.values.BooleanValue; |
||
63 | import com.hardcode.gdbms.engine.values.DateValue; |
||
64 | 2496 | fernando | import com.hardcode.gdbms.engine.values.NullValue; |
65 | 1146 | fernando | import com.hardcode.gdbms.engine.values.StringValue; |
66 | import com.hardcode.gdbms.engine.values.Value; |
||
67 | import com.iver.andami.PluginServices; |
||
68 | 1365 | fjp | import com.iver.andami.messages.NotificationManager; |
69 | 6877 | cesar | import com.iver.andami.ui.mdiManager.IWindow; |
70 | 8765 | jjdelcerro | import com.iver.andami.ui.mdiManager.IWindowListener; |
71 | 6880 | cesar | import com.iver.andami.ui.mdiManager.WindowInfo; |
72 | 8765 | jjdelcerro | import com.iver.cit.gvsig.project.documents.table.gui.Table; |
73 | 1146 | fernando | import com.iver.utiles.DefaultCharSet; |
74 | import com.iver.utiles.StringUtilities; |
||
75 | import com.iver.utiles.exceptionHandling.ExceptionHandlingSupport; |
||
76 | import com.iver.utiles.exceptionHandling.ExceptionListener; |
||
77 | import com.lamatek.swingextras.JDateChooser; |
||
78 | |||
79 | |||
80 | 856 | fernando | /**
|
81 | * DOCUMENT ME!
|
||
82 | *
|
||
83 | * @author Fernando Gonz?lez Cort?s
|
||
84 | */
|
||
85 | 6880 | cesar | public class FilterDialog extends JPanel implements IWindow, IWindowListener { |
86 | 856 | fernando | private static Logger logger = Logger.getLogger(Table.class.getName()); |
87 | 1146 | fernando | private ArrayList expressionListeners = new ArrayList(); |
88 | private int position = 0; |
||
89 | private DefaultListModel fieldListModel = new DefaultListModel(); |
||
90 | private DefaultListModel valuesListModel = new DefaultListModel(); |
||
91 | private NumberFormat nf = NumberFormat.getNumberInstance(); |
||
92 | private DateFormat df = DateFormat.getDateInstance(); |
||
93 | private ArrayList variables = new ArrayList(); |
||
94 | private ExpressionDataSource model = null; |
||
95 | private javax.swing.JPanel jPanel = null; |
||
96 | private javax.swing.JPanel jPanel1 = null; |
||
97 | private javax.swing.JPanel jPanel2 = null; |
||
98 | private javax.swing.JPanel jPanel3 = null; |
||
99 | private javax.swing.JPanel jPanel4 = null; |
||
100 | private javax.swing.JLabel jLabel = null; |
||
101 | private javax.swing.JScrollPane jScrollPane = null; |
||
102 | private javax.swing.JList lstCampos = null; |
||
103 | private javax.swing.JButton btnIgual = null; |
||
104 | private javax.swing.JButton btnMayor = null; |
||
105 | private javax.swing.JButton btnNot = null; |
||
106 | private javax.swing.JButton btnDistinto = null; |
||
107 | private javax.swing.JButton btnMenor = null; |
||
108 | private javax.swing.JButton btnMayorIgual = null; |
||
109 | private javax.swing.JButton btnMenorIgual = null; |
||
110 | private javax.swing.JButton btnAnd = null; |
||
111 | private javax.swing.JButton btnOr = null; |
||
112 | private javax.swing.JTextArea txtExpression = null; |
||
113 | private javax.swing.JPanel jPanel5 = null; |
||
114 | private javax.swing.JButton btnNuevo = null; |
||
115 | private javax.swing.JButton btnAdd = null; |
||
116 | private javax.swing.JButton btnName = null; |
||
117 | private javax.swing.JButton btnFromSet = null; |
||
118 | private javax.swing.JScrollPane jScrollPane1 = null; |
||
119 | private javax.swing.JLabel jLabel1 = null; |
||
120 | private javax.swing.JList lstValores = null; |
||
121 | private javax.swing.JScrollPane jScrollPane2 = null; |
||
122 | private javax.swing.JButton btnParentesis = null; |
||
123 | private ExceptionHandlingSupport exceptionHandlingSupport = new ExceptionHandlingSupport(); |
||
124 | 7028 | ldiaz | |
125 | private String title; |
||
126 | 856 | fernando | |
127 | 1146 | fernando | /**
|
128 | * This is the default constructor
|
||
129 | */
|
||
130 | 7028 | ldiaz | public FilterDialog(String _title) { |
131 | 1146 | fernando | super();
|
132 | initialize(); |
||
133 | 7028 | ldiaz | title = _title; |
134 | 1146 | fernando | } |
135 | 7028 | ldiaz | /**
|
136 | * This is the default constructor
|
||
137 | */
|
||
138 | public FilterDialog() {
|
||
139 | super();
|
||
140 | initialize(); |
||
141 | } |
||
142 | 1146 | fernando | |
143 | /**
|
||
144 | * DOCUMENT ME!
|
||
145 | *
|
||
146 | * @param t DOCUMENT ME!
|
||
147 | */
|
||
148 | public void setModel(ExpressionDataSource t) { |
||
149 | 1365 | fjp | try {
|
150 | model = t; |
||
151 | model.start(); |
||
152 | } catch (DriverException e1) {
|
||
153 | NotificationManager.addError(e1.getMessage(), e1); |
||
154 | } |
||
155 | 1146 | fernando | fieldListModel.clear(); |
156 | |||
157 | try {
|
||
158 | for (int i = 0; i < model.getFieldCount(); i++) { |
||
159 | fieldListModel.addElement(model.getFieldName(i)); |
||
160 | 856 | fernando | } |
161 | 1146 | fernando | } catch (FilterException e) {
|
162 | throwException(e); |
||
163 | } |
||
164 | } |
||
165 | 856 | fernando | |
166 | 1146 | fernando | /**
|
167 | * Rellena la lista con los valores del campo seleccionado
|
||
168 | */
|
||
169 | 5591 | jaume | private void fillValues() { |
170 | 1146 | fernando | int index = lstCampos.getSelectedIndex();
|
171 | 856 | fernando | |
172 | 1146 | fernando | //Index es ahora el ?ndice del campo seleccionado
|
173 | //Se eliminan los duplicados
|
||
174 | TreeSet conjunto = new TreeSet(new Comparator() { |
||
175 | 5591 | jaume | public int compare(Object o1, Object o2) { |
176 | if ((o1 != null) && (o2 != null)) { |
||
177 | Value v2 = (Value) o2; |
||
178 | Value v1 = (Value) o1; |
||
179 | BooleanValue boolVal; |
||
180 | |||
181 | try {
|
||
182 | boolVal = (BooleanValue) (v1.greater(v2)); |
||
183 | |||
184 | if (boolVal.getValue()) {
|
||
185 | return 1; |
||
186 | 1077 | fjp | } |
187 | 5591 | jaume | |
188 | boolVal = (BooleanValue) (v1.less(v2)); |
||
189 | |||
190 | if (boolVal.getValue()) {
|
||
191 | return -1; |
||
192 | } |
||
193 | } catch (IncompatibleTypesException e) {
|
||
194 | throw new RuntimeException(e); |
||
195 | 1077 | fjp | } |
196 | 5591 | jaume | } |
197 | |||
198 | return 0; |
||
199 | } |
||
200 | }); // Para poder ordenar
|
||
201 | |||
202 | 1146 | fernando | valuesListModel.clear(); |
203 | try {
|
||
204 | for (int i = 0; i < model.getRowCount(); i++) { |
||
205 | Value value = model.getFieldValue(i, index); |
||
206 | |||
207 | 2496 | fernando | if (value instanceof NullValue) |
208 | continue;
|
||
209 | |||
210 | 1146 | fernando | if (!conjunto.contains(value)) {
|
211 | 2496 | fernando | conjunto.add(value); |
212 | 1077 | fjp | } |
213 | } |
||
214 | |||
215 | 1146 | fernando | Iterator it = conjunto.iterator();
|
216 | 856 | fernando | |
217 | 1146 | fernando | while (it.hasNext())
|
218 | 1077 | fjp | valuesListModel.addElement(it.next()); |
219 | 856 | fernando | } catch (FilterException e) {
|
220 | throwException(e); |
||
221 | } |
||
222 | 1146 | fernando | } |
223 | 856 | fernando | |
224 | 1146 | fernando | /**
|
225 | * DOCUMENT ME!
|
||
226 | *
|
||
227 | * @param expresion DOCUMENT ME!
|
||
228 | * @param substring DOCUMENT ME!
|
||
229 | * @param startingPos DOCUMENT ME!
|
||
230 | *
|
||
231 | * @return DOCUMENT ME!
|
||
232 | */
|
||
233 | private int getIndex(String expresion, String substring, int startingPos) { |
||
234 | int index = startingPos;
|
||
235 | 856 | fernando | |
236 | 1146 | fernando | do {
|
237 | index = expresion.indexOf(substring, index); |
||
238 | } while ((StringUtilities.isBetweenSymbols(expresion, index, "\"")) && |
||
239 | (index != -1));
|
||
240 | 856 | fernando | |
241 | 1146 | fernando | return index;
|
242 | } |
||
243 | 856 | fernando | |
244 | 1146 | fernando | /**
|
245 | * DOCUMENT ME!
|
||
246 | *
|
||
247 | * @param expresion DOCUMENT ME!
|
||
248 | * @param word DOCUMENT ME!
|
||
249 | * @param translation DOCUMENT ME!
|
||
250 | *
|
||
251 | * @return DOCUMENT ME!
|
||
252 | *
|
||
253 | * @throws ParseException DOCUMENT ME!
|
||
254 | */
|
||
255 | private String translateWord(String expresion, String word, |
||
256 | String translation) throws ParseException { |
||
257 | int booleanIndex = 0; |
||
258 | int endIndex = 0; |
||
259 | StringBuffer res = new StringBuffer(); |
||
260 | 856 | fernando | |
261 | 1146 | fernando | while ((booleanIndex = getIndex(expresion, word, booleanIndex)) != -1) { |
262 | res.append(expresion.substring(endIndex, booleanIndex)); |
||
263 | endIndex = booleanIndex + word.length(); |
||
264 | booleanIndex++; |
||
265 | res.append(translation); |
||
266 | } |
||
267 | 856 | fernando | |
268 | 1146 | fernando | if (endIndex < expresion.length()) {
|
269 | res.append(expresion.substring(endIndex)); |
||
270 | } |
||
271 | 856 | fernando | |
272 | 1146 | fernando | return res.toString();
|
273 | } |
||
274 | 856 | fernando | |
275 | 1146 | fernando | /**
|
276 | * DOCUMENT ME!
|
||
277 | *
|
||
278 | * @param expresion DOCUMENT ME!
|
||
279 | *
|
||
280 | * @return DOCUMENT ME!
|
||
281 | *
|
||
282 | * @throws ParseException DOCUMENT ME!
|
||
283 | */
|
||
284 | private String translateDates(String expresion) throws ParseException { |
||
285 | //Se obtiene el valor de la fecha
|
||
286 | String date = StringUtilities.substringDelimited(expresion, "Date(", |
||
287 | ")", 0); |
||
288 | 856 | fernando | |
289 | 1146 | fernando | if (date == null) { |
290 | return expresion;
|
||
291 | } |
||
292 | 856 | fernando | |
293 | 1146 | fernando | //Se comprueba que no est? entre comillas
|
294 | int startIndex = expresion.indexOf(date);
|
||
295 | 856 | fernando | |
296 | 1146 | fernando | while (startIndex != -1) { |
297 | if (!StringUtilities.isBetweenSymbols(expresion, startIndex, "\"")) { |
||
298 | //Se sustituye por el valor ordinal de la fecha
|
||
299 | expresion = expresion.substring(0, startIndex - 5) + |
||
300 | expresion.substring(startIndex).replaceFirst(date + "\\)",
|
||
301 | new Long((df.parse(date)).getTime()).toString()); |
||
302 | ; |
||
303 | } else {
|
||
304 | startIndex += date.length(); |
||
305 | } |
||
306 | 856 | fernando | |
307 | 1146 | fernando | //Se obtiene el valor de la fecha
|
308 | 856 | fernando | |
309 | 1146 | fernando | /* date = StringUtilities.substringDelimited(expresion, "Date(", ")",
|
310 | startIndex);
|
||
311 | */
|
||
312 | if (date == null) { |
||
313 | return expresion;
|
||
314 | } |
||
315 | 856 | fernando | |
316 | 1146 | fernando | startIndex = expresion.indexOf(date, startIndex); |
317 | } |
||
318 | 856 | fernando | |
319 | 1146 | fernando | return expresion;
|
320 | } |
||
321 | 856 | fernando | |
322 | 1146 | fernando | /**
|
323 | * DOCUMENT ME!
|
||
324 | *
|
||
325 | * @param expresion DOCUMENT ME!
|
||
326 | *
|
||
327 | * @return DOCUMENT ME!
|
||
328 | *
|
||
329 | * @throws ParseException DOCUMENT ME!
|
||
330 | */
|
||
331 | public String translateNumber(String expresion) throws ParseException { |
||
332 | DefaultCharSet ss = new DefaultCharSet();
|
||
333 | ss.addInterval('0', '9'); |
||
334 | ss.addCharacter(',');
|
||
335 | ss.addCharacter('.');
|
||
336 | 856 | fernando | |
337 | 1146 | fernando | String number = StringUtilities.substringWithSymbols(expresion, ss, 0); |
338 | 856 | fernando | |
339 | 1146 | fernando | if (number == null) { |
340 | return expresion;
|
||
341 | } |
||
342 | 856 | fernando | |
343 | 1146 | fernando | int startIndex = expresion.indexOf(number);
|
344 | 856 | fernando | |
345 | 1146 | fernando | while (startIndex != -1) { |
346 | Number n = nf.parse(number);
|
||
347 | 856 | fernando | |
348 | 1146 | fernando | if (!StringUtilities.isBetweenSymbols(expresion, startIndex, "\"")) { |
349 | //Se sustituye por el valor ordinal de la fecha
|
||
350 | expresion = expresion.substring(0, startIndex) +
|
||
351 | expresion.substring(startIndex).replaceFirst(number, |
||
352 | n.toString()); |
||
353 | } else {
|
||
354 | startIndex += n.toString().length(); |
||
355 | } |
||
356 | 856 | fernando | |
357 | 1146 | fernando | number = StringUtilities.substringWithSymbols(expresion, ss, |
358 | startIndex); |
||
359 | 856 | fernando | |
360 | 1146 | fernando | if (number == null) { |
361 | return expresion;
|
||
362 | } |
||
363 | 856 | fernando | |
364 | 1146 | fernando | startIndex = expresion.indexOf(number, startIndex); |
365 | } |
||
366 | 856 | fernando | |
367 | 1146 | fernando | return expresion;
|
368 | } |
||
369 | 856 | fernando | |
370 | 1146 | fernando | /**
|
371 | * DOCUMENT ME!
|
||
372 | *
|
||
373 | * @return DOCUMENT ME!
|
||
374 | *
|
||
375 | * @throws ParseException DOCUMENT ME!
|
||
376 | */
|
||
377 | private String validateExpression() throws ParseException { |
||
378 | String expression = txtExpression.getText();
|
||
379 | HashSet variablesIndexes = new HashSet(); |
||
380 | 856 | fernando | |
381 | 1146 | fernando | StringBuffer traducida = new StringBuffer(); |
382 | 856 | fernando | |
383 | 1146 | fernando | //Se transforman los nombres de los campos en las variables xix que analizar?n
|
384 | //Se quitan los Date(fecha) y se mete la fecha correspondiente
|
||
385 | expression = translateDates(expression); |
||
386 | expression = translateNumber(expression); |
||
387 | expression = translateWord(expression, "true", "1"); |
||
388 | expression = translateWord(expression, "false", "0"); |
||
389 | |||
390 | String replacement;
|
||
391 | Pattern patron = Pattern.compile("[^<>!]="); |
||
392 | Matcher m = patron.matcher(expression);
|
||
393 | int index = 0; |
||
394 | |||
395 | while (m.find(index)) {
|
||
396 | index = m.start(); |
||
397 | replacement = expression.charAt(index) + "==";
|
||
398 | m.replaceFirst(replacement); |
||
399 | index++; |
||
400 | } |
||
401 | |||
402 | expression = expression.replaceAll("[^<>!]=", "=="); |
||
403 | |||
404 | 856 | fernando | logger.debug(expression); |
405 | |||
406 | 1146 | fernando | return expression;
|
407 | } |
||
408 | 856 | fernando | |
409 | 1146 | fernando | /**
|
410 | * DOCUMENT ME!
|
||
411 | *
|
||
412 | * @param symbol DOCUMENT ME!
|
||
413 | */
|
||
414 | private void putSymbol(String symbol) { |
||
415 | int position = txtExpression.getCaretPosition();
|
||
416 | txtExpression.setText(StringUtilities.insert(txtExpression.getText(), |
||
417 | position, symbol)); |
||
418 | 856 | fernando | |
419 | 1146 | fernando | if (symbol.equals(" () ")) { |
420 | position = position + 2;
|
||
421 | } else {
|
||
422 | position = position + symbol.length(); |
||
423 | } |
||
424 | 856 | fernando | |
425 | 1146 | fernando | txtExpression.setCaretPosition(position); |
426 | } |
||
427 | 856 | fernando | |
428 | 1146 | fernando | /**
|
429 | * This method initializes this
|
||
430 | */
|
||
431 | private void initialize() { |
||
432 | this.setLayout(new java.awt.BorderLayout()); |
||
433 | this.add(getJPanel(), java.awt.BorderLayout.CENTER);
|
||
434 | this.add(getJPanel1(), java.awt.BorderLayout.SOUTH);
|
||
435 | } |
||
436 | 856 | fernando | |
437 | 1146 | fernando | /**
|
438 | * This method initializes jPanel
|
||
439 | *
|
||
440 | * @return javax.swing.JPanel
|
||
441 | */
|
||
442 | private javax.swing.JPanel getJPanel() {
|
||
443 | if (jPanel == null) { |
||
444 | jPanel = new javax.swing.JPanel();
|
||
445 | jPanel.setLayout(new java.awt.BorderLayout());
|
||
446 | jPanel.add(getJPanel2(), java.awt.BorderLayout.WEST); |
||
447 | jPanel.add(getJPanel3(), java.awt.BorderLayout.CENTER); |
||
448 | jPanel.add(getJPanel4(), java.awt.BorderLayout.EAST); |
||
449 | } |
||
450 | 856 | fernando | |
451 | 1146 | fernando | return jPanel;
|
452 | } |
||
453 | 856 | fernando | |
454 | 1146 | fernando | /**
|
455 | * This method initializes jPanel1
|
||
456 | *
|
||
457 | * @return javax.swing.JPanel
|
||
458 | */
|
||
459 | private javax.swing.JPanel getJPanel1() {
|
||
460 | if (jPanel1 == null) { |
||
461 | jPanel1 = new javax.swing.JPanel();
|
||
462 | jPanel1.add(getJScrollPane2(), null);
|
||
463 | jPanel1.add(getJPanel5(), null);
|
||
464 | jPanel1.setPreferredSize(new java.awt.Dimension(10, 110)); |
||
465 | } |
||
466 | 856 | fernando | |
467 | 1146 | fernando | return jPanel1;
|
468 | } |
||
469 | 856 | fernando | |
470 | 1146 | fernando | /**
|
471 | * This method initializes jPanel2
|
||
472 | *
|
||
473 | * @return javax.swing.JPanel
|
||
474 | */
|
||
475 | private javax.swing.JPanel getJPanel2() {
|
||
476 | if (jPanel2 == null) { |
||
477 | jPanel2 = new javax.swing.JPanel();
|
||
478 | jPanel2.add(getJLabel(), null);
|
||
479 | jPanel2.add(getJScrollPane(), null);
|
||
480 | jPanel2.setPreferredSize(new java.awt.Dimension(150, 170)); |
||
481 | } |
||
482 | 856 | fernando | |
483 | 1146 | fernando | return jPanel2;
|
484 | } |
||
485 | 856 | fernando | |
486 | 1146 | fernando | /**
|
487 | * This method initializes jPanel3
|
||
488 | *
|
||
489 | * @return javax.swing.JPanel
|
||
490 | */
|
||
491 | private javax.swing.JPanel getJPanel3() {
|
||
492 | if (jPanel3 == null) { |
||
493 | jPanel3 = new javax.swing.JPanel();
|
||
494 | jPanel3.add(getBtnIgual(), null);
|
||
495 | jPanel3.add(getBtnDistinto(), null);
|
||
496 | jPanel3.add(getBtnMayor(), null);
|
||
497 | jPanel3.add(getBtnMenor(), null);
|
||
498 | jPanel3.add(getBtnMenorIgual(), null);
|
||
499 | jPanel3.add(getBtnMayorIgual(), null);
|
||
500 | jPanel3.add(getBtnAnd(), null);
|
||
501 | jPanel3.add(getBtnOr(), null);
|
||
502 | jPanel3.add(getBtnNot(), null);
|
||
503 | jPanel3.add(getBtnParentesis(), null);
|
||
504 | jPanel3.add(getBtnName(), null);
|
||
505 | jPanel3.setPreferredSize(new java.awt.Dimension(180, 36)); |
||
506 | } |
||
507 | 856 | fernando | |
508 | 1146 | fernando | return jPanel3;
|
509 | } |
||
510 | 856 | fernando | |
511 | 1146 | fernando | /**
|
512 | * This method initializes jPanel4
|
||
513 | *
|
||
514 | * @return javax.swing.JPanel
|
||
515 | */
|
||
516 | private javax.swing.JPanel getJPanel4() {
|
||
517 | if (jPanel4 == null) { |
||
518 | jPanel4 = new javax.swing.JPanel();
|
||
519 | jPanel4.add(getJLabel1(), null);
|
||
520 | jPanel4.add(getJScrollPane1(), null);
|
||
521 | jPanel4.setPreferredSize(new java.awt.Dimension(150, 10)); |
||
522 | } |
||
523 | 856 | fernando | |
524 | 1146 | fernando | return jPanel4;
|
525 | } |
||
526 | 856 | fernando | |
527 | 1146 | fernando | /**
|
528 | * This method initializes jLabel
|
||
529 | *
|
||
530 | * @return javax.swing.JLabel
|
||
531 | */
|
||
532 | private javax.swing.JLabel getJLabel() {
|
||
533 | if (jLabel == null) { |
||
534 | jLabel = new javax.swing.JLabel();
|
||
535 | jLabel.setText(PluginServices.getText(this, "Campos") + ":"); |
||
536 | } |
||
537 | 856 | fernando | |
538 | 1146 | fernando | return jLabel;
|
539 | } |
||
540 | 856 | fernando | |
541 | 1146 | fernando | /**
|
542 | * This method initializes jScrollPane
|
||
543 | *
|
||
544 | * @return javax.swing.JScrollPane
|
||
545 | */
|
||
546 | private javax.swing.JScrollPane getJScrollPane() {
|
||
547 | if (jScrollPane == null) { |
||
548 | jScrollPane = new javax.swing.JScrollPane();
|
||
549 | jScrollPane.setViewportView(getLstCampos()); |
||
550 | jScrollPane.setPreferredSize(new java.awt.Dimension(135, 120)); |
||
551 | } |
||
552 | 856 | fernando | |
553 | 1146 | fernando | return jScrollPane;
|
554 | } |
||
555 | 856 | fernando | |
556 | 1146 | fernando | /**
|
557 | * This method initializes lstCampos
|
||
558 | *
|
||
559 | * @return javax.swing.JList
|
||
560 | */
|
||
561 | private javax.swing.JList getLstCampos() {
|
||
562 | if (lstCampos == null) { |
||
563 | lstCampos = new javax.swing.JList();
|
||
564 | lstCampos.setModel(fieldListModel); |
||
565 | lstCampos.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
||
566 | lstCampos.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
|
||
567 | public void valueChanged( |
||
568 | javax.swing.event.ListSelectionEvent e) { |
||
569 | 1177 | fernando | PluginServices.backgroundExecution(new Runnable() { |
570 | public void run() { |
||
571 | 5591 | jaume | fillValues(); |
572 | 1177 | fernando | } |
573 | }); |
||
574 | 1146 | fernando | } |
575 | }); |
||
576 | lstCampos.addMouseListener(new java.awt.event.MouseAdapter() {
|
||
577 | public void mouseClicked(java.awt.event.MouseEvent e) { |
||
578 | if (e.getClickCount() == 2) { |
||
579 | putSymbol((String) fieldListModel.getElementAt(
|
||
580 | getLstCampos().getSelectedIndex())); |
||
581 | } |
||
582 | } |
||
583 | }); |
||
584 | } |
||
585 | 856 | fernando | |
586 | 1146 | fernando | return lstCampos;
|
587 | } |
||
588 | 856 | fernando | |
589 | 1146 | fernando | /**
|
590 | * This method initializes btnIgual
|
||
591 | *
|
||
592 | * @return javax.swing.JButton
|
||
593 | */
|
||
594 | private javax.swing.JButton getBtnIgual() {
|
||
595 | if (btnIgual == null) { |
||
596 | btnIgual = new javax.swing.JButton();
|
||
597 | btnIgual.setText("=");
|
||
598 | btnIgual.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
599 | btnIgual.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
600 | btnIgual.addActionListener(new java.awt.event.ActionListener() {
|
||
601 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
602 | putSymbol(" = ");
|
||
603 | } |
||
604 | }); |
||
605 | } |
||
606 | 856 | fernando | |
607 | 1146 | fernando | return btnIgual;
|
608 | } |
||
609 | 856 | fernando | |
610 | 1146 | fernando | /**
|
611 | * This method initializes btnMayor
|
||
612 | *
|
||
613 | * @return javax.swing.JButton
|
||
614 | */
|
||
615 | private javax.swing.JButton getBtnMayor() {
|
||
616 | if (btnMayor == null) { |
||
617 | btnMayor = new javax.swing.JButton();
|
||
618 | btnMayor.setText(">");
|
||
619 | btnMayor.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
620 | btnMayor.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
621 | btnMayor.addActionListener(new java.awt.event.ActionListener() {
|
||
622 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
623 | putSymbol(" > ");
|
||
624 | } |
||
625 | }); |
||
626 | } |
||
627 | 856 | fernando | |
628 | 1146 | fernando | return btnMayor;
|
629 | } |
||
630 | 856 | fernando | |
631 | 1146 | fernando | /**
|
632 | * This method initializes btnNot
|
||
633 | *
|
||
634 | * @return javax.swing.JButton
|
||
635 | */
|
||
636 | private javax.swing.JButton getBtnNot() {
|
||
637 | if (btnNot == null) { |
||
638 | btnNot = new javax.swing.JButton();
|
||
639 | btnNot.setText("Not");
|
||
640 | btnNot.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
641 | btnNot.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
642 | btnNot.addActionListener(new java.awt.event.ActionListener() {
|
||
643 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
644 | putSymbol(" not ");
|
||
645 | } |
||
646 | }); |
||
647 | } |
||
648 | 856 | fernando | |
649 | 1146 | fernando | return btnNot;
|
650 | } |
||
651 | 856 | fernando | |
652 | 1146 | fernando | /**
|
653 | * This method initializes btnDistinto
|
||
654 | *
|
||
655 | * @return javax.swing.JButton
|
||
656 | */
|
||
657 | private javax.swing.JButton getBtnDistinto() {
|
||
658 | if (btnDistinto == null) { |
||
659 | btnDistinto = new javax.swing.JButton();
|
||
660 | btnDistinto.setText("!=");
|
||
661 | btnDistinto.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
662 | btnDistinto.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
663 | btnDistinto.addActionListener(new java.awt.event.ActionListener() {
|
||
664 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
665 | putSymbol(" <> ");
|
||
666 | } |
||
667 | }); |
||
668 | } |
||
669 | 856 | fernando | |
670 | 1146 | fernando | return btnDistinto;
|
671 | } |
||
672 | 856 | fernando | |
673 | 1146 | fernando | /**
|
674 | * This method initializes btnMenor
|
||
675 | *
|
||
676 | * @return javax.swing.JButton
|
||
677 | */
|
||
678 | private javax.swing.JButton getBtnMenor() {
|
||
679 | if (btnMenor == null) { |
||
680 | btnMenor = new javax.swing.JButton();
|
||
681 | btnMenor.setText("<");
|
||
682 | btnMenor.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
683 | btnMenor.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
684 | btnMenor.addActionListener(new java.awt.event.ActionListener() {
|
||
685 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
686 | putSymbol(" < ");
|
||
687 | } |
||
688 | }); |
||
689 | } |
||
690 | 856 | fernando | |
691 | 1146 | fernando | return btnMenor;
|
692 | } |
||
693 | 856 | fernando | |
694 | 1146 | fernando | /**
|
695 | * This method initializes btnMayorIgual
|
||
696 | *
|
||
697 | * @return javax.swing.JButton
|
||
698 | */
|
||
699 | private javax.swing.JButton getBtnMayorIgual() {
|
||
700 | if (btnMayorIgual == null) { |
||
701 | btnMayorIgual = new javax.swing.JButton();
|
||
702 | btnMayorIgual.setText(">=");
|
||
703 | btnMayorIgual.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
704 | btnMayorIgual.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
705 | btnMayorIgual.addActionListener(new java.awt.event.ActionListener() {
|
||
706 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
707 | putSymbol(" >= ");
|
||
708 | } |
||
709 | }); |
||
710 | } |
||
711 | 856 | fernando | |
712 | 1146 | fernando | return btnMayorIgual;
|
713 | } |
||
714 | 856 | fernando | |
715 | 1146 | fernando | /**
|
716 | * This method initializes btnMenorIgual
|
||
717 | *
|
||
718 | * @return javax.swing.JButton
|
||
719 | */
|
||
720 | private javax.swing.JButton getBtnMenorIgual() {
|
||
721 | if (btnMenorIgual == null) { |
||
722 | btnMenorIgual = new javax.swing.JButton();
|
||
723 | btnMenorIgual.setText("<=");
|
||
724 | btnMenorIgual.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
725 | btnMenorIgual.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
726 | btnMenorIgual.addActionListener(new java.awt.event.ActionListener() {
|
||
727 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
728 | putSymbol(" <= ");
|
||
729 | } |
||
730 | }); |
||
731 | } |
||
732 | 856 | fernando | |
733 | 1146 | fernando | return btnMenorIgual;
|
734 | } |
||
735 | 856 | fernando | |
736 | 1146 | fernando | /**
|
737 | * This method initializes btnAnd
|
||
738 | *
|
||
739 | * @return javax.swing.JButton
|
||
740 | */
|
||
741 | private javax.swing.JButton getBtnAnd() {
|
||
742 | if (btnAnd == null) { |
||
743 | btnAnd = new javax.swing.JButton();
|
||
744 | btnAnd.setText("And");
|
||
745 | btnAnd.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
746 | btnAnd.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
747 | btnAnd.addActionListener(new java.awt.event.ActionListener() {
|
||
748 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
749 | putSymbol(" and ");
|
||
750 | } |
||
751 | }); |
||
752 | } |
||
753 | 856 | fernando | |
754 | 1146 | fernando | return btnAnd;
|
755 | } |
||
756 | 856 | fernando | |
757 | 1146 | fernando | /**
|
758 | * This method initializes btnOr
|
||
759 | *
|
||
760 | * @return javax.swing.JButton
|
||
761 | */
|
||
762 | private javax.swing.JButton getBtnOr() {
|
||
763 | if (btnOr == null) { |
||
764 | btnOr = new javax.swing.JButton();
|
||
765 | btnOr.setText("Or");
|
||
766 | btnOr.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
767 | btnOr.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
768 | btnOr.addActionListener(new java.awt.event.ActionListener() {
|
||
769 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
770 | putSymbol(" or ");
|
||
771 | } |
||
772 | }); |
||
773 | } |
||
774 | 856 | fernando | |
775 | 1146 | fernando | return btnOr;
|
776 | } |
||
777 | 856 | fernando | |
778 | 1146 | fernando | /**
|
779 | * This method initializes txtExpression
|
||
780 | *
|
||
781 | * @return javax.swing.JTextArea
|
||
782 | */
|
||
783 | private javax.swing.JTextArea getTxtExpression() {
|
||
784 | if (txtExpression == null) { |
||
785 | txtExpression = new javax.swing.JTextArea();
|
||
786 | txtExpression.setLineWrap(true);
|
||
787 | } |
||
788 | 856 | fernando | |
789 | 1146 | fernando | return txtExpression;
|
790 | } |
||
791 | 856 | fernando | |
792 | 1146 | fernando | /**
|
793 | * This method initializes jPanel5
|
||
794 | *
|
||
795 | * @return javax.swing.JPanel
|
||
796 | */
|
||
797 | private javax.swing.JPanel getJPanel5() {
|
||
798 | if (jPanel5 == null) { |
||
799 | jPanel5 = new javax.swing.JPanel();
|
||
800 | jPanel5.add(getBtnNuevo(), null);
|
||
801 | jPanel5.add(getBtnAdd(), null);
|
||
802 | jPanel5.add(getBtnFromSet(), null);
|
||
803 | jPanel5.setPreferredSize(new java.awt.Dimension(190, 100)); |
||
804 | } |
||
805 | 856 | fernando | |
806 | 1146 | fernando | return jPanel5;
|
807 | } |
||
808 | |||
809 | /**
|
||
810 | * This method initializes btnNuevo
|
||
811 | *
|
||
812 | * @return javax.swing.JButton
|
||
813 | */
|
||
814 | private javax.swing.JButton getBtnNuevo() {
|
||
815 | if (btnNuevo == null) { |
||
816 | btnNuevo = new javax.swing.JButton();
|
||
817 | btnNuevo.setText(PluginServices.getText(this, "Nuevo_conjunto")); |
||
818 | btnNuevo.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
819 | btnNuevo.addActionListener(new java.awt.event.ActionListener() {
|
||
820 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
821 | 2495 | fernando | final String expr = "select * from '" + |
822 | model.getDataSourceName() + "' where " +
|
||
823 | 1146 | fernando | getTxtExpression().getText() + ";";
|
824 | |||
825 | 884 | fernando | logger.debug(expr); |
826 | 856 | fernando | |
827 | 1146 | fernando | PluginServices.backgroundExecution(new Runnable() { |
828 | public void run() { |
||
829 | for (int i = 0; i < expressionListeners.size(); i++) { |
||
830 | ExpressionListener l = (ExpressionListener) expressionListeners.get(i); |
||
831 | l.newSet(expr); |
||
832 | } |
||
833 | } |
||
834 | }); |
||
835 | } |
||
836 | }); |
||
837 | } |
||
838 | 856 | fernando | |
839 | 1146 | fernando | return btnNuevo;
|
840 | } |
||
841 | |||
842 | /**
|
||
843 | * This method initializes btnAdd
|
||
844 | *
|
||
845 | * @return javax.swing.JButton
|
||
846 | */
|
||
847 | private javax.swing.JButton getBtnAdd() {
|
||
848 | if (btnAdd == null) { |
||
849 | btnAdd = new javax.swing.JButton();
|
||
850 | btnAdd.setText(PluginServices.getText(this, "Anadir_al_conjunto")); |
||
851 | btnAdd.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
852 | 856 | fernando | btnAdd.addActionListener(new java.awt.event.ActionListener() {
|
853 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
854 | 2495 | fernando | final String expr = "select * from '" + |
855 | model.getDataSourceName() + "' where " +
|
||
856 | 1146 | fernando | getTxtExpression().getText() + ";";
|
857 | |||
858 | 884 | fernando | logger.debug(expr); |
859 | 1146 | fernando | |
860 | PluginServices.backgroundExecution(new Runnable() { |
||
861 | public void run() { |
||
862 | for (int i = 0; |
||
863 | i < expressionListeners.size(); |
||
864 | i++) { |
||
865 | ExpressionListener l = (ExpressionListener) expressionListeners.get(i); |
||
866 | l.addToSet(expr); |
||
867 | } |
||
868 | } |
||
869 | }); |
||
870 | 856 | fernando | } |
871 | }); |
||
872 | 1146 | fernando | } |
873 | 856 | fernando | |
874 | 1146 | fernando | return btnAdd;
|
875 | } |
||
876 | 856 | fernando | |
877 | 1146 | fernando | /**
|
878 | * This method initializes btnFromSet
|
||
879 | *
|
||
880 | * @return javax.swing.JButton
|
||
881 | */
|
||
882 | private javax.swing.JButton getBtnFromSet() {
|
||
883 | if (btnFromSet == null) { |
||
884 | btnFromSet = new javax.swing.JButton();
|
||
885 | btnFromSet.setText(PluginServices.getText(this,
|
||
886 | "Seleccionar_del_conjunto"));
|
||
887 | btnFromSet.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
888 | 856 | fernando | btnFromSet.addActionListener(new java.awt.event.ActionListener() {
|
889 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
890 | 2495 | fernando | final String expr = "select * from '" + |
891 | model.getDataSourceName() + "' where " +
|
||
892 | 1146 | fernando | getTxtExpression().getText() + ";";
|
893 | |||
894 | 884 | fernando | logger.debug(expr); |
895 | 1146 | fernando | |
896 | PluginServices.backgroundExecution(new Runnable() { |
||
897 | public void run() { |
||
898 | for (int i = 0; i < expressionListeners.size(); i++) { |
||
899 | ExpressionListener l = (ExpressionListener) expressionListeners.get(i); |
||
900 | l.fromSet(expr); |
||
901 | } |
||
902 | } |
||
903 | }); |
||
904 | 856 | fernando | } |
905 | }); |
||
906 | 1146 | fernando | } |
907 | 856 | fernando | |
908 | 1146 | fernando | return btnFromSet;
|
909 | } |
||
910 | 856 | fernando | |
911 | 1146 | fernando | /**
|
912 | * This method initializes jScrollPane1
|
||
913 | *
|
||
914 | * @return javax.swing.JScrollPane
|
||
915 | */
|
||
916 | private javax.swing.JScrollPane getJScrollPane1() {
|
||
917 | if (jScrollPane1 == null) { |
||
918 | jScrollPane1 = new javax.swing.JScrollPane();
|
||
919 | jScrollPane1.setViewportView(getLstValores()); |
||
920 | jScrollPane1.setPreferredSize(new java.awt.Dimension(140, 120)); |
||
921 | } |
||
922 | 856 | fernando | |
923 | 1146 | fernando | return jScrollPane1;
|
924 | } |
||
925 | 856 | fernando | |
926 | 1146 | fernando | /**
|
927 | * This method initializes jLabel1
|
||
928 | *
|
||
929 | * @return javax.swing.JLabel
|
||
930 | */
|
||
931 | private javax.swing.JLabel getJLabel1() {
|
||
932 | if (jLabel1 == null) { |
||
933 | jLabel1 = new javax.swing.JLabel();
|
||
934 | jLabel1.setText(PluginServices.getText(this, "Valores") + ":"); |
||
935 | } |
||
936 | 856 | fernando | |
937 | 1146 | fernando | return jLabel1;
|
938 | } |
||
939 | 856 | fernando | |
940 | 1146 | fernando | /**
|
941 | * This method initializes lstValores
|
||
942 | *
|
||
943 | * @return javax.swing.JList
|
||
944 | */
|
||
945 | private javax.swing.JList getLstValores() {
|
||
946 | if (lstValores == null) { |
||
947 | lstValores = new javax.swing.JList();
|
||
948 | lstValores.setModel(valuesListModel); |
||
949 | lstValores.addMouseListener(new java.awt.event.MouseAdapter() {
|
||
950 | public void mouseClicked(java.awt.event.MouseEvent e) { |
||
951 | if (e.getClickCount() == 2) { |
||
952 | Value valor = (Value) valuesListModel.getElementAt(getLstValores() |
||
953 | .getSelectedIndex()); |
||
954 | 856 | fernando | |
955 | 1146 | fernando | if (valor instanceof DateValue) { |
956 | putSymbol("date('" + valor + "')"); |
||
957 | } else if (valor instanceof BooleanValue) { |
||
958 | putSymbol("boolean('" + valor.toString() +
|
||
959 | "')");
|
||
960 | } else if (valor instanceof StringValue) { |
||
961 | putSymbol("'" + valor + "'"); |
||
962 | } else {
|
||
963 | putSymbol(valor.toString()); |
||
964 | } |
||
965 | } |
||
966 | } |
||
967 | }); |
||
968 | } |
||
969 | 856 | fernando | |
970 | 1146 | fernando | return lstValores;
|
971 | } |
||
972 | 856 | fernando | |
973 | 1146 | fernando | /**
|
974 | * This method initializes jScrollPane2
|
||
975 | *
|
||
976 | * @return javax.swing.JScrollPane
|
||
977 | */
|
||
978 | private javax.swing.JScrollPane getJScrollPane2() {
|
||
979 | if (jScrollPane2 == null) { |
||
980 | jScrollPane2 = new javax.swing.JScrollPane();
|
||
981 | jScrollPane2.setViewportView(getTxtExpression()); |
||
982 | jScrollPane2.setPreferredSize(new java.awt.Dimension(250, 100)); |
||
983 | jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); |
||
984 | } |
||
985 | 856 | fernando | |
986 | 1146 | fernando | return jScrollPane2;
|
987 | } |
||
988 | 856 | fernando | |
989 | 1146 | fernando | /**
|
990 | * This method initializes btnParentesis
|
||
991 | *
|
||
992 | * @return javax.swing.JButton
|
||
993 | */
|
||
994 | private javax.swing.JButton getBtnParentesis() {
|
||
995 | if (btnParentesis == null) { |
||
996 | btnParentesis = new javax.swing.JButton();
|
||
997 | btnParentesis.setText("()");
|
||
998 | btnParentesis.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
||
999 | btnParentesis.setPreferredSize(new java.awt.Dimension(40, 20)); |
||
1000 | btnParentesis.addActionListener(new java.awt.event.ActionListener() {
|
||
1001 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
1002 | putSymbol(" () ");
|
||
1003 | } |
||
1004 | }); |
||
1005 | } |
||
1006 | 856 | fernando | |
1007 | 1146 | fernando | return btnParentesis;
|
1008 | } |
||
1009 | 856 | fernando | |
1010 | 1146 | fernando | /**
|
1011 | * This method initializes btnName
|
||
1012 | *
|
||
1013 | * @return javax.swing.JButton
|
||
1014 | */
|
||
1015 | private javax.swing.JButton getBtnName() {
|
||
1016 | if (btnName == null) { |
||
1017 | btnName = new javax.swing.JButton();
|
||
1018 | btnName.setText("Date");
|
||
1019 | btnName.addActionListener(new java.awt.event.ActionListener() {
|
||
1020 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
1021 | JDateChooser chooser = new JDateChooser();
|
||
1022 | 856 | fernando | |
1023 | 6880 | cesar | PluginServices.getMDIManager().addWindow(chooser); |
1024 | 1146 | fernando | |
1025 | 2483 | fernando | if (chooser.getSelectedDate() != null){ |
1026 | Date selectedDate = chooser.getSelectedDate().getTime();
|
||
1027 | 1146 | fernando | |
1028 | 2483 | fernando | if (selectedDate != null) { |
1029 | putSymbol("Date(" + df.format(selectedDate) + ")"); |
||
1030 | } |
||
1031 | 856 | fernando | } |
1032 | 1146 | fernando | } |
1033 | }); |
||
1034 | } |
||
1035 | 856 | fernando | |
1036 | 1146 | fernando | return btnName;
|
1037 | } |
||
1038 | 856 | fernando | |
1039 | 1146 | fernando | /**
|
1040 | * DOCUMENT ME!
|
||
1041 | *
|
||
1042 | * @param arg0
|
||
1043 | *
|
||
1044 | * @return
|
||
1045 | */
|
||
1046 | public boolean addExpressionListener(ExpressionListener arg0) { |
||
1047 | return expressionListeners.add(arg0);
|
||
1048 | } |
||
1049 | 856 | fernando | |
1050 | 1146 | fernando | /**
|
1051 | * DOCUMENT ME!
|
||
1052 | *
|
||
1053 | * @param arg0
|
||
1054 | *
|
||
1055 | * @return
|
||
1056 | */
|
||
1057 | public boolean removeExpressionListener(ExpressionListener arg0) { |
||
1058 | return expressionListeners.remove(arg0);
|
||
1059 | } |
||
1060 | 856 | fernando | |
1061 | /**
|
||
1062 | 6880 | cesar | * @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
|
1063 | 856 | fernando | */
|
1064 | 6880 | cesar | public WindowInfo getWindowInfo() {
|
1065 | WindowInfo vi = new WindowInfo(WindowInfo.ICONIFIABLE);
|
||
1066 | 954 | fernando | vi.setWidth(480);
|
1067 | vi.setHeight(362);
|
||
1068 | 7028 | ldiaz | vi.setTitle(PluginServices.getText( this, "filtro") + " (" + title + ")"); |
1069 | 954 | fernando | return vi;
|
1070 | 856 | fernando | } |
1071 | |||
1072 | 1146 | fernando | /**
|
1073 | * DOCUMENT ME!
|
||
1074 | *
|
||
1075 | * @param o DOCUMENT ME!
|
||
1076 | */
|
||
1077 | 856 | fernando | public void addExceptionListener(ExceptionListener o) { |
1078 | exceptionHandlingSupport.addExceptionListener(o); |
||
1079 | } |
||
1080 | 1146 | fernando | |
1081 | /**
|
||
1082 | * DOCUMENT ME!
|
||
1083 | *
|
||
1084 | * @param o DOCUMENT ME!
|
||
1085 | *
|
||
1086 | * @return DOCUMENT ME!
|
||
1087 | */
|
||
1088 | 856 | fernando | public boolean removeExceptionListener(ExceptionListener o) { |
1089 | return exceptionHandlingSupport.removeExceptionListener(o);
|
||
1090 | } |
||
1091 | 1146 | fernando | |
1092 | /**
|
||
1093 | * DOCUMENT ME!
|
||
1094 | *
|
||
1095 | * @param t DOCUMENT ME!
|
||
1096 | */
|
||
1097 | 856 | fernando | private void throwException(Throwable t) { |
1098 | exceptionHandlingSupport.throwException(t); |
||
1099 | } |
||
1100 | 1365 | fjp | |
1101 | /* (non-Javadoc)
|
||
1102 | * @see com.iver.andami.ui.mdiManager.ViewListener#viewActivated()
|
||
1103 | */
|
||
1104 | 6880 | cesar | public void windowActivated() { |
1105 | 1365 | fjp | } |
1106 | |||
1107 | /* (non-Javadoc)
|
||
1108 | * @see com.iver.andami.ui.mdiManager.ViewListener#viewClosed()
|
||
1109 | */
|
||
1110 | 6880 | cesar | public void windowClosed() { |
1111 | 1365 | fjp | try {
|
1112 | model.stop(); |
||
1113 | } catch (DriverException e) {
|
||
1114 | NotificationManager.addError(e.getMessage(), e); |
||
1115 | } |
||
1116 | } |
||
1117 | 856 | fernando | } |
1118 | |||
1119 | // @jve:visual-info decl-index=0 visual-constraint="10,10" |