The most common eclipse shortcuts in Android development are detailed collation _android

Source: Internet
Author: User
Tags inheritance
Eclipse shortcuts-Easy to find, oh, bad memory


Line Comment/Pin comment ctrl+/block comment/Pin comment/xml comment ctrl+shift+/ctrl+shift+\


find Find replace Ctrl+h ctrl+f


Find Next/Find Ctrl+k ctrl+shift+k


jump to a line of Ctrl+l, Ha used to editplus, sometimes will knock down Ctrl+g,


find the declaration for the current element ctrl+g


Find all references to the current element ctrl+shift+g


to organize import ctrl+shift+o, to help you remove all unused import declarations at once!


Quick Fix ctrl+1


introduces a class (interface) CTRL + SHIFT + M


Add header Note Shift + ALT + J





Change the startup page android:name= in the Androidmanifest.xml First Activity tab item. Resultdemoactivity "


resultdemoactivity Change to the activity you want to start first





the format of block annotations:


Windows->preferences->java->code style->formatter->edit->comments, and then cancel the "Enable block Comment Formatting "tick.





Edit related shortcut keys





Eclipse is very powerful in editing and has mastered the Eclipse shortcut key capabilities to greatly improve development efficiency. The following are some of the key shortcuts in eclipse that are related to editing.


1. "alt+/" Automatic Prompt method


this shortcut key for the user to edit a good helper, to provide users with the content of the auxiliary, do not remember the whole method and attribute name, when the name of the class, method and attributes, more experience the "alt+/" shortcut key to bring benefits.





2. "Ctrl+o"


shows the outline of methods and properties in a class, and can quickly locate the methods and properties of a class, which is useful when looking for bugs.





3. "ctrl+/" to restore
once again

quickly adds comments that enable you to quickly annotate or uncomment the row or selected line of the cursor, and you may need to annotate something or uncomment it while you are debugging, so now you don't need to repeat the comment for each line.





4. "Ctrl+d"


Delete the current line, this is also one of the author's favorite, do not have to delete a row and press the deletion key so many times.





5. "Ctrl+m"


window maximization and restore, when the user in the window to operate, always feel the current window small (especially when writing code), now good, try "ctrl+m" shortcut keys.





View and position shortcut keys





in the program, quickly locate the location of the code, quickly find where the bug is, it is very difficult, Eclipse provides a powerful lookup function, you can use the following shortcut keys to help complete the search positioning work.





1. "Ctrl+k", "Ctrl++shift+k"


quickly looks down and up to find the selected content, no longer need to click the mouse to find the dialog box.





2. "Ctrl+shift+t"


Find a Java class file found in a workspace (Workspace) build path, do not suffer for a class that cannot be found, and can use "*", "?" "The wildcard character.





3. "Ctrl+shift+r"


As with "Ctrl+shift+t", Find all the files (including Java files) in the workspace (Workspace), or you can use wildcard characters.





4. "Ctrl+shift+g"


find references to classes, methods, and properties. This is a very useful shortcut, such as modifying the code that references a method, and you can quickly locate all references to this method by using the "ctrl+shift+g" shortcut key.





5. "Ctrl+shift+o"


quickly generate import, when copying a program from the Internet, do not know how to import into the called class, try "ctrl+shift+o" shortcut keys, there will be surprises.





6. "CTRL+SHIFT+F" specification code


format code, writing format specification code is a compulsory course for every programmer, when you see a piece of code very uncomfortable, select and press the "ctrl+shift+f" shortcut key to format this code, if not selected code is the default format of the current file (Java file).





7. "Alt+shift+w"


find the path in the project where the current file is located, you can quickly locate the browser view, which is useful when you want to find the package where a file resides (especially in larger projects).





8. "Ctrl+l"


navigates to a row in the current editor and is also valid for non-Java files.





9. "alt+←", "alt+→"


back history and forward history, useful for tracking code, users may have looked up several related places, but may not be able to remember, you can use these two shortcuts to locate the order of the lookup.





10. "F3"


a class, method, and property that quickly locates the cursor position.





11. "F4"


Displays the inheritance relationship of the class and opens the Class inheritance view.





12. "Knock First"/"Knock two * * *, then enter or press Alt+shift+j before the method name to add Javadoc annotation"


Method Annotation





Debugging shortcut keys





Eclipse has some of the following shortcuts associated with running debugging.





1. "Ctrl+shift+b": a breakpoint that sets a breakpoint or cancels the setting on the current line.


2. "F11": Debug the Last executed program.


3. "Ctrl+f11": Runs the program that was last executed.


4. "F5": Tracked to the method, and when the program executes to a method, it can be tracked to the method by pressing the "F5" key.


5. "F6": Step Into the program.


6. F7: Finishes the method and returns to the last statement that called this method.


7. "F8": Continue execution to the next breakpoint or end of the program.





Common editor shortcut keys





usually text editors provide shortcuts for editing, and you can use these shortcuts for text editing in Eclipse.


1. "Ctrl + C": Copy.


2. "Ctrl+x": Cut.


3. "Ctrl + V": Paste.


4. "Ctrl+s": Save the file.


5. "Ctrl+z": Undo.


6. "Ctrl+y": Repeat.


7. "Ctrl+f": Find.





Other shortcut keys




There are a number of shortcuts in
eclipse that cannot be enumerated, and users can find out how they are used by help documents, and there are several common shortcuts below.


1. "Ctrl+f6": Switch to the next editor.


2. "CTRL+SHIFT+F6": Switch to the previous editor.


3. "CTRL+F7": Switch to the next view.


4. "CTRL+SHIFT+F7": Switch to the previous view.


5. "Ctrl+f8": Switch to the next perspective.


6. "Ctrl+shift+f8": Switch to previous perspective.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.