sandip chitale's blog    Sandip Chitale's blog (scblog)
NOTE: I have moved many of my modules to NetBeans Plugin Portal . Please check there for latest versions of modules described on this blog.
20060402 Sunday April 02, 2006

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:
ActionKey binding
Toggle case of first char of the identifierAlt+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 Comments [4]


Trackback URL: http://blogs.sun.com/scblog/entry/camel_case_movement_and_selection1
Comments:

Thanks, it's a great plugin, really useful. But one little problem. I do not know how it's on systems with american keycodes, but on german ones, the '(' and '=' can be accessed only by pressing shift, what in fact, will disable the functions, or better which will make it impossible to use some of the functions. Nothing serious (it's possible to change it), just wanted to metion it. Best regards

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 #

Hi, no it's not really an issue. I just wanted to mention this problem. There exists some other keybindings, which will not work on german keyboards (e.g. everything with Shift + ']' or '['), cos they are just second or third allocation. Regards

Posted by Christian on April 04, 2006 at 12:29 AM PDT #

Removed the Toggle case of first char of the identifier action as that is already supported by the Netbeans editor. See Tools:Options:Keymap:Actions:Switch Capitalization of Identifier action.

Posted by Sandip on April 09, 2006 at 07:53 PM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed








« July 2009
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today

Get NetBeans 5.5

Locations of visitors to this page

Today's Page Hits: 159


XML
All
/Creator
/General
/Hobby
/Java
/JavaScript
/Mozilla
/NetBeans
/Ubuntu
/VisualWeb
/VisualWebPack
/Web 2.0

XML
All
/Creator
/General
/Hobby
/Java
/JavaScript
/Mozilla
/NetBeans
/Ubuntu
/VisualWeb
/VisualWebPack
/Web 2.0

scblog
scblog