Bug 74084 - [typing] Java Editor: Split String feature
Summary: [typing] Java Editor: Split String feature
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-16 12:13 EDT by Michael Giroux CLA
Modified: 2004-09-20 06:53 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.