Ecplise IDE: Is there a way to automatically switch back in perspectives? [duplicate] - eclipse

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.

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 (mouse click)
manual ("Switch Perspective" shortcut CTRL F8)
automatic: Debug Perspective Auto Closer, which supplements bug 46336. (initially reported by zim)
Debug Perspective Auto Closer
Automatically opens previous perspective when debugging ends.
Behaviors: (configurable: Preferences -> Debug Perspective Auto Closer)
[default] when all debug launches have terminated, changes to perspective active on first launch
when any debug launch has terminated, changes to perspective active on that launch
If you want to avoid it switching to Debug in the first place, you can choose "Never" as the option (introduced in Eclipse 3.2 at the time).
(You can find the given Preferences page in Run/Debug > Perspective)
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)
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.

Ctrl + F8, the default shortcut to change views, reduces the pain a bit.

I filed a bug for this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327983

I do not think it's possible to have eclipse switch back automatically but you can do it with the click of a button in the top-right of your window

you would need to write eclipse plugin
here i found example how in plugin switch perspective

As of 2015, this very basix UI woe is not addressed in Eclipse: the official bug report is assigned (but not fixed).
Fortunately, Sven Ramuschkat and Dirk Eismann wrote a plugin for that: the Perspective Switcher Plugin for Eclipse / Flash Builder
the Plugin will now automatically switch back from a Debug perspective to the previous non-Debug perspective as soon as the Debug session is terminated
It works on Eclipse Luna (and above)
Installation
Download the zip file , uncompress and copy the jar file in your eclipse/plugins folder.
Once it's done, you will see a new Preference pane.
Everything is configured for Eclipse to switch back to Java perspective if you have a java or properties file opened when the debugging session ends.

Related

Stop Eclipse from automatically opening the debug perspective when starting server in debugging mode

There are several examples on stack overflow of how to enable/disable the debug perspective from opening when the debugger activates (i.e., hits a breakpoint). This would be achieved by going to:
Preferences -> Run/Debug -> Perspectives -> Open the associated perspective when application suspends
My question is not about this. Whenever I start my server in debug mode, the debug perspective opens. Since I already have the debug view open in my custom perspective, this is not the behavior I want. I've tried editing every option in Preferences -> Run/Debug -> Perspectives, so I know the answer is not there. Does anyone know how to stop this behavior?
I found a simple workaround that obtains the same result. I now use the "Debug" perspective itself as my main perspective. I've customized the "Debug" perspective to look like the custom perspective I used to use. Now this perspective is the only one that is ever open and I can keep the IDE looking like how I want it to look.

Eclipse reverts perspective on startup

Every time I start up Eclipse (Juno SR2), it reverts to the Java EE perspective, regardless of what perspective I was using before. When I add and switch back the the Java perspective, it has also reset all my windows (Search, JUnit etc.), and all my opened files has been closed as well.
We are a few people here who experience the same problems. Does anyone know how to prevent it?
Try setting up your perspective and configure it as you want it, and then select Window > Save Perspective As... Give the perspective a name and press OK.
Then go to Window > Preferences > General > Perspectives
Find your newly saved perspective in the list, select it and then press Make Default.

Console disappear in Eclipse Juno

I am using Eclipse Juno. I was working in Java perspective and suddenly I minimized the console. I don't know where it went but I am unable to get it back. I even tried to get it from Windows>Show View>Console but I didn't get my console back.
It happened the same thing to me. Just click Window->Reset Perspective and everything will be back as it was when you installed eclipse.
Sure you'll have to customize it back to how you like it, but at least you'll have the console back.
If console is not visible, just search for "Console" in QuickAccess box on the right hand top of menu bar. you can get it back!
Stupid Eclipse. Are there no interface designers volunteering on this project? Why minimize something and make it hard to see where to bring it back? Probably all you have to do is hit Shift-Control-Tab-F9 with one hand while right-double-clicking the lower left hand corner. Hmm, how about a popup when you click a minimized Console that says "We see you've minimized your Console and you are clearly trying to switch to it. Would you like us to restore that so you can actually see it?" followed by "Are you really sure? Cuz ya know, you may be using this click path by accident."
The reset perspective works. Also, you can "Save Perspective" so it's not so hard to go back to your preferred Perspective.
Thanks for the tip.
Bring console to the front from Window -> Show View -> Console. Apparently the console remains invisible (that was the issue indeed), but it is virtually active in the foreground.
Close the current view (i.e. the invisible console) by going to the "Quick Access" box at the toolbar, typing "Close Part", and selecting the respective option on the drop-down.
Reopen console form Window -> Show View -> Console and voilà, it will appear. Drag it to your preferred location on the workbench.
This works for me under the following situation:
I had been previously playing with detaching several views (console included) and editors to a separate window on a different monitor; I have updated my workspace from Neon to Oxygen and I have had a hard reset at my computer. (So, not sure which among those was the reason that made it go wrong).
I wanted to avoid resetting my perspective, as it is highly customised, so I discarded that solution.
Other solutions herein proposed had not worked.
The console was working and the view became visible if I chose a different perspective (e.g. Debug) or a duplicate Eclipse window (which effectively provides a duplicate of a factory-reset perspective).
you could click the small icon on the bottom left and choose console. it will appear.

Flash Builder keeps changing perspectives. Need to reset

I have accidentally setup my Flash Builder to change to the Debug Perspective when debugging my applications. This is useful when the application crashes, but not every run.
I can´t seem to find the settings to change it back to default. Anyone know where to look?
Under Window --> Preferences in Run/Debug --> Perspectives there is an option there "Open the associated perspective when an application suspends". The default is "Prompt" which is what will ask you if you want to switch to the Debug Perspective when the application encounters something. Alternatively you could set it to Never which means you will always have to switch perspectives manually.
Cheers

How to change back the perspective after terminating the debugged process in Eclipse?

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.
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 (mouse click)
manual ("Switch Perspective" shortcut CTRL F8)
automatic: Debug Perspective Auto Closer, which supplements bug 46336. (initially reported by zim)
Debug Perspective Auto Closer
Automatically opens previous perspective when debugging ends.
Behaviors: (configurable: Preferences -> Debug Perspective Auto Closer)
[default] when all debug launches have terminated, changes to perspective active on first launch
when any debug launch has terminated, changes to perspective active on that launch
If you want to avoid it switching to Debug in the first place, you can choose "Never" as the option (introduced in Eclipse 3.2 at the time).
(You can find the given Preferences page in Run/Debug > Perspective)
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)
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.
Ctrl + F8, the default shortcut to change views, reduces the pain a bit.
I filed a bug for this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327983
I do not think it's possible to have eclipse switch back automatically but you can do it with the click of a button in the top-right of your window
you would need to write eclipse plugin
here i found example how in plugin switch perspective
As of 2015, this very basix UI woe is not addressed in Eclipse: the official bug report is assigned (but not fixed).
Fortunately, Sven Ramuschkat and Dirk Eismann wrote a plugin for that: the Perspective Switcher Plugin for Eclipse / Flash Builder
the Plugin will now automatically switch back from a Debug perspective to the previous non-Debug perspective as soon as the Debug session is terminated
It works on Eclipse Luna (and above)
Installation
Download the zip file , uncompress and copy the jar file in your eclipse/plugins folder.
Once it's done, you will see a new Preference pane.
Everything is configured for Eclipse to switch back to Java perspective if you have a java or properties file opened when the debugging session ends.