Upload
spiritwin
View
217
Download
0
Embed Size (px)
Citation preview
8/14/2019 NetBeans 6.0 Keyboard Shortcuts & Code Templates
1/2
NetBeans 6.0 Keyboard Shortcuts & Code Templates
Finding, Searching, andReplacing
Ctrl-F3 Search word at insert pointF3/Shift-F3 Find next/previous in fi le
Ctrl-F/H Find/Replace in fileAlt-F7 Find usagesCtrl-Shift-P Find/replace in projectsAlt-Shift-U Find usages resultsAlt-Shift-H Turn off search result
highlightsAlt-Left Next in jump listAlt-Right Previous in jump listCtrl-R RenameCtrl-U, then U Convert selection to
uppercaseCtrl-U, then L Convert selection to
lowercaseCtrl-U, then S Toggle case of selectionAlt-Shift-V Paste formatted
Navigating through Source Code
Ctrl-O/Alt-Shift-O Go to type/fileCtrl-Shift-T Go to JUnit testAlt-O Go to sourceCtrl-B Go to declarationCtrl-G Go to lineCtrl-Shift-M Toggle add/remove
bookmarkCtrl-Shift-Period/Comma
Next/previous bookmark
Ctrl-Period/Comma
Next/previoususage/compile error
Ctrl-Shift-1/2/3 Select inProjects/Files/Favorites
Ctrl-[ Move caret to matchingbracket
Ctrl-K/Ctrl-Shift KNext/previous word match
Coding in Java
Alt-Insert Generate codeCtrl-Shift-I Fix all class importsAlt-Shift-I Fix selected class's import
Alt-Shift-F Reformat selectionAlt-Shift-Left/Right
Shift tab to the left/right
Ctrl-/ Add/remove comment linesCtrl/Alt-F12 Inspect members/hierarchyCtrl-E Delete current line
Coding in C/C++
Alt-Shift-C Go to declarationCtrl-F9 Evaluate expression
Coding in Ruby
Ctrl-Shift-A Jump Rails action > viewAlt-Shift-Period/Comma
Select Next/Previouselement
Ctrl-Shift-Space Show documentationCtrl-Shift-T Jump from test file to fileAlt-Shift-O Open file by name prefix
SOA
Tab-Shift-Arrows Move through elementsAlt-Shift-F Advanced search
Alt/Shift-Enter Expand/collapse elementsCtrl-Shift-9 Show BPEL Mapper
UML
Alt-Shift-A/O Insert attribute/operationinto selected element
Ctrl-Shift-F Fit diagram into windowF8 Toggle Overview windowCtrl-Shift-5 Select active UML diagram
Compiling, Testing, and Running
F9 Compile package/ fileF11 Build main projectShift-F11 Clean & build main projectCtrl-Q Set request parametersCtrl-Shift-U Create JUnit testCtrl-F6/Alt-F6 Run JUnit test on file/projectF6/Shift-F6 Run main project/file
Opening and Toggling betweenViews
Ctrl-Tab (Ctrl-`) Toggle between opendocuments
Shift-Escape Maximize window (toggle)Ctrl-F4/Ctrl-W Close currently selected
windowCtrl-Shift-F4 Close all windowsShift-F10 Open contextual menuAlt-Shift-D Undock window
Debugging
Ctrl-F5 Start debugging main projectCtrl-Shift-F5 Start debugging current fileCtrl-Shift-F6 Start debugging test for file
(JUnit)Shift-F5/F5 Stop/Continue debugging
sessionF4 Run to cursor location in fileF7/F8 Step into/overCtrl-F7 Step outCtrl-Alt-Up Go to called methodCtrl-Alt-Down Go to calling methodCtrl-F9 Evaluate expressionCtrl-F8 Toggle breakpointCtrl-Shift-F8 New breakpointCtrl-Shift-F7 New watch
8/14/2019 NetBeans 6.0 Keyboard Shortcuts & Code Templates
2/2
NetBeans 6.0 Keyboard Shortcuts & Code TemplatesWhen typing in the Source Editor, you can generate thetext in the right-column of the following list by typingthe abbreviation that is listed in the left-column andthen pressing Tab.
Java Editor Code Templates
En EnumerationEx ExceptionOb ObjectPsf public static finalPsfb public static final booleanPsfi public static final intPsfs public static final StringSt Stringab abstractbo booleanbr breakca catch (
cl classcn continuedf default:dowhile do {
} while (condition);eq equalsex extendsfa falsefi finalfl floatforc for (Iterator it= collection.iterator();
it.hasNext();) { Objectelem = (Object) it.next();
}fore for (Objectelem : iterable) {
}fori for (int i = 0; i < arr.length; i++) {
}fy finallyie interfaceifelse if (condition){}else {
}im implementsiof instanceof
ir importle lengthnewo Objectname = new Object(args);pe protectedpr privatepsf private static final
psfb private static final booleanpsfi private static final intpsfs private static final Stringpst printStackTrace();psvm public static void main(String[] args){
}pu publicre returnserr System.err.println ("|");sout System.out.println ("|");st staticsw switch (sy synchronizedtds Thread.dumpStack();th throwstrycatch try {}
catch (Exception e) {}tw throwtwn throw newwh while (whilei while (it.hasNext()) {
Objectelem = (Object) it.next();}
JSP Editor Code Templates
ag appl ication.getAttribute("|")ap application.putAttribute("|",)ar application.removeAttribute("|")cfgi config.getInitParameter("|") jspf
jspg
jspi
jspp
jsps
jspu oup out.print("|")oupl out.println("|")pcg pageContext.getAttribute("|")
pcgn pageContext.getAttributeNamesInScope("|")
pcgs pageContext.getAttributesScope("|")pcr pageContext.removeAttribute("|")pcs pageContext.setAttribute("|",)pg pga pgb pgc pgerr pgex pgie pgim
pgin pgit pgl pgs rg request.getParameter("|")sg session.getAttribute("|")sp session.setAttribute("|", )sr session.removeAttribute("|")tglb
To change default settings:
1. Choose Tools > Options from the main menu.
2. For code templates, select Editor and clickthe Code Templates tab. Here you can alsochange the expansion key, from Tab tosomething else.
3. For keyboard shortcuts, select Keymapand choose a profile from the Profile drop-down list.
Mac OS X keyboard shortcuts:
http://www.netbeans.org/kb/articles/mac.html