Bug 125825

Summary: [typing] Camel case in case conversion
Product: [Eclipse Project] Platform Reporter: David Wright <david.wright>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P4 CC: markus.kell.r, pyvesdev, sdavids
Version: 3.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
fix
daniel_megert: review-
tests none

Description David Wright CLA 2006-01-31 08:58:30 EST
Enhance or extend CaseAction to optionally convert camelCase to
CAMEL_CASE and vice-versa (ie to UC prepend _ to non-initial caps, to LC remove and keep following capitalised). This would be very useful for constants eg static final String MY_CONSTANT="myConstant"
Comment 1 Dani Megert CLA 2006-02-01 03:31:45 EST
Nice idea. This would be a good feature for someone to start contributing to Eclipse.

We currently don't plan to work on this.
Comment 2 Sebastian Davids CLA 2006-06-05 08:16:14 EDT
see 8518 for some discussion
Comment 3 Sebastian Davids CLA 2006-06-17 00:52:49 EDT
Created attachment 44721 [details]
fix

supports:

capitalize -> Capitalize
LOWER_CAMEL_CASE -> lowerCamelCase
UPPER_CAMEL_CASE -> UpperCamelCase
iNVERT cASE -> Invert Case
constantCase -> CONSTANT_CASE
Comment 4 Sebastian Davids CLA 2006-06-17 00:53:09 EDT
Created attachment 44722 [details]
tests
Comment 5 Sebastian Davids CLA 2006-06-17 01:00:55 EDT
I did not assign key shortcuts.

I did not create a new context menu ( Bug 8518 comment 23 ) because there is no declared sub-menu I could contribute it to.

I did not create a main menu entry because there is no declared sub-menu entry either -- the only existing menu these could be put on would be the edit menu.
Comment 6 Sebastian Davids CLA 2006-06-17 01:08:50 EDT
You might consider renaming class Strings and possibly push it down to jface.text or eclipse.text.

Or merge it w/ org.eclipse.jface.text.TextUtilities.

I've put it into org.eclipse.ui.internal.texteditor to make it non-API; the functionality might be useful to JFace's downstream plug-ins though.
Comment 7 Dani Megert CLA 2006-07-03 07:11:38 EDT
The problem with this patch is that it assumes Java (or more general: programming language) conventions to standard text editing and also introduces the term 'constant' which does not belong into a standard text editing plug-in.
Comment 8 Sebastian Davids CLA 2006-07-03 09:46:15 EDT
Rename as you like ...

I wasn't aware that there is a "general" text editor and "programming" text editor distinction within Eclipse frameworks.

Useful for "general" text editor:

capitalize -> Capitalize
iNVERT cASE -> Invert Case

Useful for "programming" text editor:

LOWER_CAMEL_CASE -> lowerCamelCase
UPPER_CAMEL_CASE -> UpperCamelCase
constantCase -> CONSTANT_CASE

So where does "text" stuff belong which applies for JDT, CDT, RDT, etc. and not "general" text editor stuff?

I am confused :|
Comment 9 Dani Megert CLA 2006-07-03 09:53:35 EDT
>So where does "text" stuff belong which applies for JDT, CDT, RDT, etc. and not
>"general" text editor stuff?
This does not yet exist, that's why we keep the current text editing framework free of such code. Discussions are underway whether to create an LTK layer for text editing support.