Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352695

Summary: WindowBuilder i18n failure. Prepending call to BUNDLE with class name causes Design View to fail.
Product: z_Archived Reporter: Basil Bourque <basil.bourque.lists>
Component: WindowBuilderAssignee: Konstantin Scheglov <Konstantin.Scheglov>
Status: CLOSED WORKSFORME QA Contact:
Severity: enhancement    
Priority: P3 CC: clayberg
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Basil Bourque CLA 2011-07-21 01:08:42 EDT
When I turned on:
Eclipse > Preferences > Java > Editor > Save Actions > Additional Actions > Qualify accesses to static fields with declaring class
I discovered that WindowBuilder gets cranky when this kind of line:

this.lblNewLabel = new JLabel(BUNDLE.getString("MyJFrame.lblNewLabel.text")); //$NON-NLS-1$
becomes:
this.lblNewLabel = new JLabel(MyJFrame.BUNDLE.getString("MyJFrame.lblNewLabel.text")); //$NON-NLS-1$
(where ".BUNDLE" in prepended with "MyJFrame")

This causes problems in the Design View. For a JLabel, the value of the "text" property disappears, and the graphical display of the JFrame shows the JLabel's text as: <dynamic>.

--Basil Bourque

-- Configuration Details --

I have WindowBuilder 1.0.0.0r37 installed.

Product: Eclipse 1.4.0.20110609-1120 (org.eclipse.epp.package.java.product)
Installed Features:
 org.eclipse.jdt 3.7.0.v20110520-0800-7z8gFchFMTdFYKuLqBLqRja9B15B
Comment 1 Konstantin Scheglov CLA 2011-07-22 11:40:36 EDT
Works for me.
Please provide standalone test case.

public class MyPanel extends JPanel {
  private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("test.messages"); //$NON-NLS-1$
  public MyPanel() {
    JButton button = new JButton(MyPanel.BUNDLE.getString("MyPanel.button.text")); //$NON-NLS-1$
    add(button);
  }
}