Eclipse Photon 小技巧(tips)
本文内容:
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)的更多相关文章
- [Tools] Eclipse使用小技巧-持续更新
[背景] 使用之中发现一些eclipse使用的小技巧,记录下来供以后查阅 Eclipse保存preferences,并导入到其他workspaces The Export wizard can b ...
- eclipse debug小技巧
测试 Expressions 代码 public static void main(String[] args) { int x=100; System.out.println("----& ...
- Eclipse全面提速小技巧
转自:http://rongmayisheng.com/post/eclipse%E5%85%A8%E9%9D%A2%E6%8F%90%E9%80%9F 欢迎关注我的社交账号: 博客园地址: http ...
- eclipse使用小技巧
1.eclipse中SVN无版本信息显示,window-preference-general-appeerance-label decoration-svn勾上,显示有关项目中受 SVN 控制的资源的 ...
- eclipse的小技巧
Eclipse 保存文件时自动格式化代码 很多同学不知道Eclipse有个很有用的功能,就是自动格式源代码的功能,一般大家都是直接Ctrl+Shift+F手动格式化,多浪费时间. 其实Eclipse里 ...
- eclipse 的小技巧
1. ctrl+o:快速outline 如果想要查看当前类的方法或某个特定方法,但又不想把代码拉上拉下,也不想使用查找功能的话,就用ctrl+o吧.它可以列出当前类中的所有方法及属性,你只需输入你想要 ...
- Eclipse 那些小技巧(值得收藏)
1.菜单命令系列 Edit→content Assist→add Alt+/ 代码关联 Windows→Next Editor→add Ctrl+Tab 切换窗口 Run→Debug Toggle L ...
- 工具——eclipse debug小技巧
1.开启调试: 在代码编辑处右键单击,在弹出菜单中点击Debug As开始调试 2.几个快捷键: F5:跟入Step into, 一般会跟踪进入到调用函数的函数体,Step Over则不会跟踪进入,直 ...
- 软件——eclipse debug小技巧
1.开启调试: 在代码编辑处右键单击,在弹出菜单中点击Debug As开始调试 2.几个快捷键: F5:跟入Step into, 一般会跟踪进入到调用函数的函数体,Step Over则不会跟踪进入,直 ...
随机推荐
- myeclipse内存不足的处理
Myeclipse内存溢出解决方案 1.tomcat内存扩展 修改tomcat中bin目录下catalina.bat文件在echo Using CATALINA_BASE: "%CATAL ...
- wordpress,cos-html-cache静态化后,点击数失效问题的解决方案
装了wordpress cos-html-cache 静态插件后,生成了静态文件,post-views等点击数插件就失效了, 找了一些,包括有个js版本的,需要用到post-views插件,我也不想装 ...
- kvm初体验之三:vm的安装及管理
Host: CentOS release 6.4 (Final) Guest: CentOS release 6.6 (Final) 全程以root身份操作 1. host上创建桥br0 参考< ...
- 第三届蓝桥杯决赛c++b组
1.星期几 [结果填空] (满分5分) 1949年的国庆节(10月1日)是星期六. 今年(2012)的国庆节是星期一. 那么,从建国到现在,有几次国庆节正好是星期日呢? 只要 ...
- swift的泛型貌似还差点意思
protocol Container { typealias ItemType mutating func append(item: ItemType) mutating func removelas ...
- Unity-2017.3官方实例教程Space-Shooter(一)
由于初学Unity,写下此文作为笔记,文中难免会有疏漏,不当之处还望指正. Unity-2017.3官方实例教程Space-Shooter(二) 章节列表: 一.从Asset Store中下载资源并导 ...
- laravel 5.4 运行 make:auth 报错
Laravel 5.4 migrate时报错: Specified key was too long error 问题根源 MySQL支持的utf8编码最大字符长度为3字节,如果遇到4字节的宽字符就会 ...
- 【LeetCode】062. Unique Paths
题目: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). ...
- 实际用户ID和有效用户ID (三) *****
我们知道权限有r,w,x.其实除了这三个,还有特殊权限.比如: [root@localhost ~]# ls -l /usr/bin/passwd -rwsr-xr-x 1 root root 229 ...
- Python3解leetcode Symmetric Tree
问题描述: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). ...