SelectedIcon not localized

Lutz Neumann <[email protected]>
Newsgroups gmane.comp.embedded.carlsbad-cubes
Organization Softronix GmbH
Message-ID <[email protected]>
Hi,

I am using the localizer not only for text but also for resources,
like icons.

So my XML contains something like:

   <label icon="printjob.icon.large"/>

and the .properties file:

    printjob.icon.large=res/icons/PrintJob2.gif

ok, this works - but something like

   <button selectedicon="printjob.icon"/>

does not work because "selectedicon" is not in the parsers
LOCALIZED_ATTRIBUTES vector and will not be translated. The same
problem exists when you define a custom tag with attributes that
should be translated and are not in the parsers vector:

   <actionmenuitem deselectedicon="printjob.icon.gray" selectedicon="printjob.icon"/>

here both icons will not be translated.

As far as I can see there is no way for a client to add strings to
the parsers LOCALIZED_ATTRIBUTES. LOCALIZED_ATTRIBUTES is defined as
public static final in Parser.java but there is no way to get the
parser instance from the SwingEngine.
I would suggest to add a method like addLocalizedAttribute(String).

Any comments?

- Lutz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.