简体   繁体   中英

Eclipse - is it possible to jump to a particular package?

Say i'm looking at some file, and i'd like to see if there are similar files in a different package. I don't really know what the different files might be called - they were coded by different people, so could well be named differently.

I do know they're probably in a package of roughly the same name - for example, if i'm looking at a file in the com.sandwiches.ham.artisan package, and i think there should be a similar (although, in this case, sadly unrelated) file in the com.sandwiches.avocado.artisan package, what is the fastest way to jump to said package and check it out?

I'm fed up of scrolling through reams of artisan sanwiches, its making me hungry.

Well, no matter what, you are going to have to do some typing. There is a Go-to navigation item for packages, its just not bound to any quick keys. To bind it to a key combination of your choice, do the following:

Eclipse->Preferences, and type in Keys as your filter.

Eclipse首选项 - 键绑定

Search for the Go To Package command, click on the Binding entry field, and type whatever keys you want to use for the keybindings (in my screenshot I have it set to Command-Shift-0). Then click OK to save and close the preferences dialog.

After that, typing your chosen key bindings will bring up a package explorer that lets you type in whatever package you want and navigate to it.

在此输入图像描述

从Breadcrumb(按Alt+Shift+B打开它)可以快速浏览三明治菜单,我的意思是包装结构......

Ctrl + Shift + R是一个很好的快捷方式,可以在您的proyects中的每个包中找到文件,我每次都使用它...希望它有帮助......

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