本文内容:

Eclipse 4.8版本 代号 photon  光量子 ,感觉更像ide了,虽然这些技巧广为认知,但是作为eclipse来说,也是很重要的、

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.

The 'new' Template

Use the 'new' template for quick object creation.  (通过键入new 快速选择类)

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.

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.

The 'ifnull' Template

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

Block Selection

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

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.

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!

Streams as Test Parameters

You can use methods returning Java streams as a source of parameters in JUnit5 tests. Use @MethodSource as shown below(推荐使用)

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.  ()

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.

Private Methods in Interfaces

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

Invert Equals

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

'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.

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.

Toggle Block Selection

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

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.

Show Implementation In-place

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

Select Enclosing Structure

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

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.

Eclipse Photon 小技巧(tips)的更多相关文章

  1. [Tools] Eclipse使用小技巧-持续更新

    [背景] 使用之中发现一些eclipse使用的小技巧,记录下来供以后查阅   Eclipse保存preferences,并导入到其他workspaces The Export wizard can b ...

  2. eclipse debug小技巧

    测试 Expressions 代码 public static void main(String[] args) { int x=100; System.out.println("----& ...

  3. Eclipse全面提速小技巧

    转自:http://rongmayisheng.com/post/eclipse%E5%85%A8%E9%9D%A2%E6%8F%90%E9%80%9F 欢迎关注我的社交账号: 博客园地址: http ...

  4. eclipse使用小技巧

    1.eclipse中SVN无版本信息显示,window-preference-general-appeerance-label decoration-svn勾上,显示有关项目中受 SVN 控制的资源的 ...

  5. eclipse的小技巧

    Eclipse 保存文件时自动格式化代码 很多同学不知道Eclipse有个很有用的功能,就是自动格式源代码的功能,一般大家都是直接Ctrl+Shift+F手动格式化,多浪费时间. 其实Eclipse里 ...

  6. eclipse 的小技巧

    1. ctrl+o:快速outline 如果想要查看当前类的方法或某个特定方法,但又不想把代码拉上拉下,也不想使用查找功能的话,就用ctrl+o吧.它可以列出当前类中的所有方法及属性,你只需输入你想要 ...

  7. Eclipse 那些小技巧(值得收藏)

    1.菜单命令系列 Edit→content Assist→add Alt+/ 代码关联 Windows→Next Editor→add Ctrl+Tab 切换窗口 Run→Debug Toggle L ...

  8. 工具——eclipse debug小技巧

    1.开启调试: 在代码编辑处右键单击,在弹出菜单中点击Debug As开始调试 2.几个快捷键: F5:跟入Step into, 一般会跟踪进入到调用函数的函数体,Step Over则不会跟踪进入,直 ...

  9. 软件——eclipse debug小技巧

    1.开启调试: 在代码编辑处右键单击,在弹出菜单中点击Debug As开始调试 2.几个快捷键: F5:跟入Step into, 一般会跟踪进入到调用函数的函数体,Step Over则不会跟踪进入,直 ...

随机推荐

  1. matlab中的try...catch...end

    我们知道,matlab的代码是按行执行的,如果碰到错误行,则程序中断.try..catch可以使得可能出错代码不影响后面代码的继续执行,也可以检查,排查,解决程序的一些错误,增强代码的鲁棒性和可靠性. ...

  2. struts2 自定义类型转化 第三弹

    1.Struts2的类型转化,对于8种原生数据类型以及Date,String等常见类型,Struts2可以使用内建的类型转化器实现自动转化:但对于自定义的对象类型来说,就需要我们自己指定类型转化的的方 ...

  3. 读《nodejs开发指南》记录

    最近看了一下<nodejs开发指南>发现nodejs在某些特定的领域由他自己的长处,适合密集计算但是业务逻辑比较简单的场景,如果做网站还是选择php吧,呵呵,这本书我除了第5章<用n ...

  4. 微信video和audio无法自动播放解决方案

    //音频,写法一<audio src="music/bg.mp3" autoplay loop controls>你的浏览器还不支持哦</audio> // ...

  5. 【HDU 4807】Lunch Time 最小费用最大流

    题意 在一个有向图当中,现在每一条边带有一个容量,现在有K个人在起点,需要到终点去吃饭,询问这K个人最后一个人到达食堂的最小时间是多少 贴一篇题解:http://blog.csdn.net/u0137 ...

  6. NodeJS测试实例

    实例一: 先来个简单的实例,把下面的代码保存为main.js,让自己欣喜下: var http = require("http"); function onRequest(requ ...

  7. 如何为现有控件的DependencyProperty添加Value Changed事件?

              主要是利用DependencyPropertyDescriptor 的AddValueChanged 方法, 比如下面的例子为DataGridColumn的VisibilityPr ...

  8. lwip 移植

    一.源码目录结构 api . core.netif. include core下又有IPV4 . IPV6 . SNMP 和.c文件 include下又有IPV4.IPV6.LWIP.netif ne ...

  9. 怎么在docker容器的mysql的编码格式变为utf8

    第一个方法: 1.  编辑MySql的配置文件 MySql的配置文件Windows下一般在系统目录下或者在MySql的安装目录下名字叫my.ini,可以搜索,Linux下一般是/etc/my.cnf ...

  10. npm如何删除node_modules文件夹

    npm install rimraf -g 先安装删除工具,然后使用删除命令 rimraf node_modules