简体   繁体   中英

How do you get the fully qualified class name in Eclipse?

是否有一种快速方法可以在Eclipse中单击Java类并获取其完全限定名称,或将其复制到剪贴板?

Edit on 2016-06-29:

As pointed by Jeff, you only need the 2nd step in the following:

1. Double-click on the class name in the source code.
2. Right-click and select "Copy Qualified Name"

在此输入图像描述

Try this:

  1. Hover the mouse pointer over the name of a class in the editor window, it can be anywhere in the code where a class name appears
  2. In the pop-up window that appears, double-click the fully-qualified name
  3. Press Ctrl + c to copy

Alternatively:

  1. In the project explorer (generally the left window), click on a class name
  2. Press Alt + ENTER to display the properties window
  3. Select and copy the class' path. But you'll need to manually replace the / characters with .

When you hover over it, you see the full name.

在此输入图像描述

And if you click on the window that opens, you can mark the full name and copy it to the clipboard :

在此输入图像描述

Instead of clicking the "Fully Qualified Name" item in the popup, you can simply use its shortcut, Y , when menu is shown. See letter Y underlined on screenshot in Dollyn's answer.

I have a simpler solution: just create a key shortcut

Menu Window > Preferences > (write "keys") > search for "Copy Qualified Name" > add any not-yet-assigned key shortcut. Apply > OK.

There. Ready to use. Easy.

1- Right click on the class name in Package Explorer .

2- Click on Copy Qualified Name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM