code parsing using ResourceBundle and string concatenation

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

code parsing using ResourceBundle and string concatenation

Postby Christoph Kloppenburg » Thu Sep 20, 2007 5:16 am

Dear all,

I found, that the following code is interpreted correctly

Code: Select all
jLabel2.setText (res.getString ("MyText"));

( res is of type RessourceBundle, it was assigned a valid value elsewhere)

Also, the following code is interpreted correctly:

Code: Select all
jLabel2.setText ("MyText" + ":");

Finally, the combination of the above code is not interpreted, which leads to the situation that jLabel2 does not get a text at all:

Code: Select all
jLabel2.setText (res.getString ("MyText") + ":");

Is that behavior known? Is there a way to make the interpreter recognize the last line?

Thank you in advance
Christoph Kloppenburg
Posts: 3
Joined: Thu Aug 16, 2007 7:22 am

Re: code parsing using ResourceBundle and string concatenati

Postby Eric Clayberg » Thu Sep 20, 2007 10:23 am

Designer supports parsing internationalized text, and it supports parsing non-internationalized text. When editing the text in the design view, Designer does a complete replacement of the contents of the setText() expression with either a hard-coded string or an reference to an externalized string key.

For internationalized text, it is all or nothing. It does not support internationalizing part of a string. Internationalizing part of a string like that does not seem like a good idea, so that is not something we are likely to support in the future. Sorry. :-(
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest