Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
196 views
in Technique[技术] by (71.8m points)

Copy path/file name in Eclipse to clipboard

Is there a shortcut to copy the current path/file to the clipboard?

question from:https://stackoverflow.com/questions/8006250/copy-path-file-name-in-eclipse-to-clipboard

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is Copy Qualified Name function in Eclipse, it will copy the full name of the element you select (or element on cursor).

For example :

/MyProject/src/app/Application.java : when you select Application.java in Package Explorer

java.util.HashSet<String> : when you copy while cursor at HashSet<String>

However, it required you to select the element you want.

So, here is what I do.

  1. Make your Package Explorer link with editor, you can active this by click the double-arrow icon at top-right corner.

  2. Set up a hot-key for Show View (Package Explorer) ex : Alt + 1

  3. Set up a hot-key for Copy Qualified Name ex : Alt + Ctrl + Shift + c

Whenever I need these information in current file, I just press the hot-key to call my Package Explorer Since it links with editor and will always select the file in current editor, you can just copy with the hot-key. Then you can use F12 back to your editor, or simply ESC if you use fast view.

Not perfect, but it works :D


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
...