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

     

  • 相关阅读:
    Linux下使用Nexus搭建Maven私服
    使用Nexus搭建Maven内部服务器
    windows Maven3.0 服务器配置搭建
    Linux中more和less命令用法
    Jmeter使用入门
    【转载】 DeepMind发表Nature子刊新论文:连接多巴胺与元强化学习的新方法
    【转载】 十图详解tensorflow数据读取机制(附代码)
    【转载】 tensorflow中 tf.train.slice_input_producer 和 tf.train.batch 函数
    (待续) https://zhuanlan.zhihu.com/p/27629294
    ( 待续 ) https://zhuanlan.zhihu.com/p/57864886
  • 原文地址:https://www.cnblogs.com/dgwblog/p/9353108.html
Copyright © 2020-2023  润新知