Author: nbelaevski
Date: 2008-04-11 17:48:02 -0400 (Fri, 11 Apr 2008)
New Revision: 7781
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
Calendar build fixed
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-04-11
21:41:01 UTC (rev 7780)
+++
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-04-11
21:48:02 UTC (rev 7781)
@@ -36,6 +36,7 @@
import java.util.Set;
import javax.el.ValueExpression;
+import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -57,8 +58,6 @@
import org.richfaces.component.util.ComponentUtil;
import org.richfaces.event.CurrentDateChangeEvent;
-import com.sun.faces.util.Util;
-
/**
* @author Nick Belaevski - mailto:nbelaevski@exadel.com created 08.06.2007
*
@@ -134,7 +133,7 @@
if((converterType != null) && (converterType != Object.class)) {
// if getType returns a type for which we support a default
// conversion, acquire an appropriate converter instance.
- converter = Util.getConverterForClass(converterType, context);
+ converter = getConverterForClass(converterType, context);
}
}
@@ -145,6 +144,20 @@
return converter.getAsObject(context, component, newValue);
}
+ private Converter getConverterForClass(Class converterClass, FacesContext context) {
+ if (converterClass == null) {
+ return null;
+ }
+
+ try {
+ Application application = context.getApplication();
+ return (application.createConverter(converterClass));
+ } catch (Exception e) {
+ log.warn(e.getLocalizedMessage(), e);
+ return null;
+ }
+ }
+
/**
* Overloads getFormattedValue to take a advantage of a previously
* obtained converter.
@@ -190,7 +203,7 @@
// if converter attribute set, try to acquire a converter
// using its class type.
Class<? extends Object> converterType = currentValue.getClass();
- converter = Util.getConverterForClass(converterType, context);
+ converter = getConverterForClass(converterType, context);
// if there is no default converter available for this identifier,
// assume the model type to be String.