01: package org.osbl.issue.gui;
02:
03: import org.conform.*;
04:
05: /**
06: * @author hengels
07: * @version $Revision: 840 $
08: */
09: public class NowOrNeverPropertyData extends DefaultPropertyData {
10: public NowOrNeverPropertyData(DefaultBeanData beanData,
11: PropertyMeta property) {
12: super (beanData, property);
13: }
14:
15: public Object getValue() {
16: return super .getValue() != null;
17: }
18:
19: public void setValue(Object value) {
20: if (Boolean.TRUE.equals(value)) {
21: Class type = getPropertyMeta().getType();
22: if (java.util.Date.class.equals(type))
23: super .setValue(new java.util.Date());
24: else if (java.sql.Timestamp.class.equals(type))
25: super .setValue(new java.sql.Timestamp(System
26: .currentTimeMillis()));
27: else if (java.sql.Date.class.equals(type))
28: super .setValue(new java.sql.Date(System
29: .currentTimeMillis()));
30: else if (java.sql.Time.class.equals(type))
31: super .setValue(new java.sql.Time(System
32: .currentTimeMillis()));
33: else if (java.util.Calendar.class.equals(type))
34: super.setValue(java.util.Calendar.getInstance());
35: } else
36: super.setValue(null);
37: }
38: }
|