Complete List of Macro Keywords for the NetBeans Java Editor

In NetBeans IDE's Java editor, you can create macros by clicking the "Start Macro Recording" button, performing some actions you'd like to record, then clicking the "Stop Macro Recording" button. The Macro Editor then pops up and you can finetune the macro and also assign a keyboard shortcut to it. You can also edit macros in the Options window, in the Editor > Macros tab.

A special macro syntax is used to define these macros. For example, if you want to clear the current line in the editor from the cursor, your macro definition would be as follows:

selection-end-line remove-selection

Then you could assign "Ctrl+L" as the keyboard shortcut for this macro. Whenever you'd then press that key combination, the whole line, from the position of the cursor, would be deleted.

To get a list of all commands, you create a NetBeans API action, which will get EditorKit from the JEditorPane in an opened editor, call EK.getActions(), and dump Action.NAME property of each action to System.out (together with Action.SHORT_DESCRIPTION). Here is the complete list of Macro keywords:


abbrev-debug-lineDebug Filename and Line Number
adjust-caret-bottomMove Insertion Point to Bottom
adjust-caret-centerMove Insertion Point to Center
adjust-caret-topMove Insertion Point to Top
adjust-window-bottomScroll Insertion Point to Bottom
adjust-window-centerScroll Insertion Point to Center
adjust-window-topScroll Insertion Point to Top
all-completion-showShow All Code Completion Popup
annotations-cyclingAnnotations Cycling
beepBeep
build-popup-menuBuild Popup Menu
build-tool-tipBuild Tool Tip
caret-backwardInsertion Point Backward
caret-beginInsertion Point to Beginning of Document
caret-begin-lineInsertion Point to Beginning of Text on Line
caret-begin-wordInsertion Point to Beginning of Word
caret-downInsertion Point Down
caret-endInsertion Point to End of Document
caret-end-lineInsertion Point to End of Line
caret-end-wordInsertion Point to End of Word
caret-forwardInsertion Point Forward
caret-line-first-columnInsertion Point to Beginning of Line
caret-next-wordcaret-next-word
caret-previous-wordcaret-previous-word
caret-upInsertion Point Up
collapse-all-code-block-foldsCollapse All Java Code
collapse-all-foldsCollapse All
collapse-all-javadoc-foldsCollapse All Javadoc
collapse-foldCollapse Fold
commentComment
complete-lineComplete Line
complete-line-newlineComplete Line and Create New Line
completion-showShow Code Completion Popup
copy-selection-else-line-downCopy Selection else Line down
copy-selection-else-line-upCopy Selection else Line up
copy-to-clipboardCopy
cut-to-clipboardCut
cut-to-line-beginCut from Insertion Point to Line Begining
cut-to-line-endCut from Insertion Point to Line End
default-typedDefault Typed
delete-nextDelete Next Character
delete-previousDelete Previous Character
documentation-showShow Documentation Popup
dump-view-hierarchyDump View Hierarchy
expand-all-code-block-foldsExpand All Java Code
expand-all-foldsExpand All
expand-all-javadoc-foldsExpand All Javadoc
expand-foldExpand Fold
fast-importFast Import
find-nextFind Next Occurrence
find-previousFind Previous Occurrence
find-selectionFind Selection
first-non-whiteGo to First Non-whitespace Char
fix-importsFix Imports
formatFormat
generate-codeInsert Code
generate-fold-popupGenerate Fold Popup
generate-goto-popupGenerate Goto Popup
generate-gutter-popupMargin
gotoGo to Line...
goto-declarationGo to Declaration
goto-helpGo to Javadoc
goto-implementationGo to Implementation
goto-sourceGo to Source
goto-super-implementationGo to Super Implementation
in-place-refactoringInstant Rename
incremental-search-backwardIncremental Search Backward
incremental-search-forwardIncremental Search Forward
insert-breakInsert Newline
insert-date-timeInsert Current Date and Time
insert-tabInsert Tab
introduce-constantIntroduce Constant...
introduce-fieldIntroduce Field...
introduce-methodIntroduce Method...
introduce-variableIntroduce Variable...
java-next-marked-occurrenceNavigate to Next Occurrence
java-prev-marked-occurrenceNavigate to Previous Occurrence
jump-list-last-editLast edit
jump-list-nextForward
jump-list-prevBack
last-non-whiteGo to Last Non-whitespace Char
make-getterReplace Variable With its Getter
make-isReplace Variable With its is* Method
make-setterReplace Variable With its Setter
match-braceInsertion Point to Matching Brace
move-selection-else-line-downMove Selection else Line down
move-selection-else-line-upMove Selection else Line up
org.openide.actions.PopupActionShow Popup Menu
page-downPage Down
page-upPage Up
paste-formatedPaste Formatted
paste-from-clipboardPaste
redoRedo
reindent-lineRe-indent Current Line or Selection
remove-lineDelete Line
remove-line-beginDelete Preceding Characters in Line
remove-selectionDelete Selection
remove-tabDelete Tab
remove-trailing-spacesRemove Trailing Spaces
remove-word-nextremove-word-next
remove-word-previousremove-word-previous
replaceReplace
run-macroRun Macro
scroll-downScroll Down
scroll-upScroll Up
select-allSelect All
select-element-nextSelect Next Element
select-element-previousSelect Previous Element
select-identifierSelect Identifier
select-lineSelect Line
select-next-parameterSelect Next Parameter
select-wordSelect Word
selection-backwardExtend Selection Backward
selection-beginExtend Selection to Beginning of Document
selection-begin-lineExtend Selection to Beginning of Text on Line
selection-begin-wordExtend Selection to Beginning of Word
selection-downExtend Selection Down
selection-endExtend Selection to End of Document
selection-end-lineExtend Selection to End of Line
selection-end-wordExtend Selection to End of Word
selection-first-non-whiteExtend Selection to First Non-whitespace Char
selection-forwardExtend Selection Forward
selection-last-non-whiteExtend Selection to Last Non-whitespace Char
selection-line-first-columnExtend Selection to Beginning of Line
selection-match-braceExtend Selection to Matching Brace
selection-next-wordselection-next-word
selection-page-downExtend Selection to Next Page
selection-page-upExtend Selection to Previous Page
selection-previous-wordselection-previous-word
selection-upExtend Selection Up
shift-line-leftShift Line Left
shift-line-rightShift Line Right
split-lineSplit Line
start-macro-recordingStart Macro Recording
start-new-lineStart New Line
stop-macro-recordingStop Macro Recording
switch-caseSwitch Case
to-lower-caseTo Lowercase
to-upper-caseTo Uppercase
toggle-case-identifier-beginSwitch Capitalization of Identifier
toggle-commentToggle Comment
toggle-highlight-searchToggle Highlight Search
toggle-line-numbersToggle Line Numbers
toggle-non-printable-charactersToggle Non-printable Characters
toggle-toolbarToggle Toolbar
toggle-typing-modeToggle Typing Mode
tooltip-showShow Code Completion Tip Popup
uncommentUncomment
undoUndo
word-match-nextNext Matching Word
word-match-prevPrevious Matching Word