blob: c77b4e68d25591a147b853348313266d36e80d9f [file] [log] [blame]
<html>
<head>
<meta name="author" content="Geertjan Wielenga" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="All NetBeans IDE Macro commands" />
<meta name="keywords" content="NetBeans, macro, editor" />
<link rel="stylesheet" type="text/css" href="../../../netbeans.css" />
<title>Complete List of Macro Keywords for the NetBeans Java Editor</title>
</head>
<body>
<h1>Complete List of Macro Keywords for the NetBeans Java Editor</h1>
<p>
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 &gt; Macros tab.
</p><p>
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:</p>
<pre>selection-end-line remove-selection</pre>
<p>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.</p>
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:</p>
<p><br /></p>
<div align="center" />
<table>
<tr><td><tt>abbrev-debug-line</tt></td><td>Debug Filename and Line Number</td></tr>
<tr><td><tt>adjust-caret-bottom</tt></td><td>Move Insertion Point to Bottom</td></tr>
<tr><td><tt>adjust-caret-center</tt></td><td>Move Insertion Point to Center</td></tr>
<tr><td><tt>adjust-caret-top</tt></td><td>Move Insertion Point to Top</td></tr>
<tr><td><tt>adjust-window-bottom</tt></td><td>Scroll Insertion Point to Bottom</td></tr>
<tr><td><tt>adjust-window-center</tt></td><td>Scroll Insertion Point to Center</td></tr>
<tr><td><tt>adjust-window-top</tt></td><td>Scroll Insertion Point to Top</td></tr>
<tr><td><tt>all-completion-show</tt></td><td>Show All Code Completion Popup</td></tr>
<tr><td><tt>annotations-cycling</tt></td><td>Annotations Cycling</td></tr>
<tr><td><tt>beep</tt></td><td>Beep</td></tr>
<tr><td><tt>build-popup-menu</tt></td><td>Build Popup Menu</td></tr>
<tr><td><tt>build-tool-tip</tt></td><td>Build Tool Tip</td></tr>
<tr><td><tt>caret-backward</tt></td><td>Insertion Point Backward</td></tr>
<tr><td><tt>caret-begin</tt></td><td>Insertion Point to Beginning of Document</td></tr>
<tr><td><tt>caret-begin-line</tt></td><td>Insertion Point to Beginning of Text on Line</td></tr>
<tr><td><tt>caret-begin-word</tt></td><td>Insertion Point to Beginning of Word</td></tr>
<tr><td><tt>caret-down</tt></td><td>Insertion Point Down</td></tr>
<tr><td><tt>caret-end</tt></td><td>Insertion Point to End of Document</td></tr>
<tr><td><tt>caret-end-line</tt></td><td>Insertion Point to End of Line</td></tr>
<tr><td><tt>caret-end-word</tt></td><td>Insertion Point to End of Word</td></tr>
<tr><td><tt>caret-forward</tt></td><td>Insertion Point Forward</td></tr>
<tr><td><tt>caret-line-first-column</tt></td><td>Insertion Point to Beginning of Line</td></tr>
<tr><td><tt>caret-next-word</tt></td><td>caret-next-word</td></tr>
<tr><td><tt>caret-previous-word</tt></td><td>caret-previous-word</td></tr>
<tr><td><tt>caret-up</tt></td><td>Insertion Point Up</td></tr>
<tr><td><tt>collapse-all-code-block-folds</tt></td><td>Collapse All Java Code</td></tr>
<tr><td><tt>collapse-all-folds</tt></td><td>Collapse All</td></tr>
<tr><td><tt>collapse-all-javadoc-folds</tt></td><td>Collapse All Javadoc</td></tr>
<tr><td><tt>collapse-fold</tt></td><td>Collapse Fold</td></tr>
<tr><td><tt>comment</tt></td><td>Comment</td></tr>
<tr><td><tt>complete-line</tt></td><td>Complete Line</td></tr>
<tr><td><tt>complete-line-newline</tt></td><td>Complete Line and Create New Line</td></tr>
<tr><td><tt>completion-show</tt></td><td>Show Code Completion Popup</td></tr>
<tr><td><tt>copy-selection-else-line-down</tt></td><td>Copy Selection else Line down</td></tr>
<tr><td><tt>copy-selection-else-line-up</tt></td><td>Copy Selection else Line up</td></tr>
<tr><td><tt>copy-to-clipboard</tt></td><td>Copy</td></tr>
<tr><td><tt>cut-to-clipboard</tt></td><td>Cut</td></tr>
<tr><td><tt>cut-to-line-begin</tt></td><td>Cut from Insertion Point to Line Begining</td></tr>
<tr><td><tt>cut-to-line-end</tt></td><td>Cut from Insertion Point to Line End</td></tr>
<tr><td><tt>default-typed</tt></td><td>Default Typed</td></tr>
<tr><td><tt>delete-next</tt></td><td>Delete Next Character</td></tr>
<tr><td><tt>delete-previous</tt></td><td>Delete Previous Character</td></tr>
<tr><td><tt>documentation-show</tt></td><td>Show Documentation Popup</td></tr>
<tr><td><tt>dump-view-hierarchy</tt></td><td>Dump View Hierarchy</td></tr>
<tr><td><tt>expand-all-code-block-folds</tt></td><td>Expand All Java Code</td></tr>
<tr><td><tt>expand-all-folds</tt></td><td>Expand All</td></tr>
<tr><td><tt>expand-all-javadoc-folds</tt></td><td>Expand All Javadoc</td></tr>
<tr><td><tt>expand-fold</tt></td><td>Expand Fold</td></tr>
<tr><td><tt>fast-import</tt></td><td>Fast Import</td></tr>
<tr><td><tt>find-next</tt></td><td>Find Next Occurrence</td></tr>
<tr><td><tt>find-previous</tt></td><td>Find Previous Occurrence</td></tr>
<tr><td><tt>find-selection</tt></td><td>Find Selection</td></tr>
<tr><td><tt>first-non-white</tt></td><td>Go to First Non-whitespace Char</td></tr>
<tr><td><tt>fix-imports</tt></td><td>Fix Imports</td></tr>
<tr><td><tt>format</tt></td><td>Format</td></tr>
<tr><td><tt>generate-code</tt></td><td>Insert Code</td></tr>
<tr><td><tt>generate-fold-popup</tt></td><td>Generate Fold Popup</td></tr>
<tr><td><tt>generate-goto-popup</tt></td><td>Generate Goto Popup</td></tr>
<tr><td><tt>generate-gutter-popup</tt></td><td>Margin</td></tr>
<tr><td><tt>goto</tt></td><td>Go to Line...</td></tr>
<tr><td><tt>goto-declaration</tt></td><td>Go to Declaration</td></tr>
<tr><td><tt>goto-help</tt></td><td>Go to Javadoc</td></tr>
<tr><td><tt>goto-implementation</tt></td><td>Go to Implementation</td></tr>
<tr><td><tt>goto-source</tt></td><td>Go to Source</td></tr>
<tr><td><tt>goto-super-implementation</tt></td><td>Go to Super Implementation</td></tr>
<tr><td><tt>in-place-refactoring</tt></td><td>Instant Rename</td></tr>
<tr><td><tt>incremental-search-backward</tt></td><td>Incremental Search Backward</td></tr>
<tr><td><tt>incremental-search-forward</tt></td><td>Incremental Search Forward</td></tr>
<tr><td><tt>insert-break</tt></td><td>Insert Newline</td></tr>
<tr><td><tt>insert-date-time</tt></td><td>Insert Current Date and Time</td></tr>
<tr><td><tt>insert-tab</tt></td><td>Insert Tab</td></tr>
<tr><td><tt>introduce-constant</tt></td><td>Introduce Constant...</td></tr>
<tr><td><tt>introduce-field</tt></td><td>Introduce Field...</td></tr>
<tr><td><tt>introduce-method</tt></td><td>Introduce Method...</td></tr>
<tr><td><tt>introduce-variable</tt></td><td>Introduce Variable...</td></tr>
<tr><td><tt>java-next-marked-occurrence</tt></td><td>Navigate to Next Occurrence</td></tr>
<tr><td><tt>java-prev-marked-occurrence</tt></td><td>Navigate to Previous Occurrence</td></tr>
<tr><td><tt>jump-list-last-edit</tt></td><td>Last edit</td></tr>
<tr><td><tt>jump-list-next</tt></td><td>Forward</td></tr>
<tr><td><tt>jump-list-prev</tt></td><td>Back</td></tr>
<tr><td><tt>last-non-white</tt></td><td>Go to Last Non-whitespace Char</td></tr>
<tr><td><tt>make-getter</tt></td><td>Replace Variable With its Getter</td></tr>
<tr><td><tt>make-is</tt></td><td>Replace Variable With its is* Method</td></tr>
<tr><td><tt>make-setter</tt></td><td>Replace Variable With its Setter</td></tr>
<tr><td><tt>match-brace</tt></td><td>Insertion Point to Matching Brace</td></tr>
<tr><td><tt>move-selection-else-line-down</tt></td><td>Move Selection else Line down</td></tr>
<tr><td><tt>move-selection-else-line-up</tt></td><td>Move Selection else Line up</td></tr>
<tr><td><tt>org.openide.actions.PopupAction</tt></td><td>Show Popup Menu</td></tr>
<tr><td><tt>page-down</tt></td><td>Page Down</td></tr>
<tr><td><tt>page-up</tt></td><td>Page Up</td></tr>
<tr><td><tt>paste-formated</tt></td><td>Paste Formatted</td></tr>
<tr><td><tt>paste-from-clipboard</tt></td><td>Paste</td></tr>
<tr><td><tt>redo</tt></td><td>Redo</td></tr>
<tr><td><tt>reindent-line</tt></td><td>Re-indent Current Line or Selection</td></tr>
<tr><td><tt>remove-line</tt></td><td>Delete Line</td></tr>
<tr><td><tt>remove-line-begin</tt></td><td>Delete Preceding Characters in Line</td></tr>
<tr><td><tt>remove-selection</tt></td><td>Delete Selection</td></tr>
<tr><td><tt>remove-tab</tt></td><td>Delete Tab</td></tr>
<tr><td><tt>remove-trailing-spaces</tt></td><td>Remove Trailing Spaces</td></tr>
<tr><td><tt>remove-word-next</tt></td><td>remove-word-next</td></tr>
<tr><td><tt>remove-word-previous</tt></td><td>remove-word-previous</td></tr>
<tr><td><tt>replace</tt></td><td>Replace</td></tr>
<tr><td><tt>run-macro</tt></td><td>Run Macro</td></tr>
<tr><td><tt>scroll-down</tt></td><td>Scroll Down</td></tr>
<tr><td><tt>scroll-up</tt></td><td>Scroll Up</td></tr>
<tr><td><tt>select-all</tt></td><td>Select All</td></tr>
<tr><td><tt>select-element-next</tt></td><td>Select Next Element</td></tr>
<tr><td><tt>select-element-previous</tt></td><td>Select Previous Element</td></tr>
<tr><td><tt>select-identifier</tt></td><td>Select Identifier</td></tr>
<tr><td><tt>select-line</tt></td><td>Select Line</td></tr>
<tr><td><tt>select-next-parameter</tt></td><td>Select Next Parameter</td></tr>
<tr><td><tt>select-word</tt></td><td>Select Word</td></tr>
<tr><td><tt>selection-backward</tt></td><td>Extend Selection Backward</td></tr>
<tr><td><tt>selection-begin</tt></td><td>Extend Selection to Beginning of Document</td></tr>
<tr><td><tt>selection-begin-line</tt></td><td>Extend Selection to Beginning of Text on Line</td></tr>
<tr><td><tt>selection-begin-word</tt></td><td>Extend Selection to Beginning of Word</td></tr>
<tr><td><tt>selection-down</tt></td><td>Extend Selection Down</td></tr>
<tr><td><tt>selection-end</tt></td><td>Extend Selection to End of Document</td></tr>
<tr><td><tt>selection-end-line</tt></td><td>Extend Selection to End of Line</td></tr>
<tr><td><tt>selection-end-word</tt></td><td>Extend Selection to End of Word</td></tr>
<tr><td><tt>selection-first-non-white</tt></td><td>Extend Selection to First Non-whitespace Char</td></tr>
<tr><td><tt>selection-forward</tt></td><td>Extend Selection Forward</td></tr>
<tr><td><tt>selection-last-non-white</tt></td><td>Extend Selection to Last Non-whitespace Char</td></tr>
<tr><td><tt>selection-line-first-column</tt></td><td>Extend Selection to Beginning of Line</td></tr>
<tr><td><tt>selection-match-brace</tt></td><td>Extend Selection to Matching Brace</td></tr>
<tr><td><tt>selection-next-word</tt></td><td>selection-next-word</td></tr>
<tr><td><tt>selection-page-down</tt></td><td>Extend Selection to Next Page</td></tr>
<tr><td><tt>selection-page-up</tt></td><td>Extend Selection to Previous Page</td></tr>
<tr><td><tt>selection-previous-word</tt></td><td>selection-previous-word</td></tr>
<tr><td><tt>selection-up</tt></td><td>Extend Selection Up</td></tr>
<tr><td><tt>shift-line-left</tt></td><td>Shift Line Left</td></tr>
<tr><td><tt>shift-line-right</tt></td><td>Shift Line Right</td></tr>
<tr><td><tt>split-line</tt></td><td>Split Line</td></tr>
<tr><td><tt>start-macro-recording</tt></td><td>Start Macro Recording</td></tr>
<tr><td><tt>start-new-line</tt></td><td>Start New Line</td></tr>
<tr><td><tt>stop-macro-recording</tt></td><td>Stop Macro Recording</td></tr>
<tr><td><tt>switch-case</tt></td><td>Switch Case</td></tr>
<tr><td><tt>to-lower-case</tt></td><td>To Lowercase</td></tr>
<tr><td><tt>to-upper-case</tt></td><td>To Uppercase</td></tr>
<tr><td><tt>toggle-case-identifier-begin</tt></td><td>Switch Capitalization of Identifier</td></tr>
<tr><td><tt>toggle-comment</tt></td><td>Toggle Comment</td></tr>
<tr><td><tt>toggle-highlight-search</tt></td><td>Toggle Highlight Search</td></tr>
<tr><td><tt>toggle-line-numbers</tt></td><td>Toggle Line Numbers</td></tr>
<tr><td><tt>toggle-non-printable-characters</tt></td><td>Toggle Non-printable Characters</td></tr>
<tr><td><tt>toggle-toolbar</tt></td><td>Toggle Toolbar</td></tr>
<tr><td><tt>toggle-typing-mode</tt></td><td>Toggle Typing Mode</td></tr>
<tr><td><tt>tooltip-show</tt></td><td>Show Code Completion Tip Popup</td></tr>
<tr><td><tt>uncomment</tt></td><td>Uncomment</td></tr>
<tr><td><tt>undo</tt></td><td>Undo</td></tr>
<tr><td><tt>word-match-next</tt></td><td>Next Matching Word</td></tr>
<tr><td><tt>word-match-prev</tt></td><td>Previous Matching Word</td></tr>
</table>
</div>
<!--
<pre>
public final class PrintMacrosAction implements ActionListener {
private final EditorCookie context;
public PrintMacrosAction(EditorCookie context) {
this.context = context;
}
public void actionPerformed(ActionEvent ev) {
JTextComponent editor = EditorRegistry.lastFocusedComponent();
EditorKit kit = ((JEditorPane) editor).getEditorKit();
Action[] actions = kit.getActions();
List&gt;String> list = new ArrayList();
InputOutput io = IOProvider.getDefault().getIO("Macros", false);
OutputWriter ow = null;
for (Action action : actions) {
list.add(action.getValue(Action.NAME).toString() +
" -- " + action.getValue(Action.SHORT_DESCRIPTION).toString());
}
Collections.sort(list);
ow = io.getOut();
for (String string : list) {
ow.println(string);
}
}
}
</pre>
-->
</body>
</html>