views:

267

answers:

4

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.

A: 

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

Robert Greiner
awesome, thanks.
David Wolever
Except… I've assigned it a shortcut and it doesn't seem to do anything. Ie, I hit the shortcut and nothing happens.
David Wolever
I've just edited my post with the same observation... seems that you must select the package explorer
YuppieNetworking
A: 

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.

YuppieNetworking
Yea, that's how I normally do it… But sometimes the project is closed (eg, because I've done a "close all unrelated").
David Wolever
A: 

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).
VonC
Hhmm… Interesting idea with mylin. Unfortunately it won't work for me, though: activating the task won't open project for me (it just pulls up an editor saying "The resource /Test/… is unavailable".
David Wolever
+1  A: 

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:

alt text

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.

Joshua McKinnon
Ah, that's a good idea - thanks.
David Wolever