2018-10-2 Tip of the Day(eclipse)
1.Code completion
Code completion allows you to quickly complete statements in your code. For example, start typing a part of a method name and press 'CTRL+Space' to complete it. Multiple choices are presents to you via a popup.
2.The 'new' Template
Use the 'new' template for quick object creation.
3.Extract class refactoring (Alt+Shift+T)
The 'Extract class...' refactoring (from 'Alt+Shift+T') extracts a group of fields into a separate class and replaces all occurrences to fit the new structure.
4.Add Module
You don't need to know which module contains a class in Java9. 'Ctrl+1' can identify the module and add it for you.
5.The 'ifnull' Template
Use the 'ifnull' template to quickly create an if null check.
6. Block Selection
Use the Edit -> Block Selection (Alt+Shift+A) while working with Java9.
7.Use CSV as Parameter Source
You can directly use a CSV file as a parameter source in JUnit5 parameterised tests for a large number of cases.
8.CSV in Parameterised Tests
In JUnit5 parameterised tests also accept CSV literals (and files) as a source of parameters. Quite handy to feed your tests!
9. Streams as Test Parameters
You can use methods returning Java streams as a source of parameters in JUnit5 tests. Use @MethodSource as shown below.
10.Jump to Javadoc on Web
Put your cursor on a class name (or method) and press 'Shift+F2' to jump to the web version of your library's Javadoc.
11.CTRL+3 - The Master Shortcut
Use the 'Quick Access' box (Ctrl+3) to be more productive. Just type what you want and you'll probably find it.
12.Private Methods in Interfaces
Private methods in interfaces are allowed in Java9. Here's an example use case with a shared 'worker' method.
13.Invert Equals
Always safer to 'Invert equals' on literal strings in order to avoid a NullPointerException! 'Ctrl+1' does it for you.
14.'Show in' for more Details
Whatever element you have selected, code or item, 'Show in...' (Alt+Shift+W) command pops up useful views for various details.
15.Alt+Up and Alt+Down
Press 'Alt+Up/Dn' to move the selected lines along with the cursor. Indenting is corrected for you. 'Alt+Shift+Up/Down' copies the selection.
16.Toggle Block Selection
Edit -> Toggle Block Selection tool (or just hit 'Shift+Alt+A') is demonstrated below.
17.Inspect Variable Declaration
If you want to see where and how a variable was declared press 'Shift' while hovering and you'll see it in-place.
18.Show Implementation In-place
Press 'Shift' while hovering a method and it will show implementation in-place.
19.Select Enclosing Structure
The 'enclosing' selection (Alt+Shift+Up/Dn) shortcut selects the enclosing structure, e.g. var->if->method->class
20.Java 10 'var'
Use Java 10 and the new 'var' statement in Eclipse with its quick assists (Ctrl+1). Install Java 10 support from Eclipse Marketplace first.
21.Opening the Tips Dialog
The tips are shown automatically at startup if there are tips available. In case the tips are not loaded at startup you can activate the tips manually from the Help menu.
22.Tips Available?
In case you do not want to start tips at startup, you can still see if there are tips available. Check the bottom right corner to see a little lightbulb. This lightbulb only appears if there is something to read.
23.Action Tips
Some tips enable you to start one or more actions. If this is the case then an additional button will be displayed like in this tip. Go ahead and press the button, or choose another action from the drop down menu next to the button.
相關文章
- Java基礎知識日積月累(Tip of the Day20)Java
- iOS開發小tipiOS
- 幾個 JavaScript 效能優化小 TipJavaScript優化
- 面試Tip之Android優化工具Systrace面試Android優化
- 面試Tip:Android優化之APK瘦身面試Android優化APK
- Eclipse SymphonyEclipse
- Maven EclipseMavenEclipse
- goodbye eclipse~GoEclipse
- eclipse安裝教程配置 2021最新eclipse教程Eclipse
- formValidation.js驗證隱藏域小tipORMJS
- Eclipse快捷鍵Eclipse
- 再見,Eclipse。Eclipse
- Eclipse建立workingsetEclipseGse
- Older Versions Of EclipseEclipse
- Eclipse lombok javaEclipseLombokJava
- 【Android Eclipse】Eclipse 引用 library 時的常見異常AndroidEclipse
- Eclipse-用Eclipse搭建一個maven專案-續EclipseMaven
- 面試Tip:Android優化之APP啟動優化面試Android優化APP
- 再見,Eclipse...Eclipse
- Debug追蹤eclipseEclipse
- 【eclipse遇到的坑】Eclipse
- Eclipse背景設定Eclipse
- day day up
- Eclipse的編輯功能非常強大,掌握了Eclipse快捷鍵Eclipse
- 小Tip:有三角的指示框陰影實現
- [譯] Android 實現顏色漸變的一個小 tipAndroid
- eclipse與hadoop-eclipse-plugin之間的版本對應關係EclipseHadoopPlugin
- Eclipse project 重新命名問題(如何徹底修改Eclipse工程名)EclipseProject
- Eclipse配置maven環境EclipseMaven
- 在eclipse中maven配置EclipseMaven
- 【轉】Eclipse快捷鍵指南Eclipse
- Eclipse配置反編譯Eclipse編譯
- eclipse Java Spark local模式EclipseJavaSpark模式
- eclipse常用的快捷鍵Eclipse
- 什麼是Eclipse MicroProfile?Eclipse
- eclipse的使用心得Eclipse
- Eclipse中Git的使用EclipseGit
- Maven+Eclipse工程搭建MavenEclipse