Skip to main content

Localize String in PatternModel and EyeDropperColorChooserPanel

4 replies [Last post]
clementt
Offline
Joined: 2011-04-08
Points: 0

Hi all,
In my code I use PatternModel. But this class use String constants like "MATCH_RULE_CONTAINS" that couldn't be localized easily.
Is it possible to make them localizable?
I also use EyeDropperColorChooserPanel but it has only a getter for the display name.
Is it possible to add a setter?
Thanks in advance.
Regards

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kleopatra
Offline
Joined: 2003-06-11
Points: 0

*WTF* ... this editor detoriated even more - can't add paragraphs in plain editing mode? In which century was this crap coded??

as Karl already mentioned, it's not the task of the PatternModel to provide the localization (it's the model and doesn't care about the representation of the rules). Mainly accidental that those keys are of type String and make sense in English ;-) It's easy to localize: in your ui, do whatever localized lookup you want to. LocalizableStringValue helps in doing so, and now is used in JXSearchPanel to fix a recently reported bug:

http://java.net/jira/browse/SWINGX-1433

Cheers Jeanette

kschaefe
Offline
Joined: 2006-06-08
Points: 0

I had already filed a bug about the forum: http://java.net/jira/browse/ABOUT-50

kschaefe
Offline
Joined: 2006-06-08
Points: 0

The strings in PatternModel should not be localizable. They are constants for look ups (and should be refactored into an enum). It is the responsibility of the user to localize. What we need to dom for instance with JXSearchPanel, is add a better renderer to the combo box that will do localization. Please file a bug about that.

As for EyeDropperColorChooserPanel, if we actually localize the String I don't really see a need for a setDisplayName (the abstract class doesn't define one because these are supposed to be consistant across all instances). Please file a separate issue for that, we can certainly localize the display name string.

Karl

clementt
Offline
Joined: 2011-04-08
Points: 0

Thanks for yours replies.
I have filled an issue about EyeDropperColorChooserPanel : http://java.net/jira/browse/SWINGX-1440