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.
20060327 Monday March 27, 2006

Camel Case Movement and Selection module

I have uploaded the Camel Case Movement and Selection module to my NetBeans 5.0 update center described (here). The term camel case refers to the Java identifier naming convension.

This module enables quick movement of caret to the camel case boundaries. For example if you have the following Java code then you can use the supported actions to move the caret to the locations marked by |:

Character.|is|Upper|Case|(char);
The caret movement and selection is supported.

This module provides the following actions:

ActionKey binding
Previous Camel Case PositionCtrl+Alt+Left
Next Camel Case PositionCtrl+Alt+Right
Select to Previous Camel Case PositionCtrl+Alt+Shift+Left
Select to Next Camel Case PositionCtrl+Alt+Shift+Right

I have tested it for Java sources.

Sources

DISCLAIMER: This module is experimental. So no guarantees. Use the module at your own risk.


Posted by sandipchitale ( Mar 27 2006, 01:59:27 PM PST ) Permalink Comments [6]


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

Fixed some bugs:

  • Correctly handle consecutive upper case letters
  • Action names for selection actions

Posted by Sandip on March 29, 2006 at 05:34 PM PST #

Hi Sandip,

Thanks for this great module. I'm using it more and more, and I will soon not be able to live without!! ;)

Two little things though.

Could it be possible to treat consecutive spaces as only one? It happends very often that I use shift-ctrl-alt-right instead of the regular shift-ctrl-right and continue beyond the current identifier.

And could it be possible to make it work also in comments?

Thanks again for this great module!!

Hugues

Posted by Hugues Ferland on April 04, 2006 at 06:49 AM PDT #

Thanks. See my next blog for more enhancements.

I see the issue with spaces. Looks like the Syntax Support (which is what I am using to identify the "Identifier" token in the source buffer) treats each space as a token. I can add code skip over consecutive spaces. Alternatively I could delegate to the Next/Previous word actions of the editor kit.

Posted by Sandip on April 04, 2006 at 09:02 AM PDT #

Issue with the spaces has been fixed.

Posted by Sandip on April 04, 2006 at 09:38 AM PDT #

Great. One thing I miss in Netbeans editor is Ctrl+Backspace for camel case backwards erasing. It just erases the whole word.

Posted by Gustavo Santucho on April 09, 2006 at 06:55 AM PDT #

Added support for camel case backwards (Ctrl+Shift+Backspace) and forwards (Ctrl+Shift+Delete) erasing.

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

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed








« November 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
     
       
Today

Get NetBeans 5.5

Locations of visitors to this page

Today's Page Hits: 188


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