After reviewing the code a little bit more, it looks like the latest change that was made will almost do what I am looking for. I could listen for a DateParseException and set my model value to null when a invalid date is specified. The only problem is that the parseTextDate() method does not notify with a DateParseException if a NumberFormatException occurs which is what will happen if you enter a invalidate date such as "09/03/2000a". The catch on Exception should also throw a DateParseException instead of just printing the stack trace. At least that way we know that something is wrong with the date.
On Thu, Sep 3, 2009 at 7:29 AM, Marty Jones <[email protected]> wrote: > I have setup a CalendarControl and added a CalendarListener. I noticed > that if I enter in a valid date into the CalendarCombo control such as > "09/03/2009" the CalendarListener fires and lets me know tha the date > changed. The problem comes in If I change the date by adding the letter a > to the end "09/03/2009a" then the CalendarListener does not fire because > there is a parsing exception. This leaves the control having a value that > is inconsistent with the last value that the CalendarListener set. > > I guess what I am asking is should the CalendarListener event still be > fired in the event of a ParseException and set the date value to null so > that the state of the control and the model stay consistent? > > This can be easily accomplished by modifying the code in the parseTextDate > method. > > Marty >
_______________________________________________ nebula-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/nebula-dev
