Evans Plus
Thứ Tư, 11 tháng 3, 2015

Cách gõ tắt và phím tắt trong NetBeans

Trong lập trình Java thì các câu lệnh thường dài nên tốc độ gõ code sẽ gây mất nhiều thời gian vì thế sau đây EvansPlus.Com sẽ chia sẻ các cách gõ tắt và phím tắt cần thiết trong sử dụng phần mềm NetBeans để khi gõ code có thể giảm thiểu thời gian hơn.


Các câu lệnh code thu gọnJava Editor Code Templates
En               Enumeration
Ex               Exception
Ob             Object
Psf             public static final
Psfb          public static final boolean
Psfi             public static final int
Psfs            public static final String
St                String
ab              abstract
as               assert true;
bcom          /**/
bo              boolean
br               break;
ca               catch (
cl             class
cn              continue
db           double
df              default:
dowhile           do { } while (condition);
eq                equals
ex              extends
fa                false
fcom           // <editor-fold></editor-fold>
fi            final
fl            float
forc                 for (Iterator it = collection.iterator();it.hasNext();) {Object elem = (Object) it.next();}
fore                for (Object elem : iterable) {}
fori                    for (int i = 0; i < arr.length; i++) {}
forl               for (int i = 0; i < lst.size(); i++) {
Object                object = lst.get(i); }
forst               for (StringTokenizer st = new
String               Tokenizer(“”); st.hasMoreTokens();) }
forv               for (int i = 0; i < vct.size(); i++) {
Object               object = vct.elementAt(i);}
fy                    finally{ |}
ie            interface
ifelse               if (condition){}else { }
iff                       if (exp) {}
im                    implements
inst               if (exp instanceof Object) {
Object          obj = (Object) exp;
iof                instanceof
ir               import
le              length
na            native
newo           Object name = new Object(args);
pe           protected
pr            private
psf           private static final
psfb              private static final boolean
psfi            private static final int
psfs            private static final String
pst              printStackTrace();
psvm                public static void main(String[] args){}
pu              public
re                 return
runn                 Runnable runnable = new Runnable() {
public             void run() {}};
serr              System.err.println (“|”);
sh                short
sout              System.out.println (“|”);
soutv                System.out.println(“Object = ” + Object);
st                   static
su                 super
sw                        switch (var) { case val: break;
default:                  throw new AssertionError();}
sy                      synchronized
tds                Thread.dumpStack();
th                   throws
tr                    transient
trycatch              try {}
catch                    (Exception e) {}
tw                       throw
vo                    volatile
wh                           while (
whileit                   while (it.hasNext()) {
Object                  elem = (Object) it.next();}
whilen                  while (en.hasMoreElements()) {
Object                 elem = (Object) en.nextElement();}
whilexp                while (exp) {}
ag                      application.getAttribute(“|”)
ap                   application.putAttribute(“|”,)
ar                   application.removeAttribute(“|”)
cfgi                             config.getInitParameter(“|”)
jspf                                        <jsp:forward page=”|”/>
jspg                 <jsp:getProperty name=”|” property=”” />
jspi                <jsp:include page=”|”/>
jspp             <jsp:plugin type=”|” code=”” codebase=””></jsp:plugin>
jsps                    <jsp:setProperty name=”|” property=””/>
jspu             <jsp:useBean id=”I” type=””/>
oup                             out.print(“|”)
oupl                           out.println(“|”)
pcg                pageContext.getAttribute(“|”)
pcgn                  pageContext.getAttributeNamesInScope(“|”)
pcgs                         pageContext.getAttributesScope(“|”)
pcr               pageContext.removeAttribute(“|”)
pc                      s pageContext.setAttribute(“|”,)
pg                  <%@page |%>
pga               <%@page autoFlush=”false”%>
pgb              <%@page buffer=”|kb”%>
pgc                  <%@page contentType=”|”%>
pgerr                     <%@page errorPage=”|”%>
pgex                          <%@page extends=”|”%>
pgie           <%@page isErrorPage=”true”%>
pgim          <%@page import=”|”%>
pgin                   <%@page info=”|”%>
pgit                      <%@page isThreadSafe=”false”%>
pgl                      <%@page language=”java”%>
pgs                    <%@page session=”false”%>
rg                    request.getParameter(“|”)
sg                  session.getAttribute(“|”)
sp            session.setAttribute(“|”, )
sr              session.removeAttribute(“|”)
tglb             <%@taglib uri=”|”%>
Finding, Searching, and Replacing
     Ctrl-F3 Search word at insert point
     F3/Shift-F3 Find next/previous in file
     Ctrl-F/H Find/Replace in file
     Alt-F7 Find usages
     Ctrl-Shift-F/H Find/replace in projects
     Alt-Shift-U Find usages results
     Alt-Shift-H Turn off search result highlights
     Ctrl-R Rename
     Ctrl-U, then U Convert selection to uppercase
     Ctrl-U, then L Convert selection to lowercase
     Ctrl-U, then S Toggle case of selection
     Ctrl-Shift-V Paste formatted
     Ctrl-Shift-D Show Clipboard History
     Ctrl-I Jump to quick search field
     Alt-Shift-L Copy file path
Navigating through Source Code
     Ctrl-O/Alt-Shift-O Go to type/file
     Ctrl-Shift-T Go to JUnit test
     Alt-O Go to source
     Ctrl-B Go to declaration
     Ctrl-G Go to line
     Ctrl-Shift-M Toggle add/remove bookmark
     Ctrl-Shift-Period /
     Comma
     Next/previous bookmark
     Ctrl-Period /
     Comma
     Next/previous usage/compile
     error
     Alt-Shift-Period /
     Comma
     Select next/previous element
     Ctrl-Shift-1/2/3 Select in Projects/Files/Favorites
     Ctrl-[ Move caret to matching bracket
     Ctrl-K/Ctrl-Shift K Next/previous word match
     Alt-Left/Alt-
     Right/Ctrl-Q
     Go backward/forward/to last
     edit
     Alt Up / Down Next/previous marked
     occurrence
Coding in C/C++
     Alt-Shift-C Go to declaration
     Ctrl-F9 Evaluate expression
Coding in Java
     Alt-Insert Generate code
     Ctrl-Shift-I Fix all class imports
     Alt-Shift-I Fix selected class’s import
     Alt-Shift-F Format selection
     Alt-Shift Left/
     Right/Up/Down
     Shift lines left/right/up/down
     Ctrl-Shift-R Rectangular Selection (Toggle)
     Ctrl-Shift-Up/D Copy lines up/down
     Ctrl/Alt-F12 Inspect members/hierarchy
     Ctrl-/ Add/remove comment lines
     Ctrl-E Delete current line
Compiling, Testing, and Running
     F9 Compile package/ file
     F11 Build main project
     Shift-F11 Clean & build main project
     Ctrl-Q Set request parameters
     Ctrl-Shift-U Create Unit test
     Ctrl-F6/Alt-F6 Run Unit test on file/project
     F6/Shift-F6 Run main project/file
Opening and Toggling between Views
     Ctrl-Tab (Ctrl-`) Switch between open
     documents by order used
     Shift-Escape Maximize window (toggle)
     Ctrl-F4/Ctrl-W Close selected window
     Ctrl-Shift-F4 Close all windows
     Shift-F10 Open contextual menu
     Ctrl-PgUp /
     PgDown
     Switch between open
     documents by order of tabs
     Ctrl-Alt-T Reopen recently closed file
     Ctrl-Alt-PgUp /
     PgDown
     Toggle between editor types
     Alt-Mouse Wheel
     Up / Down
     Zoom text in / out
Debugging
     Ctrl-F5 Start debugging main project
     Ctrl-Shift-F5 Start debugging current file
     Ctrl-Shift-F6 Start debugging test for file
     Shift-F5/F5 Stop/Continue debugging session
     F4 Run to cursor location in file
     F7/F8 Step into/over
     Ctrl-F7 Step out
     Ctrl-Alt-Up Go to called method
     Ctrl-Alt-Down Go to calling method
     Ctrl-F9 Evaluate expression
     Ctrl-F8 Toggle breakpoint
     Ctrl-Shift-F8 New breakpoint
     Ctrl-Shift-F7 New watch
Để download Netbeans version mới nhất : https://netbeans.org/