KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > view > DateInputDummy


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.designer.view;
5
6 import java.text.ParseException JavaDoc;
7
8 import org.oddjob.designer.model.DateInput;
9 import org.oddjob.util.DateHelper;
10
11 public class DateInputDummy extends DummyView {
12     
13     private DateInput dateInput;
14     
15     public DateInputDummy(DateInput dateInput) {
16         this.dateInput = dateInput;
17     }
18     
19     public void attribute(String JavaDoc attribute) {
20         try {
21             dateInput.setDate(DateHelper.parseDate(attribute));
22         } catch (ParseException JavaDoc e) {
23             throw new IllegalArgumentException JavaDoc(attribute);
24         }
25     }
26     
27     public String JavaDoc attribute() {
28         return DateHelper.formatDate(dateInput.getDate());
29     }
30 }
31
Popular Tags