Community
Participate
Working Groups
From the newsgroup posting "Re: Working sets and multiple windows( was:Navigator view)": "...I saw that the proposal is for working sets to replace workbench page inputs. I'm waiting impatiently for that one, not being able to use working sets for page inputs is one the two reasons I don't like opening multiple windows in Eclipse. "The other one is that if you close a window, you lose all your perspective customizations unless you saved them first. I do this a lot, especially when I want to exit Eclipse but close the active window instead of using File > Exit. Autosaving perspectives seems like a solution, but I suspect it has its own set of problems. Are there any plans to make this better? "Failing that, I'd want the option to not share editors between perspectives in a window, I think bug 11001 requests this feature."
This would be a great enhancement. Any chance you can implement this for us Cagatay?
Which one, automatically saving dirty perspectives or not sharing editors between perspectives? I was already planning a patch to improve editor management, it's on top of my list of things to do. I'm not quite sure what the best UI for auto-saving perspectives is. If the problem is losing perspective layout when closing workbench windows, maybe a quick-and-dirty solution is to give an option to restore the most recently closed window (or keep a MRU list of closed windows). On second thought, this seems a good solution, not just a quick-and-dirty one. I've grown to like saving perspectives in the meantime, and it seems a step back to just auto-save them every time they change in any window. I think it's better to keep saved perspectives under user control.
New users do complain about the current behavior. Once they become proficient (like yourself) they often stop complaining but the initial behavior is suprising. It is also very subtle the situations in which the user needs to overwrite the existing perspective or define a new one. What I would like to see is that perspective chagens do not require an explicit save perspective and the reset action restores the perspective to it's original state. I am not a fan of the "do not share editors between perspectives" option.
Kevin, When you say Reset Perspective restores the perspective to its "original" state, do you mean the initial default state? For example: 1) Open perspective A. 2) Change layout of perspective A. 3) Close perspective A (layout automatically saved for you as requested by bug report). 4) Open perspective A (layout as it was in Step 2). 5) Change layout of perspective A. 6) Reset Perspective A. Should the perspective be reset to the layout in Step 1 or the layout in Step 2?
From KH: Step 1. If perspective changes are eagerly persisted then the only other choice for the reset in step 6 would be to restore the perspective to the state saved in step 5 which does not seem to add much value. (ie. this behavior for reset perspective is useless?) If you are working on perspective enhancements can you also make sure that the perspective changes are persisted in preference files. This is required for the import/export of preferences to work.
Kevin, one more clarification. In the Save Perspective As... scenario, I assume you would want Reset Perspective to work as follows: 1. Open Perspective A. 2. Change layout of Perspective A. 3. Save Perspective A as Perspective B. 4. Change layout of Perspective B. 5. Reset Perspective B. ==> Changed to the layout in Step 3.
On above, yes from KH - reset to layout in Step 3. Also need to consider New Window. This should open the new perspective as it is, not as it's default.
Opened [Bug 25270] [Perspectives] Saving perspective layout via export preferences for save layout as preference data request.
Instead of saving on every layout change, which is a complex solution, investigated automatically saving the layout when a perspective is closed. Changed code to automatically save the perspective layout whenever a perspective is closed or when a New Window is closed (i.e., all perspectives on the new window will have their layouts saved). The last saved layout wins in the case where multiple instances of the same perspective exist (e.g., when you have more than one workbench window opened). In the user-defined case, I needed to save the "original" layout in order to handle the Reset Perspective case as KH indicated above. When you "Save Perspective As" (and you are not overwriting an existing perspective) the original layout will be set to the layout as it is (i.e., as it is when the Save Perspective As is executed) and when one says "Reset Perspective", this original layout will be restored. For user-defined layouts that exist in old workspaces, the layout that exists upon load (i.e., starting of workspace) will become the original layout for the perspective. Approach generally works and was straightforward to implement, but feedback was that automatically saving perspective layouts in the the multiple window case is confusing since you could have two completely different layouts for the same perspective. It was decided that the explicit "Save As..." capability is more explicit, so marking this as WONTFIX. Related to this report is whether or not New Window should clone the layout of the active perspective (currently the action opens a New Window with the current perspective in it's default.original layout). Will open a separate bug report for this.
Some additional notes from NE on the save immediately approach: Actually, it was the crash scenario I had in mind when I suggested saving immediately. However, I've come across another while trying out the patch: 1. change resource perspective (I opened the Properties view as a regular view, and the CVS Repositories view as a fast view, and changed some of the pane sizes) 2. Window / New Window 3. the new window does not have the changes If you close and reopen the perspective after 1, it works. Also, "The last saved layout wins in the case where multiple instances of the same perspective exist " results in an indeterminate order. If you save right away, then the order is predictable and reasonable: it saves the last change the user made. We could change it to save the current perspective when you choose Window / New Window. However, since we allow windows and perspectives to be opened programmatically, in general we have no way of ensuring that any current perspective state is saved before opening a new one. The safest thing to do would be to save immediately. Saving automatically (regardless of when we do the save) seems to be pretty confusing if you have multiple windows with the same perspectives. I may choose to arrange them completely differently, but only one arrangement gets persisted. If I open another one, which layout do I get?
Opened [Bug 25742] for New Window behavior.
Created attachment 2315 [details] code changes Code for changes that were investigated. Code roughly based on 20021105 build of org.eclipse.ui.workbench.
*** Bug 6752 has been marked as a duplicate of this bug. ***
see Bug 9974 [Perspectives] Perspective customization : (save customize actionset)
Why not make this a preference? I think the common user (w/ one monitor) has just one Eclipse Window open ... so the "perceived" problem does not happen to them ... rather they loose their perspective setup.
Multiple instances are not unique to the perspective problem. Every single view in Eclipse can exist multiple times, yet the preference changes made are immediately persisted and used the next time the view is (re)created. For example: - The split pane orientation in the variables view - Filters in the Package Explorer - Sorting/Filters in the Problems View - Synchronize settings (Need to open a bug, they only save lazily when the view is closed) > If I open another one, which layout do I get? The same question is valid for Views (replace "layout" with filter, sort order, visibilty of static fields, etc. etc.), so why is the answer different here? See also bug 9974
There are currently no plans to work on this feature. PW
Changes requested on bug 193523
*** Bug 352206 has been marked as a duplicate of this bug. ***
*** Bug 457510 has been marked as a duplicate of this bug. ***
I guess before too many things were discussion, nothing was done. from Bug 457510 - [New Window] After starting second IDE window and closing the first all perspective customizations are lost Please add warning when closing the second Window and the first is still open. Or better warn and suggest to close nicely like "Closing window after other windows were opened will reset perspective to last closed Window" [Cancel] [Exist and keep customization] [Close this window] So just dialog on closing would help.