You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Kaufman <da...@gmx.de> on 2015/04/27 11:51:44 UTC
Subclassing Localizer
Hi,
I'm currently struggling with porting a wicket 1.4 subclass of Localizer to
wicket 6. Here subclassing is prohibited by the final keyword.
===========================================================
public class MyLocalizer extends Localizer {
@Override
public String getStringIgnoreSettings( final String key, final
Component component, final IModel<?> model, final String defaultValue ) {
final boolean flag = Session.get().getFlag();
if (flag) {
return String.format("[%s]", key)
}
return super.getStringIgnoreSettings( key, component, model, defaultValue );
}
}
===========================================================
As you can see, I simply want to return the key if a certain flag is set.
Is this somehow possible by using the IStringResourceLoader interface? Any
help is appreciated.
Thanks,
David
Re: Subclassing Localizer
Posted by Martin Grigorov <mg...@apache.org>.
Please file a ticket so the 'final' is removed.
Thanks!
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Mon, Apr 27, 2015 at 12:51 PM, David Kaufman <da...@gmx.de>
wrote:
> Hi,
>
> I'm currently struggling with porting a wicket 1.4 subclass of Localizer to
> wicket 6. Here subclassing is prohibited by the final keyword.
>
> ===========================================================
> public class MyLocalizer extends Localizer {
>
> @Override
> public String getStringIgnoreSettings( final String key, final
> Component component, final IModel<?> model, final String defaultValue ) {
>
> final boolean flag = Session.get().getFlag();
> if (flag) {
> return String.format("[%s]", key)
> }
>
> return super.getStringIgnoreSettings( key, component, model, defaultValue
> );
> }
>
> }
> ===========================================================
>
>
> As you can see, I simply want to return the key if a certain flag is set.
> Is this somehow possible by using the IStringResourceLoader interface? Any
> help is appreciated.
>
> Thanks,
> David
>