简体   繁体   English

(Eclipse - OS X)如何从javadoc弹出窗口复制?

[英](Eclipse - OS X) How do you copy from javadoc popups?

Coming from Windows, when I use Eclipse and mouse over a class / method / variable that has a Javadoc - a Javadoc window pops up (or alternatively you can hit F2). 来自Windows,当我在具有Javadoc的类/方法/变量上使用Eclipse和鼠标时 - 弹出一个Javadoc窗口(或者你可以点击F2)。 Eclipse on Mac OS X 10.8.2 has the same behavior. Mac OS X 10.8.2上的Eclipse具有相同的行为。 However where they differ is that in windows I can highlight content in the popup window and copy it (Ctrl+C) and then paste it somewhere. 但是它们的不同之处在于,在Windows中我可以突出显示弹出窗口中的内容并将其复制(Ctrl + C),然后将其粘贴到某处。 I cannot get this to work in Mac OS X 10.8.2. 我无法在Mac OS X 10.8.2中使用它。 I've tried both command key + C (which works everywhere else) and I've also tried Ctrl+C. 我已经尝试了两个命令键+ C(其他地方都可以使用),我也尝试过Ctrl + C. No dice. 没有骰子。

I use this frequently when setting a local variable to a value returned by a getter method. 将局部变量设置为getter方法返回的值时,我经常使用它。 I can just open the Javadoc and copy the return type, and then paste it into the editor as the type for my new local variable. 我可以打开Javadoc并复制返回类型,然后将其粘贴到编辑器中作为我的新局部变量的类型。 It saves a lot of time if the return type is a complicated Map type with generic arguments. 如果返回类型是带有泛型参数的复杂Map类型,则会节省大量时间。

Also it is helpful when helping out co-workers to be able to copy / paste portions of the Javadoc to them via IM. 在帮助同事能够通过IM将Javadoc的部分内容复制/粘贴给他们时,它也很有帮助。

Is this not possible on Mac OS X 10.8.2? 这在Mac OS X 10.8.2上是不可能的吗? Is there a work around? 有工作吗?

Edit : Using Eclipse Juno SR 2 编辑 :使用Eclipse Juno SR 2

It appears to be a bug. 这似乎是一个错误。 For me, it will only copy the first time. 对我来说,它只会在第一次复制。 Anytime after that you try to copy, it doesn't work -- until you restart Eclipse. 在您尝试复制之后的任何时候,它都不起作用 - 直到您重新启动Eclipse。 Also affects Javadoc view unfortunately, but not the editor. 不幸的是,它也会影响Javadoc视图,但不会影响编辑器。

If you highlight the class/method/variable you are interested in, at the bottom of your Eclipse window there should be a list of tabs alongside console, one of which named Javadoc. 如果你突出你感兴趣的类/方法/变量,在Eclipse窗口的底部应该有一个选项卡列表和控制台,其中一个名为Javadoc。

If you select this tab, the Javadoc should show in the window where your console normally appears, and you can copy using CMD-c as normal. 如果选择此选项卡,Javadoc应显示在控制台正常显示的窗口中,您可以正常使用CMD-c进行复制。

EDIT: If Javadoc doesn't show, make sure to enable it from Window > Show View > Javadoc 编辑:如果Javadoc没有显示,请确保从Window> Show View> Javadoc启用它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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