简体   繁体   English

如何在 NetBeans 中将打开的文件与项目树链接

[英]How to link opened file with project tree in NetBeans

I feel dumb asking this question, but I can't find solution to this myself.问这个问题我觉得很愚蠢,但我自己找不到解决方案。

When I open several files in editor and switch between them, I have problem finding currently opened file in project or files tree.当我在编辑器中打开多个文件并在它们之间切换时,我无法在项目或文件树中找到当前打开的文件。

I used Eclipse before and every time I changed a tab with file, the project tree set focus for the same file.我之前使用过 Eclipse,每次更改带有文件的选项卡时,项目树都会为同一文件设置焦点。 Is there a way to do something like this in NetBeans?有没有办法在 NetBeans 中做这样的事情?

Just thought of adding what ax said:刚想加入斧头说的:

The keyboard shortcuts in Windows are: Windows 中的键盘快捷键是:

  • Select in Projects : Ctrl+Shift+1在项目中选择: Ctrl+Shift+1
  • Select in Files : Ctrl+Shift+2在文件中选择: Ctrl+Shift+2

The keyboard shortcuts in OS X are: OS X 中的键盘快捷键是:

  • Select in Projects : CMD+Shift+1在项目中选择: CMD+Shift+1
  • Select in Files : CMD+Shift+2在文件中选择: CMD+Shift+2

As described in NetBeans "link with editor" feature , if you want the link to be permanent or persistent, use View |NetBeans“与编辑器链接”功能中所述,如果您希望链接是永久的或持久的,请使用 View | Synchronize Editor with Views.将编辑器与视图同步。 (In NetBeans >= 6.7.1, at least.) (至少在 NetBeans >= 6.7.1 中。)

from http://forums.netbeans.org/topic3732.html :来自http://forums.netbeans.org/topic3732.html

You can do this from the navigate menu, I believe.我相信您可以从导航菜单中执行此操作。 There are entries for going to the file in the project tab or the file tab.在项目选项卡或文件选项卡中有用于转到文件的条目。 I didn't see an option that allows you to do this automatically, like there is in Eclipse, but this menu entry allows you to do it upon request.我没有看到允许您自动执行此操作的选项,就像在 Eclipse 中一样,但是此菜单条目允许您根据要求执行此操作。

[edit]: also working: in the file > right mouse button > select in > projects | [编辑]:也工作:在文件>鼠标右键>选择>项目| files |文件 | classes |课程 | favourites收藏夹

[edit 2]: http://forums.netbeans.org/topic8420.html : This feature is not available till NetBeans IDE 6.5. [编辑 2]: http : //forums.netbeans.org/topic8420.html :此功能在 NetBeans IDE 6.5 之前不可用。 This feature is added in the new version and may be available in NetBeans IDE 7.0M1 and after and you can find it in the View Menu.此功能是在新版本中添加的,可能在 NetBeans IDE 7.0M1 及更高版本中可用,您可以在“视图”菜单中找到它。

导航->在文件或项目中选择

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

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