Intellij Idea Usage Tips
xml: namespace prefix = o ns = "URN: schema-microsoft-com: office: office" />
In the process of using the Inellij IDEA, by finding information and some own exploits, there are many tips worth mentioning in the IDE of many Java programmers, if they can be skilled in the actual development process, believe It will greatly save your development time, and then there will be some sense of accomplishment:) TRY IT!
1. When writing code, use alt-insert (code | generate ...) to create a getter and setter method in the class.
xml: namespace prefix = v ns = "URN: Schemas-Microsoft-COM: VML" />
2, right-click the breakpoint mark (in the left side of the text) Activate the quick-see menu, you can quickly set up the Enable / Disable breakpoint or condition it's properties.
3, a special variable in the CodeCompletion property is that activation Ctrl-alt-space can complete the class name or not in the current file. If the class is not introduced, the Import flag will be created automatically.
4. Use the Ctrl-Shift-V shortcut to select the recently used clipboard content to insert into the text. When using the system pops up a dialog containing the scrapbook, you can choose the part you want to paste.
5. Use the CodeCompletion property to quickly complete a variety of different statements in the code, the method is to type a few letters in front of the class and then complete the full name with Ctrl-Space. If there are multiple options, they will be listed in the quicker list.
6, use Ctrl- / with Ctrl-Shift- / to Note / Anti-Comment Code Row and Code Block.
- / Use a single line annotation mark ("// ...") to comment / refer to the current line or selectively code block. Ctrl-shift- / then use block annotation tags ("/ * ... * /") to surround the selected block. To reflect a code block, you can press Ctrl-Shift- / in any place in the block.
7. Press Alt-Q (View | Context Info) You can see the current method declaration without moving code. Continuous press will display the currently edited class name twice.
8. Use the Refactor | Copy Class ... You can create a "copy" of the selected class. This is useful, for example, when you want to create a class that has the same class as the class.
9. Ctrl-d in the editor can copy the selected block or the current row without the selected block.
10. Ctrl-w (Select Word) The functionality in the editor is to select the words at the desorber, then select the extension area of the source code. For example, first select a method name, then call the expression of this method, then the entire statement, then inclus the block, and so on.
11. If you don't want to indicate the "bright ball" icon of the event details on the editor, open all event list by pressing the Alt-Enter key button and then click it with the mouse to set the bright ball of this event text attachment to non- Active status.
This will not have the bright ball indicating a special event in the future, but you can still use it with Alt-Enter shortcut.
12. When using the CodeCompletion, you can use a teasing point (.) Character, comma (,) semicolon (;), space, and other characters into the current highlights in the pop-up list. The selected name will automatically enter into the editor with the input character.
13. Use the ESCAPE key in any tool window to move the focus to the editor. Shift-escape can not only move the focus to the editor but also hide the current (or last active) tool window.
The F12 key moves the focus from the editor to the most recently used tool window.
14. An easy way to see any expression value when debugging the program is to select text in the editor (which can be done more efficiently by several Ctrl-W combined keys) and then press ALT-F8.
15. To open the editor's degree of use of the class or method Java document, press SHIFT-F1 (Right-click on the External JavaDoc).
To use this feature, you must set the path to the browser, set (Options | IDE Settings) in the "General" option, and add the created Java document to the project (File | Project Properties).
16. Use the CTRL-F12 (View | File Structure Popup ". You can quickly navigate in the currently edited file.
At this time it displays a list of members of the current class. Select an element to navigate and press Enter or F4. To be easily positioned into an entry in the list, just type it in its name.
17. Place the optical labeled in the code or on the checkpoint and press ALT-F7 (the Find USAGES ... "in the right-click menu quickly finds a certain type, method, or variable in the entire project. s position.
18. Press CTRL-N (Go to | Class ...) The name of the class can quickly open any class in the editor. Select classes from the displayed drop-down list.
The same approach You can open the non-Java file in the project using Ctrl-Shift-N (Go to | File ...).
19. To navigate the statement of some places, methods, or variables used in the code, put the cursor on the view item and press CTRL-B. You can also click the mouse button to adjust to the declaration at the same time by pressing the CTRL key.
20. Put the cursor to the viewpoint and press CTRL-ALT-B to navigate to the implementation code of an abstract method.
21. To see a inheritance level of the selected class, press Ctrl-h (Browse Type Hierarch ". You can also activate the inheritance view of the editor to see the inheritance relationship of the current editing class.
22. Use Ctrl-Shift-F7 (Search | Highlight Usages In file) to quickly highlight the place where a certain variable in the current file is quickly highlighted. Press ESCAPE to clear the highlight display.
23. FAQ is implemented in an editor with ALT-F3 (Search | Incremental Search).
In the "Search for:" prompt, enter the character in the tool, use the arrow keys to search before and back. Press ESCAPE to exit.
24. Press CTRL-J combined keys to perform some Live Template abbreviation you caught. For example, the key "it" then press Ctrl-J to see what happens.
25, Introduce Variable integration helps you simplify complex declarations in your code. For example, in the following code snippet, select an expression in your code:
Then press Ctrl-alt-v (Refactor | Introduce Variable), the following results appear:
26. Ctrl-shift-j shortcuts synthesize two lines and remove unnecessary spaces to match your code format.
27, Ctrl-Shift-Backspace (Go to | Last Edit Location) Let you be transferred to the last place to change in your code.
Many Ctrl-Shift-Backspace see a deeper modification history.
28, use Tools | Reformat Code ... The code is formatted according to your code style reference (view Options | IDE SETTING | CODELELE). Use Tools | Optimize Imports ... You can automatically "optimize" IMPORTS (Clear useless imports et al.) Based on the settings (view options | IDE setting | code style | imports).
29. Live Templates | Live Templates using IDEA allows you to create many typical code between blinkacies. For example, type in one method
Press the Tab button to see what happens.
Use the Tab key to move in different template domains. View Options | Live Templates Get more details.
30. To see the local history modified in a file, activate the Local VCS in the Right-click on the Menu | show History .... Maybe you can navigate different file versions and see if they are different from any of the previous versions.
Use the same right-click menu entry to see the history of modifying in a directory. With this feature, you won't lose any code.
31. If you want to know the purpose of each entry in the main menu, move your mouse pointer to the status bar of the bottom of the menu entry, you will display some short descriptions, maybe it will help you.
32. To display the separation line between the method in the editor, open Options | IDE SETTINGS | Editor, select the "Show Method Separators" check box (Checkbox).
33. Use the Alt-Up and Alt-Down keys to move quickly between different methods in the editor.
34. Use the F2 / SHIFT-F2 key to jump in the highlight.
With ctrl-alt-down / ctrl-alt-up shortcuts, you can jump between compiler error messages or lookup operation results.
35. Basic local law can be easily overloaded by pressing Ctrl-O (Code | Override Methods ...).
To complete the method of the current IMPLEMENTS (or abstract basic class) interface, use Ctrl-I (Code | Implement Methods ...).
36. If the cursor is placed in parentheses calling, press Ctrl-P to display a list of available parameters.
37. To quickly view the Java documentation of the class or method used by the editor to take the character, press Ctrl-q (in the show quick javadoc in the pop-up menu).
38, like Ctrl-Q (Show Quick Javado), Ctrl-P (Show Parameter Info Display Parameter Information), Ctrl-B (Go to Declaration), Shift-F1 (External Javado Exterior Java Document ) And other shortcuts can not only be used in the editor, but also apply in the code to complete the right button list.
39. Ctrl-e (View | Recent Files) pops up the recently accessed file right list. Select the file Press the ENTER button to open.
40. You can rename your class, methods, and variables in IDEA and automatically correct in all places where they are used.
Try it, place the editor to take the character on any variable name and press SHIFT-F6 (Refactor | Rename ...). In the dialog box, type a new name to display and press Enter. You will browse to all places to use this variable and press the "Do Refactor" button to end the rename operation.
41. To quickly select the current editing part (class, file, method, or field) in any view (Project View Project View, Structure View, Structural view, or other view), press ALT-F1 (View | SELECT IN ...).
42. Perhaps a known type object after the "new" character may use the SmartType code to complete this feature. For example, type
Press Ctrl-Shift-Space again:
43. By using the SmartType code, the entire anonymous IMplementation created in the IDEA is also very easy, for example, for some Listener (listener), you can type
Component component;
Component.addmouselistener
NEW
);
Then press Ctrl-Shift-Space to see what happens.
44. It is also helpful to complete with SmartType code when you need to set a known type of expression. For example, type
String s = (
Press Ctrl-Shift-Space to see what will appear.
45, provide quick check function in all views: You can quickly locate it to an entry in the tree.
46. When you want to capture an exception with a code snippet, select this piece in the editor, press Ctrl-Alt-T (Code | Surround With ...) and select "TRY / CATCH". It automatically generates all exceptions thrown in the code snippet. In Options | File Templates | Code Tab, you can customize templates that generate capture blocks themselves.
Use other items in the list to enclose some structures.
47. When using the code, use the Tab key to enter the highlighted display portion in the pop-up list.
Unlike the Enter to accept the input, this selected name overrides other parts of the trip to the right name. This is especially useful when replacing the other with a method or variable name.
48, in declating a variable completion feature will show you a suggested name. For example, start typing "Private fileoutputStream" and press Ctrl-Space
In Options | IDE SETTING | Code Style, you can customize your name for local variables, parameters, instances, and static fields.