Revision 45185 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/SearchConditionFieldController.java
SearchConditionFieldController.java | ||
---|---|---|
24 | 24 |
import javax.swing.JLabel; |
25 | 25 |
import javax.swing.JOptionPane; |
26 | 26 |
import javax.swing.SwingUtilities; |
27 |
import javax.swing.text.JTextComponent; |
|
27 | 28 |
import org.apache.commons.lang3.StringUtils; |
28 | 29 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
29 | 30 |
import org.gvsig.fmap.dal.DALLocator; |
... | ... | |
45 | 46 |
import org.gvsig.tools.dataTypes.Coercion; |
46 | 47 |
import org.gvsig.tools.dataTypes.CoercionException; |
47 | 48 |
import org.gvsig.tools.dataTypes.DataTypeUtils; |
49 |
import org.gvsig.tools.dataTypes.DataTypes; |
|
48 | 50 |
import org.gvsig.tools.dispose.DisposeUtils; |
49 | 51 |
import org.gvsig.tools.dynobject.DynField; |
50 | 52 |
import org.gvsig.tools.exception.BaseException; |
... | ... | |
52 | 54 |
import org.gvsig.tools.swing.api.DropDown; |
53 | 55 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
54 | 56 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
57 |
import org.gvsig.tools.swing.api.pickercontroller.DatePickerController; |
|
55 | 58 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
56 | 59 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
57 | 60 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
... | ... | |
156 | 159 |
private LabeledValue[] relationalOperators; |
157 | 160 |
private LabeledValue[] logicalOperators; |
158 | 161 |
private final int SIZE_ORDERED_ATTRIBUTES = 20; |
162 |
|
|
163 |
private DatePickerController dateController = null; |
|
159 | 164 |
|
160 | 165 |
public SearchConditionFieldController( |
161 | 166 |
FeatureStore store, |
... | ... | |
382 | 387 |
if (field == null) { |
383 | 388 |
return; |
384 | 389 |
} |
390 |
FeatureAttributeDescriptor descriptor = field.getDescriptor(); |
|
391 |
if( descriptor.getType()==DataTypes.DATE ) { |
|
392 |
if( this.dateController == null ) { |
|
393 |
this.dateController = ToolsSwingLocator.getToolsSwingManager().createDatePickerController( |
|
394 |
(JTextComponent) this.cboValue.getEditor().getEditorComponent(), |
|
395 |
null |
|
396 |
); |
|
397 |
} |
|
398 |
} else { |
|
399 |
if( this.dateController != null ) { |
|
400 |
this.dateController.uninstall(); |
|
401 |
this.dateController = null; |
|
402 |
} |
|
403 |
} |
|
385 | 404 |
|
386 | 405 |
final List<Object> values = new ArrayList<>(); |
387 | 406 |
final int limit = 60; |
... | ... | |
523 | 542 |
if (field == null) { |
524 | 543 |
return null; |
525 | 544 |
} |
526 |
Object v = this.cboValue.getSelectedItem(); |
|
545 |
Object v; |
|
546 |
if( this.dateController==null ) { |
|
547 |
v = this.cboValue.getSelectedItem(); |
|
548 |
} else { |
|
549 |
v = this.dateController.get(); |
|
550 |
} |
|
527 | 551 |
if (v == null) { |
528 | 552 |
return null; |
529 | 553 |
} |
Also available in: Unified diff