开发者

Eclipse: shortcut for "open project"?

Is there a shortcut in Eclipse for "open project"? Ideally, I'd like something like the "Open Resource" dialog.

I want this because I have开发者_如何学运维 a "testing" project, which I use whenever I want to try something out… But it's annoying to scroll through the massive Navigator trying to find it and click it when it gets closed.


Not by default. The action is defined here, with no keyboard shortcut.
http://eclipse-tools.sourceforge.net/Keyboard_shortcuts_(3.0).pdf


You could add a Working Set that contains only your test project, and use 'Select Working Set...' functionality from the Navigator tab's view menu:

Eclipse: shortcut for "open project"?

While this won't open the project for you, it WILL make it the only thing you see in navigator or package explorer.

Once you've added it, it will be in a list and you won't need to open the 'Select Working Set...' dialog, just select 'my test project' from the popup menu. It's triggered by that small triangle in the upper right of Navigator, I'm not sure if there is a shortcut.

To switch back to your normal work, simply 'Deselect Working Set' and you will then see everything again.

I also find the 'Collapse All' button/shortcut to be handy when finding things in the Package Explorer or Navigator tabs.


I'll offer a solution to a problem I've had which, if I've interpreted the question correctly, is very similar to yours.

I find that when I have a lot of projects with loads of expanded directories/packages inside Project Explorer, trying to find a particular project is irritating because I have to scroll through all this. I could collapse all projects down but then I also lose my current position in every project.

I'd just like to be able to search for a particular project by name and open it, in the Project Explorer tree. Opening a file inside the project using Open Resource isn't a good enough workaround, as having to think of the name of a file inside that project completely out of context is often equally annoying!

A solution that works great (at least in Eclipse Juno, Mac OSX) is, with the Project Explorer focused, to hold Shift and start typing the project name. This dynamically selects the best matching project in the Explorer as you type. Then with your hands still on the keyboard you can use the arrow keys to open up and browse the project.

It ain't pretty but it gets the job done, and saves some valuable seconds :)


You could also:

  • switch workspace (in a workspace with only this test project in it) (no shortcut: you can define one)
  • install mylyn and select a "test" task (which would immediately empty your Navigator view, leaving only the relevant classes/methods).


If the test project is already opened and you know the name of the class in it, you could go to this class with Navigate -> Open Type (There is a shorcut also, on mac osx is Shift + Command + T)

I find it easier to move with this method, but I didn't know it until someone else showed me, maybe it helps.


You can set a shortcut at Preferences->General->Keys, search for Open Project. However, for me it does not work from the editor itself. I have to click the package explorer, for example. Also, if you have a lot of projects, there will be a huge list of them as well, as expected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜