Bug 165896 - [templates] uppercase/camelcase support
Summary: [templates] uppercase/camelcase support
Status: RESOLVED DUPLICATE of bug 120420
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-27 05:31 EST by Joris Verschoor CLA
Modified: 2006-11-27 06:43 EST (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 Joris Verschoor CLA 2006-11-27 05:31:52 EST
I'd like to suggest the possibility to change the case for inserted variables.
I came accross this when creating a custom template for "property":

// [start]property ${newName} 
private ${type} ${newName};
public ${type} get${newName}() { return ${newName}; }
public void set${newName}(${type} ${newName}) { this.${newName} = ${newName}; }
// [end]

${cursor}

This property template generates a block for a single property + it's getters and setters. The commentline is for the excellent coffeebytes code folding plugin, which I've configured to collapse the user-defined region "property". Back to the important stuff :)

As you can see this template would generate setmyProperty instead of setMyProperty. I suggest the following solution:

if you use: ${NewName} (or any other case-changed variable), it would generate the same casing. ${NEWNAME} would generate all upper-case, and ${NEW_NAME} would generator MY_PROPERTY.

Another solution would be an extra marker that specifies the casing in text, something like : ${newName|camel} and ${newName|upper}, but I thing the first one is more intuitive.
Comment 1 Dani Megert CLA 2006-11-27 06:43:58 EST

*** This bug has been marked as a duplicate of bug 120420 ***