This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 242188 - Enhancement to CTRL+SHIFT+DOWN and ALT+SHIFT+DOWN shortcut to moving parameters/method invocations
Summary: Enhancement to CTRL+SHIFT+DOWN and ALT+SHIFT+DOWN shortcut to moving paramete...
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 8.0
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-21 10:52 UTC by -Silver-
Modified: 2016-05-23 19:09 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description -Silver- 2014-02-21 10:52:37 UTC
Hi, 
one of my favorite shortcut is the ALT+SHIFT+DOWN (with its variants ALT+SHIFT+UP, CTRL+SHIFT+DOWN, CTRL+SHIFT+UP) that allows to shift (duplicate) a line of code down (up).

I think that should be great to have similar shortcuts also in the LEFT and RIGHT variants, when the user is writing a method parameters or is writing methods calls


NOTE: The "|" symbol identify the caret

Example 1 method parameters example: 
1. Initial situation
public void myFunction(String aParameter);

2. Put the caret on a parameter
public void myFunction(String aParam|eter);

3. Press CTRL+SHIFT+RIGHT
public void myFunction(String aParameter, String aParameter2|);

4. Press CTRL+SHIFT+RIGHT again
public void myFunction(String aParameter, String aParameter2, String aParameter3|);

5. Press ALT+SHIFT+LEFT (to rearrange the parameters)
public void myFunction(String aParameter, String aParameter3|, String aParameter2);


Example 2: Nested method example (this is more difficult to implement and is just a concept idea that has to be discussed carefully):
1. Initial situation
String aString = (anotherString.Substring(0,anotherString.lastIndexOf("a")).toLowerCase()).Substring(7);

2. Put the caret on a method call
String aString = (anotherString.Substring(0,anotherString.lastIndexOf("a")).toLower|Case()).Substring(7);

3. Press ALT+SHIFT+LEFT (to rearrange the method calls)
String aString = (anotherString.Substring(0,anotherString.lastIndexOf("a").toLowerCase()|)).Substring(7);

4. Press ALT+SHIFT+LEFT again
String aString = (anotherString.Substring(0,anotherString.toLowerCase()|.lastIndexOf("a"))).Substring(7);

5. Move the caret to another method call
String aString = (anotherString.Substring(0,anotherString.toLowerCase().lastIndexOf("a"))).Substri|ng(7);

6. Press CTRL+SHIFT+RIGHT to duplicate it:
String aString = (anotherString.Substring(0,anotherString.toLowerCase().lastIndexOf("a"))).Substring(7).Substring(7)|;


What do you think about it?
Comment 1 Svata Dedic 2015-04-07 09:07:54 UTC
General editor action moving to appropriate category for evaluation.