“打开类型”命令在 Eclipse 工作区中没有响应

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5870153/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:16:26  来源:igfitidea点击:

"Open Type" command does not respond in Eclipse workspace

eclipsehotkeys

提问by jyoungdev

In Eclipse, you can use Ctrl+ Shift+ Tto search for a type. Unfortunately, Eclipse does not respond to this hotkey in one of my workspaces.

在Eclipse中,你可以使用Ctrl+ Shift+T搜索类型。不幸的是,Eclipse 没有响应我的工作区之一中的这个热键。

I am running IBM AST 6.1, which is built on Eclipse 3.2.1 (see http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/tins_ast_roadmap.html).

我正在运行基于 Eclipse 3.2.1 的 IBM AST 6.1(请参阅http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.express。 doc/info/exp/ae/tins_ast_roadmap.html)。

When I go to Window -> Preferences -> General -> Keys, it shows the Open Type command is set to the Key Sequence Ctrl+Shift+T"When" "In Windows". Is this correct?

当我转到 Window -> Preferences -> General -> Keys 时,它显示 Open Type 命令设置为 Key Sequence Ctrl+ Shift+ T"When" "In Windows"。这样对吗?

I can use Ctrl+Shift+Rto search for a resource in this same Workspace, using the same Ctrland Shiftkeys (i.e. the keys are working). I can also use Ctrl+Shift+Ton other workspaces with the same Eclipse installation.

我可以使用Ctrl+ Shift+R在这同一个工作区来搜索资源,使用相同的CtrlShift键(即键工作)。我也可以用Ctrl+ Shift+T上使用相同的Eclipse安装其他工作区。

How can I enable Ctrl+Shift+T? What other info do we need to troubleshoot?

如何启用Ctrl+ Shift+ T?我们还需要哪些其他信息来进行故障排除?

回答by Arne Deutsch

Do you have the right perspective opened? "Open Type" does work in the Java, JavaEE ... perspectives, but not in the "Synchronize" perspective (for example).

你有正确的视角吗?“开放类型”在 Java、JavaEE ... 透视图中确实有效,但在“同步”透视图中不起作用(例如)。

To enable it for the "Synchronize" perspective in eclipse Mars(4.5) first close all your opened editors then go to Window > Perspective > Customize Perspective... and in the "Action Set Availability" tab check the "Java Navigation" action set.

要在 eclipse Mars(4.5) 中为“同步”透视启用它,首先关闭所有打开的编辑器,然后转到“窗口”>“透视”>“自定义透视”...并在“操作集可用性”选项卡中检查“Java 导航”操作集.

回答by angry_gopher

Try to delete all Eclipse indexed names in the following way:

尝试通过以下方式删除所有 Eclipse 索引名称:

  1. Go to folder workspace/.metadata/.plugins/org.eclipse.jdt.core
  2. Remove all *.indexfiles and savedIndexNames.txt
  3. Restart Eclipse
  1. 转到文件夹workspace/.metadata/.plugins/org.eclipse.jdt.core
  2. 删除所有*.index文件和savedIndexNames.txt
  3. 重启 Eclipse

The recommendations were provided by Mike Schrag and the whole trace can be found here.

建议由 Mike Schrag 提供,可以在此处找到完整的跟踪记录。

回答by John Cleary

I was already in the right perspective so that was not the cause of my issue. However, closing and re-opening the project fixed the problem for me.

我已经处于正确的角度,所以这不是我问题的原因。但是,关闭并重新打开该项目为我解决了问题。

回答by r1chjc

The same problem was resolved for me in a slightly different way... I first checked that I followed the accepted answer, confirmed that the Open Type command was mapped correctly and relevant to the perspective I was in.

以稍微不同的方式为我解决了同样的问题......我首先检查了我是否遵循了接受的答案,确认打开类型命令已正确映射并且与我所在的视角相关。

But... it was still not functioning, apparently because focus was in a javascript file. Clicking out and assigning focus back to the package explorer tab allowed Open Type to work.

但是...它仍然无法运行,显然是因为焦点在一个 javascript 文件中。单击并将焦点分配回包资源管理器选项卡允许 Open Type 工作。

回答by Rahul

For people who need to switch focus from JavaScriptsevery now and then. 1.Go to Window -> Preferences -> General ->Keys .

对于需要不时从JavaScript转移注意力的人。1.转到 Window -> Preferences -> General -> Keys 。

2.Search for Open typefrom list .

2.从列表中搜索打开类型

3.In Description: ensure it's Open a type in a Java editor

3.在描述中:确保它在 Java 编辑器中打开一个类型

In Binding: ctrl + shift + T

在绑定中ctrl + shift + T

when: In Windows4.Apply.

时间在 Windows4.Apply 中。

P.S: IF any duplicates of Open Typeplease unbindit or restoredefaults.

PS: 如果Open Type 有任何重复,请解除绑定恢复默认值。

回答by Rohtash Singh Lakra

Although, this is a very old post. But it might be someone get this problem in future.

虽然,这是一个非常古老的帖子。但将来可能有人会遇到这个问题。

The above mentioned posts can help in most of the scenarios. But sometimes, even you select the Java/J2EE perspective, but the selected project is not a nature of java/j2ee. And in that case, the Open Type will open but will not search anything. And to fix that you have to make sure, the selected project has the following code in .project file:

上面提到的帖子可以在大多数情况下提供帮助。但有时,即使您选择了 Java/J2EE 透视图,但所选项目并不是 java/j2ee 的性质。在这种情况下,打开类型将打开但不会搜索任何内容。为了解决这个问题,您必须确保所选项目在 .project 文件中具有以下代码:

<natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
</natures>

回答by juanchito

you need to make sure that the eclipse window is active in your OS.

您需要确保 Eclipse 窗口在您的操作系统中处于活动状态。