How to link opened file with project tree in NetBeans

半城伤御伤魂 提交于 2019-11-29 01:42:54

问题


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. Is there a way to do something like this in NetBeans?


回答1:


from 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.

[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. 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.




回答2:


Just thought of adding what ax said:

The keyboard shortcuts in Windows are:

  • Select in Projects : Ctrl+Shift+1
  • Select in Files : Ctrl+Shift+2

The keyboard shortcuts in OS X are:

  • Select in Projects : CMD+Shift+1
  • Select in Files : CMD+Shift+2



回答3:


As described in NetBeans "link with editor" feature, if you want the link to be permanent or persistent, use View | Synchronize Editor with Views. (In NetBeans >= 6.7.1, at least.)



来源:https://stackoverflow.com/questions/590313/how-to-link-opened-file-with-project-tree-in-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!