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
- MDSF:Eclipse MDD Day學習Eclipse
- a tip: (272字)
- tip-off
- rman優化tip優化
- Tip之Self vs _
- iOS開發小tipiOS
- iOS9適配TipiOS
- Oracle 管理的小tip.()(轉)Oracle
- 幾個 JavaScript 效能優化小 TipJavaScript優化
- jquery tip外掛程式碼例項jQuery
- linux history命令使用tip_ztLinux
- 轉載__sqlplus相關tipSQL
- 面試Tip:Android優化之APK瘦身面試Android優化APK
- 自己動手搞一個tip 外掛
- 面試Tip之Android優化工具Systrace面試Android優化
- Tip-Java的雙親委派機制Java
- 【小竅門tip】oracle sequence 修改增量值Oracle
- Groovy Tip 30 BigDecimal資料型別Decimal資料型別
- Java Tip: 用Reflection實現Visitor模式 (轉)Java模式
- formValidation.js驗證隱藏域小tipORMJS
- eclipse 自定義eclipse快捷鍵Eclipse
- 面試Tip:Android優化之APP啟動優化面試Android優化APP
- eclipseEclipse
- [iOS 10 day by day] Day 7:單位換算iOS
- eclipse 如何讓eclipse啟動更快Eclipse
- 【Eclipse】--Eclipse簡介和安裝Eclipse
- [iOS 10 day by day] Day 6:自定義的通知介面iOS
- [iOS 10 day by day] Day 4:新的動畫 API UIViewPropertyAnimatoriOS動畫APIUIView
- 小Tip:有三角的指示框陰影實現
- tree的tip:WHEN-TREE-NODE-SELECTED兩次啟用
- Eclipse-清除Eclipse中Workspace記錄Eclipse
- [Eclipse]eclipse.ini引數說明Eclipse
- 【Eclipse】--Eclipse.ini,JDK,JRE,JVMEclipseJDKJVM
- [eclipse]eclipse之tomcat外掛使用EclipseTomcat
- 【Eclipse】--Eclipse載入現有專案Eclipse
- goodbye eclipse~GoEclipse
- Maven EclipseMavenEclipse