eclipsefilepath-finding

Copy path/file name in Eclipse to clipboard


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


Solution

  • 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