Monday, March 28, 2011

In Eclipse, how do I change perspectives after terminating a process?

So Eclipse by default automatically switches to the Debug perspective when you hit a breakpoint. However, it is annoying me that it doesn't automatically switch back to the previous perspective (say, Java) when terminating the process. It just stays in the debug perspective even though there is nothing to debug because nothing is running.

Is this possible?

From stackoverflow
  • you would need to write eclipse plugin

    here i found example how in plugin switch perspective

    helifreak : I am surprised that such a fundamental user interaction is missing from what is supposedly the worlds most used IDE.
  • To complete mark's answer, that option tells Eclipse when to switch to the associated perspective upon program suspension - meaning when a breakpoint is hit, it will switch to Debug perspective.

    Switching back to another perspective after you're done debugging has to be manual

    alt text

    If you want to avoid it switching to Debug in the first place, you can choose "Never" as the option.

    alt text

    If you want to switch back in the situation where the debugged program terminates normally (Not when you want to stop debugging it yourself), you may hope Eclipse figures out that your program terminates normally and switch to a "default" perspective at that time...

    However, there is no notion of "default" perspective, so how would Eclipse knows which one to switch to ? (the "Preferences/Perspectives/Make default" is only for the "Open Perspective" dialog, but that may not be the same perspective than the one you actually want to switch back to after a debug)

    alt text

    Also, should Eclipse closes the Debug perspective or just changes to a different one ?
    What if there is more than one program running -- when one terminates, you might still be interested in debugging the other one, or maybe not.

    The point is, the decision about when to change perspective (and what perspective to change to) is not reasonable for the machine to make -- it requires a person knowing what he wants to do next.

    Joe Ludwig : I agree with everything but "is not reasonable for the machine to make ". Visual Studio does a fine job by returning to the main view when there are no processes left to debug.
    VonC : @Joe Ludwig: agreed. Eclipse may be victim of its own complexity, tricking itself into *not* offering this feature.
    VonC : @Joe Ludwig: btw, sorry: I did not play at Pirate: I am not so much into MMO... Right now, I play GTAIV (solo) ;)
    helifreak : I think the appropriate solution would be to switch back to the previous perspective that I was in before the debug perspective, if all debug sessions have ended. As Joe mentioned, Visual Studio, and all other IDEs i've used do this by default.
  • I filed a bug for this:

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=327983

0 comments:

Post a Comment