Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352695 - WindowBuilder i18n failure. Prepending call to BUNDLE with class name causes Design View to fail.
Summary: WindowBuilder i18n failure. Prepending call to BUNDLE with class name causes ...
Status: CLOSED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: WindowBuilder (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Scheglov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-21 01:08 EDT by Basil Bourque CLA
Modified: 2021-06-04 16:45 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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);
  }
}