Bug 321577

Summary: [rename][nls tooling] allow to rename externalized string
Product: [Eclipse Project] JDT Reporter: Michael Seele <mseele>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, deepakazad, markus.kell.r
Version: 3.7Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Seele CLA 2010-08-03 07:45:45 EDT
Please provide a way to contribute to the RenameJavaElementAction.

We're developing on a new feature for jinto (See http://www.guh-software.de/jinto_en.html for further notices) where the user can rename it's resource bundle keys. We can detect which strings are resource bundle key's and which are not. We want to contribute when the users clicks "Refactor > Rename..." on a string. But this seems to be not possible for now. The only thing what happens is that a dialog that pops up with the following message: "Operation unavailable on the current selection.\nSelect a Java project, source folder, resource, package, compilation unit, type, field, method, parameter or a local variable" (Invoked by RenameJavaElementAction:161).
Please give us a chance to detect if we want to handle this rename action.
Comment 1 Markus Keller CLA 2010-08-09 05:41:55 EDT
We don't want to open up the Rename action for general contributions. A better way to implement this would be a Rename Property Key refactoring in JDT. We already have rename support for Eclipse-style NLS'd keys (Rename Field with the NLS participant), and it would be nice to have that extended to String-style keys.

NLSKeyHyperlinkDetector already has all the code to detect and resolve the key in the properties file, so this has to be extracted and reused in a new rename refactoring processor. The element of the refactoring will be a new API type that represents a properties key (basically a "properties file / key" pair).

Would you like to work on this?