开发者

Snippet creation keystroke/shortcut in Eclipse

开发者 https://www.devze.com 2023-01-20 10:39 出处:网络
So I was using Eclipse and I went to go copy some import statements I had selected. I somehow mis-typed, and the coolest thing happened: a snippet package was created, and a Snippet.java class was cre

So I was using Eclipse and I went to go copy some import statements I had selected. I somehow mis-typed, and the coolest thing happened: a snippet package was created, and a Snippet.java class was created that looked like this:

package snippet;

public class Snippet {
    public static void main(String[] args) {
        // Selected code
    }
}

Does anyone know what the keyboard shortcut for doing this is? It seems like a immensely useful feature to have. I have tried searchin开发者_运维百科g online, but had no luck.


This is what happens when you copy code and paste it into the Package Explorer. If you have a project selected, it will create the snippet package, if you have nothing selected then it will create a new java project named _pasted_code_

0

精彩评论

暂无评论...
验证码 换一张
取 消