Author: jdonnerstag Date: Tue Dec 22 16:12:22 2009 New Revision: 893215 URL: http://svn.apache.org/viewvc?rev=893215&view=rev Log: WICKET-2626 fixed Make DatePicker on DateTimeField overrideable
Modified: wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java Modified: wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java?rev=893215&r1=893214&r2=893215&view=diff ============================================================================== --- wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java (original) +++ wicket/trunk/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java Tue Dec 22 16:12:22 2009 @@ -119,17 +119,7 @@ setType(Date.class); PropertyModel<Date> dateFieldModel = new PropertyModel<Date>(this, "date"); add(dateField = newDateTextField("date", dateFieldModel)); - dateField.add(new DatePicker() - { - private static final long serialVersionUID = 1L; - - @Override - protected void configure(Map<String, Object> widgetProperties) - { - super.configure(widgetProperties); - DateTimeField.this.configure(widgetProperties); - } - }); + dateField.add(newDatePicker()); add(hoursField = new TextField<Integer>("hours", new PropertyModel<Integer>(this, "hours"), Integer.class)); hoursField.add(new HoursValidator()); @@ -495,4 +485,23 @@ } } } + + /** + * The DatePicker that gets added to the DateTimeField component. Users may override this method + * with a DatePicker of their choice. + */ + protected DatePicker newDatePicker() + { + return new DatePicker() + { + private static final long serialVersionUID = 1L; + + @Override + protected void configure(Map<String, Object> widgetProperties) + { + super.configure(widgetProperties); + DateTimeField.this.configure(widgetProperties); + } + }; + } }