New Features
NetBeans - Editor Module
Links: Home | New Features | User's View | Tips and FAQ
Author: Roman Strobl
Document History:
- Available in CVS
This page summarizes features added in the recent releases.
- Contents:
- 1. NetBeans 5.0
- 1.1 New Code completion
- 1.2 Code Templates
- 1.3 Drag&Drop in Editor
- 2. NetBeans 4.1
- 2.1 Find & replace improvements
- 2.2 Code completion improvements
- 2.3 Editor split
- 2.4 Hyperlink navigation
- 2.5 Error stripe
1.1 New Code Completion
The new Code Completion infrastructure allows
- Completely asynchronous evaluation does not block typing
- Improved look - return types on the right, better aligning with the code etc.
- Tooltip displaying - used e.g. for method parameters
- Multiple independent content providers - anyone can register
additional custom providers of the content displayed in the completion.
Currently this is used e.g. for providing Code Templates in the code completion.
Figure:
Displaying of method parameters in code completion (automatic or by Alt-P):
Parameter being typed is displayed in bold:
2.2 Code Templates
Code templates allow to expand a predefined abbreviation into an expanded string.
This functionality enhances (and replaces) the original Abbreviations functionality
which allowed to define expandable abbreviations e.g. "psf" was expanded
to "private static final". In addition the Code Templates accept parameters
defined by ${...}.
User can TAB through the parameters and update
the default parameter's value which gets replicated to all the parameter's
occurrences in the template:
ENTER at any time jumps to the destination cursor position ${cursor}:
Code templates can be expanded by using Code Completion when typed prefix matches
begining of any Code Template:
Once you remember the abbreviation you may type the abbreviation followed by SPACE:
Code Template definition can be added/updated at Tools>Options>Editor>Code Templates.
It's also possible to change the default expander key:
More details regarding Code Templates (e.g. summary of the variable names) can be found in
Architecture Description
2.3 Drag&Drop in Editor
Text can be moved in the editor by making a selection and dragging the text to the target position.
Copying can be performed by additional holding of CTRL modifier.
2.1 Find & replace improvements
These improvements cover mainly implementation of regular expressions and search in selected
text. Some other enhancements will be also done, e.g. sharing history of find dialog with
the "find in projects" dialog. For more details see:
http://editor.netbeans.org/doc/Proposals/Find/Proposal.html
2.2 Code completion improvements
During 4.1 we are working on a new API using which we will implement in future support
for live templates, keywords, javadoc and other enhancements of the code completion.
We are also working on bugfixes of the newly introduced JDK 1.5 code completion
features.
2.3 Editor split
Editor is being splitted for 4.1 into modules to improve editor's architecture.
For details see:
http://editor.netbeans.org/doc/Proposals/ModuleSplit/UserView.html
2.4 Hyperlink navigation
Hyperlink navigation is a mean for simple navigation in the source code. When user presses the
Ctrl key and hovers the mouse cursor over a certain code element, the element is changed to a
hyperlink. When user holds the Ctrl key and clicks on the hyperlink, the go to declaration action
is performed. For more details see:
http://editor.netbeans.org/doc/Proposals/Hyperlinking/hyperlinking_spec.html
2.5 Error stripe
The error stripe enables to see all errors in a java file on the right side of the editor - next to
the scrollbar. This makes developer's life easier by showing him all errors in a large source codes
at once and enabling one click navigation through errors. This feature will be available
via autoupdate.