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.

2018-10-2 Tip of the Day(eclipse)

 2.The 'new' Template

Use the 'new' template for quick object creation.

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)          2018-10-2 Tip of the Day(eclipse)

 2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

5.The 'ifnull' Template 

Use the 'ifnull' template to quickly create an if null check.

2018-10-2 Tip of the Day(eclipse)

6. Block Selection

Use the Edit -> Block Selection (Alt+Shift+A) while working with Java9.

2018-10-2 Tip of the Day(eclipse)

 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.

2018-10-2 Tip of the Day(eclipse)

2018-10-2 Tip of the Day(eclipse)

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!

2018-10-2 Tip of the Day(eclipse)

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

12.Private Methods in Interfaces 

Private methods in interfaces are allowed in Java9. Here's an example use case with a shared 'worker' method.

2018-10-2 Tip of the Day(eclipse)

2018-10-2 Tip of the Day(eclipse)

13.Invert Equals

Always safer to 'Invert equals' on literal strings in order to avoid a NullPointerException! 'Ctrl+1' does it for you.

2018-10-2 Tip of the Day(eclipse)

 2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

16.Toggle Block Selection

Edit -> Toggle Block Selection tool (or just hit 'Shift+Alt+A') is demonstrated below.

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

18.Show Implementation In-place

Press 'Shift' while hovering a method and it will show implementation in-place.

2018-10-2 Tip of the Day(eclipse)

19.Select Enclosing Structure

The 'enclosing' selection (Alt+Shift+Up/Dn) shortcut selects the enclosing structure, e.g. var->if->method->class

2018-10-2 Tip of the Day(eclipse)      2018-10-2 Tip of the Day(eclipse)

2018-10-2 Tip of the Day(eclipse)      2018-10-2 Tip of the Day(eclipse)

2018-10-2 Tip of the Day(eclipse)      2018-10-2 Tip of the Day(eclipse)

2018-10-2 Tip of the Day(eclipse)       2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

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.

2018-10-2 Tip of the Day(eclipse)

相关文章: