Locale locale = Session.get().getLocale();
if (locale != null) {
if (JQuery.isDebug())
addUserProvidedResourceReferences(new JQueryJavascriptResourceReference(DatePicker.class, "jquery.ui.datepicker-" + locale.getLanguage() + ".js"));
else
addUserProvidedResourceReferences(new JQueryJavascriptResourceReference(DatePicker.class, "jquery.ui.datepicker-" + locale.getLanguage() + ".min.js"));
}
if (icon != null)
setButtonImage(icon);