Java Decl Gen module
I have uploaded the Java Decl Gen module on the Plugin Portal.
This module supports several forms of parameter, variable, array parameter and array variable declarations.
These actions were formerly part of the contrib/CamelCase module. The
CameCase movement and selections are now part of NetBeans 6.0 Java
editor.
Assuming you have typed:
Foo|
in the Java editor you can invoke the following actions:
| Action | Key binding |
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[] foos| | Ctrl+Alt+U SPACE |
Declare Array Parameter with comma e.g. Foo[] foos, | | Ctrl+Alt+U , |
Declare Array Variable e.g. Foo[] foos;| | Ctrl+Alt+U ; |
Declare Array Variable with initializer e.g. Foo[] foos = new Foo[]{};| | Ctrl+Alt+U = |
Declare Array Variable with casted initializer e.g. Foo[] foos = (Foo[]) ;| | Ctrl+Alt+U ( |
The highlighted regions behave like editor code templates. Use
ENTER to escape the code template parameter editing mode - then the
cursor will be positioned at |.
TODO
- Use the same algorithm as the one used by Java Editor to generate proposed parameter or variable names.
Sources
DISCLAIMER: This module is experimental. So no guarantees. Use the module at your own risk.
Posted by sandipchitale
( Oct 19 2007, 04:41:12 PM PDT ) Permalink
Trackback URL: http://blogs.sun.com/scblog/entry/java_decl_gen_module
Actually the TODO above is already possible. Simply press backspace and then CTRL+Space and the standard Java editor feature will propose the possible alternatives for you. Cool huh?
Posted by Sandip on October 31, 2007 at 05:13 PM PDT #
CTRL + SPACE ?
hmmm. thanks
Posted by güzel sözler on April 02, 2008 at 07:49 PM PDT #