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

Bug 316766

Summary: All message bundle classes such as UIMessages should extend NLS class
Product: [Tools] CDT Reporter: Andrew Gvozdev <angvoz.dev>
Component: cdt-coreAssignee: Project Inbox <cdt-core-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: john.cortell
Version: 7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 318802, 318812    
Bug Blocks:    

Description Andrew Gvozdev CLA 2010-06-14 10:39:58 EDT
org.eclipse.cdt.ui.newui.UIMessages appears to be home-grown class and so navigation between code and *.properties file is not supported. For example:
- place a cursor on "ProjectConvert.conversionErrordialog.title" in (ConvertTargetAction.java:97) and press F3. It is expected that the cursor navigates to the definition of ProjectConvert.conversionErrordialog.title in the properties file but it does not.
Comment 1 John Cortell CLA 2010-06-14 10:55:28 EDT
I'm not sure I'd call it a "home-grown" class. It's the standard way in which resource strings were accessed prior to NLS being introduced in Eclipe 3.1

It looks like there's about 40 such classes in our codebase, e.g. UtilMessages
and CoreModelMessages.
Comment 2 Andrew Gvozdev CLA 2010-06-14 10:58:26 EDT
(In reply to comment #1)
> I'm not sure I'd call it a "home-grown" class. It's the standard way in which
> resource strings were accessed prior to NLS being introduced in Eclipe 3.1
All the same it's better to convert them to NLS style.

> It looks like there's about 40 such classes in our codebase, e.g. UtilMessages
> and CoreModelMessages.
Comment 3 John Cortell CLA 2010-06-14 11:17:49 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > I'm not sure I'd call it a "home-grown" class. It's the standard way in which
> > resource strings were accessed prior to NLS being introduced in Eclipe 3.1
> All the same it's better to convert them to NLS style.

Well I definitely agree that the NLS approach is better (can't imagine anyone arguing otherwise). But converting these classes is not trivial. The real grunt work  is in updating all the references to the strings.

I just wanted to point out that there's nothing particular about UIMessages. That it's a more general issue. Perhaps the abstract should be adjusted.
Comment 4 Andrew Gvozdev CLA 2010-06-14 11:29:49 EDT
(In reply to comment #3)
> I just wanted to point out that there's nothing particular about UIMessages.
> That it's a more general issue. Perhaps the abstract should be adjusted.
Yes, that makes perfect sense. Let me do that.
Comment 5 Andrew Gvozdev CLA 2010-10-11 10:33:06 EDT
I checked and it is possible (see also observation bug 316386 comment 28) to navigate org.eclipse.cdt.core.model *.properties (UtilMessages.properties, CoreModelMessages.properties, SettingsModelMessages.properties). For the record, I used test case like that from bug 318802:

0. Find a reference to one of the variables in UIMessages class, for example UIMessages.AbstractLangsListTab_2 in (AbstractLangsListTab.java:105) .
1. Hover the mouse pointer over it. You should see the message it points to: "Export".
2. Hold Ctrl and then hover mouse pointer. You should get suggestion to open in message.properties. On click it navigates to the definition in the file.
3. In message.properties, position the cursor on AbstractLangsListTab_2. Press F3. It should open a list of occurrences in the code (or directly jump there if only one occurence)
4. In message.properties, position the cursor on AbstractLangsListTab_2. Ctrl-[mouse click] should work the same as F3.

Since the navigation works back and forth, I suppose there is not much sense in converting those classes.