Bug 74084

Summary: [typing] Java Editor: Split String feature
Product: [Eclipse Project] JDT Reporter: Michael Giroux <michael.giroux>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Giroux CLA 2004-09-16 12:13:39 EDT
A feature that allows developer to
a. place cursor over a string literal
b. right click to get menu
c. select "insert variable"

At this point, I would like the editor to open the string similar to what it 
does if I press ENTER while cursor is in middle of string.

To illustrate, I'll show what I want to end up with, and describe how I want 
to get there:

Result: System.out.println("<root name='" + getName() + "'>");

What I would like to do is
1. type System.out.println("<root name=''>");
2. place cursor between the two single-quotes.
3. right-click and select "insert variable"

Here, the editor would do the following:
System.out.println("<root name='" +  + "'>");

splitting the string at the cursor and injecting " + + " sequence, and leaving 
the cursor positioned between the two plus characters.

I would now type getName() to generate the desired result:
System.out.println("<root name='" + getName() + "'>");

Maybe this feature should be more generally "open string" instead of "insert 
variable".

As an alternative, perhaps I could do the following:
1. enter  System.out.println("<root name='getName()'>");
2. select getName()
3. right click and select "insert variable" menu.

Editor would change the selected text getName() to " + getName() + "

There may be some other UI appropriae way to achieve this as well.

mg
Comment 1 Dani Megert CLA 2004-09-20 06:53:48 EDT
Open string or split string sounds better. Adapting summary.