Camel Case Movement and Selection module updated
Added functionality to toggle case of the first char of the identifier. It allows you to quickly declare a field, a variable or a parameter. Many times you want to name a field or a variable or a parameter as the same as it's type name except for the first char which is lowercase. For example:
InputStream inputStream;
This could be achieved as explained below.
Type:
InputStream I|
Type
Ctrl+K which will result in:
InputStream I|nputStream
Now type
Alt+U C which will result in:
InputStream i|nputStream
and you have a correctly declared field, variable or parameter.
The following actions are provided:
| Action | Key binding |
| Toggle case of first char of the identifier | Alt+U C | |
Declare Parameter e.g. Foo foo| | Alt+U SPACE | |
Declare Parameter with comma e.g. Foo foo, | | Alt+U , | |
Declare Variable e.g. Foo foo;| | Alt+U ; | |
Declare Variable with initializer e.g. Foo foo = new Foo()|; | Alt+U = | |
Declare Variable with casted initializer e.g. Foo foo = (Foo)|; | Alt+U ( | |
Declare Array Parameter e.g. Foo[] foo| | Ctrl+Alt+U SPACE | |
Declare Array Parameter with comma e.g. Foo[] foo, | | Ctrl+Alt+U , | |
Declare Array Variable e.g. Foo[] foo;| | Ctrl+Alt+U ; | |
Declare Array Variable with initializer e.g. Foo[] foo = new Foo[] {}|; | Ctrl+Alt+U = | |
Declare Array Variable with casted initializer e.g. Foo[] foo = (Foo[])|; | Ctrl+Alt+U ( | |
NOTE: All the Declare ... actions assume that the caret is inside a Class or Interface identifier.
NOTE: The | shows the position of cursor in the editor.
Get it from my NetBeans 5.0 update center described (here).
Posted by sandipchitale
( Apr 02 2006, 10:38:10 AM PDT ) Permalink
Trackback URL: http://blogs.sun.com/scblog/entry/camel_case_movement_and_selection1
Posted by Christian on April 03, 2006 at 06:25 AM PDT #
Thanks Christian.
Hmm...I will look into the issue with '(' and '=' on German keyboards. I do not fully understand the issue though.
BTW I have fixed the Decalre ... with initializer actions to leave the new Foo... expression in pending delete selection - in case the user wants to initilize with some other initializer expression. They can do so by starting to overtype the selection.
Posted by Sandip on April 03, 2006 at 03:56 PM PDT #
Posted by Christian on April 04, 2006 at 12:29 AM PDT #
Posted by Sandip on April 09, 2006 at 07:53 PM PDT #