It's proper for my use case. I want to output an double as a percent (e.g.,
.15 gets displayed as 15%). I'm not sure why there is a type argument. The
label is defined as having a Double model. What other conversions do I need
to do besides Double <==> String?
I need to override this. Making it final would not be helpful. Unless I'm
using the converter improperly. I hope not - this is but one instance of
four or five where I'm using converters to format numbers/dates in a locale
specific way.
igor.vaynberg wrote:
>
> we are still discussing on how to do this properly with generics, so stay
> tuned.
>
> we are also discussing whether o rnot an override like yours is proper
> since you are completely ignoring the type argument.
>
> -igor
>
> On Sat, May 31, 2008 at 1:16 PM, Doug Donohoe <[EMAIL PROTECTED]> wrote:
>>
>> Hi Igor,
>>
>> I've just upgraded to the trunk and my custom converters no longer
>> compile.
>> I used to have this:
>>
>> public class PercentLabel extends Label<Double>
>> {
>> /* snip */
>>
>> public IConverter<Double> getConverter(Class<Double> type)
>> {
>> return new PercentConverter(fractionDigits);
>> }
>> }
>>
>> Where PercentConverter is defined as
>>
>> public class PercentConverter extends AbstractDecimalConverter<Double>
>>
>> How am I supposed to declare this properly now? The only thing I can get
>> to
>> compile is ...
>>
>> public IConverter getConverter(Class type)
>> {
>> return new PercentConverter(fractionDigits);
>> }
>>
>> ...but that gets me unchecked / raw use of parametrized type warnings. I
>> haven't done much generics work with the public <X> IConverter<X>
>> getConverter(Class<X> type) format. What is the right way to do this?
>>
>> Thanks,
>>
>> -Doug
>> --
>> View this message in context:
>> http://www.nabble.com/iconverterlocator%2Bgenerics-tp17462585p17579216.html
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/iconverterlocator%2Bgenerics-tp17462585p17584613.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.