myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <mat...@apache.org>
Subject Re: [Trinidad] How to use one's own (Text) resources instead of the built-in ones
Date Tue, 12 Aug 2008 10:14:24 GMT
Hi,

On Tue, Aug 12, 2008 at 12:02 PM,  <wolfgang.toepfer@pta.de> wrote:
>
> Hi,
>
> Regarding the use of our own text resources e.g. using our own label for
> Trinidad's showDetail table label (whichin German we found to be too long..
> ;)
> I suppose I could go any time to the trinidad JAR package and replace the
> texts by our own ones.
>
> But this is not the way I would like. Rather, I would prefer a solution
> where I could somehow redirect the classpath used by the ResourceServlet
> to our own messages resources. Is there a setter method somewhere or how
> would I accomplish that?

You can see in the trinidad-skins.xml in the demo bundle how you can
add a resource bundle name:
<skin>
<id>
purple.desktop
</id>
<family>
purple
</family>
<render-kit-id>
org.apache.myfaces.trinidad.desktop
</render-kit-id>
<style-sheet-name>
skins/purple/purpleSkin.css
</style-sheet-name>
<bundle-name>
org.apache.myfaces.trinidaddemo.resource.SkinBundle
</bundle-name>
</skin>

And the resource bundle code looks like this:

package org.apache.myfaces.trinidaddemo.resource;

import java.util.ListResourceBundle;

public class SkinBundle extends ListResourceBundle
{
@Override
public Object[][] getContents()
{
return _CONTENTS;
}

static private final Object[][] _CONTENTS =
{
{"af_tableSelectMany.SELECT_COLUMN_HEADER", "Select A Lot"},
{"af_tableSelectOne.SELECT_COLUMN_HEADER", "Select Just One"},
// add what ever "label" you want to replace
};
}


Greetings,
Matthias

>
> Thanks a lot,
> Wolfgang.



-- 
Matthias Wessendorf

Need JSF and Web 2.0?
http://code.google.com/p/facesgoodies

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Mime
View raw message