Bug 166644 - [context] activating task should restore multiple editor configuration, including split editor layout
Summary: [context] activating task should restore multiple editor configuration, inclu...
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 enhancement with 10 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
: 230164 244075 341681 345795 367995 (view as bug list)
Depends on: 145876 401744
Blocks:
  Show dependency tree
 
Reported: 2006-12-04 10:47 EST by Dennis Ballance CLA
Modified: 2017-01-28 03:29 EST (History)
15 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Ballance CLA 2006-12-04 10:47:49 EST
Build ID: M20060629-1905

Steps To Reproduce:
1. Activate a task.
2. Open two files for editing.
3. Drag one file to the right, creating two adjacent editor windows within the one workspace.
4. Deactivate the task. (Both windows should close.)
5. Reactivate the task. Both editors re-open, but as tabs in a single editor window.


More information:
I often have a specific layout I want to use for a set of files, and it would be really great if they could be restored in the same layout. Thanks!
Comment 1 Eugene Kuleshov CLA 2006-12-04 11:00:04 EST
Why limit this to editors only? It should restore views as well as the size of each area in the layout.
Comment 2 Mik Kersten CLA 2006-12-05 00:10:43 EST
Views are restored via perspective management (Context prefs page).  Disabled by default, but I always leave that turned on.

The problem is that Eclipse perspectives do not remember that editors are split, which is why switching perspectives will not unsplit an editor, and why closing an editor that is in the split will make the split go away.  That said it would be nice for us to provide this at some point even if Eclipse doesn't give this to us for free via pespectives.  However, notably memento-based restore of editors (e.g. on workbench restart) does preserve this.
Comment 3 Eugene Kuleshov CLA 2006-12-05 00:28:05 EST
Are you saying that with this feature enabled, if one of the tasks has Search view on Java perspective and another does not, Search view and perspective layout for Java perspective will be restored accordingly when those tasks activated?
Comment 4 Andreas Deimer CLA 2007-01-23 08:04:15 EST
This would be a great enhancement!

As for the aspect of restoring the complete perspective per task, I would recommend to make it at least configurable. Most of the time, my perspectives evolve (to the better, hopefully) over time, which would make it a pain to work with older ones that are automatically restored when re-opening a task.

Thanks for now
Andreas

Comment 5 Mik Kersten CLA 2007-06-26 19:44:22 EDT
Tentatively scheduling for 3.0.  Still not clear whether Platform supports this.
Comment 6 Mik Kersten CLA 2008-05-14 19:55:43 EDT
*** Bug 230164 has been marked as a duplicate of this bug. ***
Comment 7 Mik Kersten CLA 2009-02-26 20:11:14 EST
Not a current priority, but this would be a great contribution.
Comment 8 Mik Kersten CLA 2010-04-15 13:52:29 EDT
The workbench has support for restoring split editors on restart, so this could be a straightforward contribution.
Comment 9 Steffen Pingel CLA 2011-04-01 21:50:39 EDT
*** Bug 341681 has been marked as a duplicate of this bug. ***
Comment 10 tsailipu CLA 2011-04-01 22:17:42 EDT
+1.  Didn't know this is such an old bug.  It's sorely missed.  I wonder how come the community hasn't complained this much - are most of them not serious developers that have multiple tab groups/windows split to manage tabs?  ;)   This has been such a friction for me to use Mylyn that much.  I consider Mylyn to Eclipse like what SessionManager is to Firefox; but this behavior (or lack of feature) is quite deficient and annoying.

Thanks otherwise for the great work.
Comment 11 Steffen Pingel CLA 2011-05-14 08:44:16 EDT
*** Bug 345795 has been marked as a duplicate of this bug. ***
Comment 12 Steffen Pingel CLA 2012-01-05 18:58:23 EST
*** Bug 367995 has been marked as a duplicate of this bug. ***
Comment 13 Vadim Goncharov CLA 2012-01-29 16:00:13 EST
Guys, do we have any hope to fix this bug in near future?
Comment 14 Steffen Pingel CLA 2012-02-01 20:43:03 EST
Unfortunately we won't be able to address this enhancement in the short term due to a lack of capacity. We'd be happy to support resolving this through a contribution though if anyone was willing to provide a patch. 

Considering that Eclipse 4.2 has a model based workbench it may actually be much easier now to add this functionality assuming it would be sufficient that it was available on 4.2 only.
Comment 15 Glenview Jeff CLA 2012-02-03 08:50:15 EST
Please reclassify this as a defect.  The current behavior is destructive and I don't see how destroying work without warning can be considered acceptable application behavior.  

Often I'll arrange five or more windows into different panes with different areas of the code showing.  If I click on another task either accidentally or without remembering that Eclipse will destroy all of my work, it could take a non-trivial amount of time to restore the views, especially to scroll each pane to the correct line in the code that I was reviewing.
Comment 16 Steffen Pingel CLA 2012-02-03 11:27:49 EST
To avoid any kind of destructive behavior you can disable editor restore in the preferences under Mylyn > Context > Editors by disabling "Manage open editors to match task context".
Comment 17 Glenview Jeff CLA 2012-02-03 11:34:41 EST
@Steffen, isn't this then entirely disabling the (defective) feature?  Please reclassify it as a defect.
Comment 18 Sam Davis CLA 2012-02-03 11:35:08 EST
(In reply to comment #15)
> Please reclassify this as a defect.  The current behavior is destructive and I
> don't see how destroying work without warning can be considered acceptable
> application behavior.

I don't know if I see it that way. After all, File > Close All does exactly the same thing. In fact, there's no case that I'm aware of in Eclipse where you can close and reopen an editor and have it automatically be positioned in the same place, so if Mylyn were to provide such a feature, well, I would see it as a feature. Eclipse just doesn't have great support for having multiple editors open side by side, unfortunately. I'm pretty sure there is no API in 3.x for producing such a layout, and the only way to do it would be to simulate drag events....
Comment 19 Glenview Jeff CLA 2012-02-03 11:51:28 EST
>I don't know if I see it that way. After all, File > Close All does exactly the
>same thing. 

True, but I don't see switching contexts as an expected destructive behavior in the same way "close all" is expected to do so.

>In fact, there's no case that I'm aware of in Eclipse where you can
>close and reopen an editor and have it automatically be positioned in the same
>place ... I'm pretty sure there is no API in 3.x for producing such a layout

This was covered somewhere in one of the duplicates of this issue; that Eclipse does in fact have this capability already implemented--that when you exit Eclipse and reopen the same workspace, the editor splits are correctly preserved and restored.
Comment 20 Sam Davis CLA 2012-02-03 12:00:27 EST
(In reply to comment #19)
> 
> This was covered somewhere in one of the duplicates of this issue; that Eclipse
> does in fact have this capability already implemented--that when you exit
> Eclipse and reopen the same workspace, the editor splits are correctly preserved
> and restored.

Well, clearly Eclipse has the ability to produce these layouts, since it does so when you drag editors around, but that doesn't mean there is an API that makes it possible for plugins to do it too.
Comment 21 Glenview Jeff CLA 2012-08-10 11:13:53 EDT
Please forgive the reiteration of my request to change this from an enhancement to a defect, as it's a destructive behavior.  No reasonable user would ever request that split windows be permanently lost upon switching contexts back and forth.  This is not at all analogous to someone using the "close all" feature, which is already by nature a destructive operation.

However difficult it is to fix and lack of API support for its implementation doesn't make it an enhancement request.  Also, here's some information a stack overflow user provided that might be of help:

Open editors and UI settings are kept in <WS>/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml path, in great part. As you can see it's kept in a place independent of the installed plugins, so you can even restore the layout when there are no plugins responsible for opened editors (it happens to me often, as I share one workspace between many Eclipse configuration).

Skimming through the Eclipse sources, I see this file being accessed from org.eclipse.ui.internal.Workbench, in restoreState() (reading) and in recordWorkbenchState()+saveMementoToFile() (writing). So reproducing this functionality in a separate plugin and reading/writing to a different (profile) file should be enough for basic usage.
Comment 22 Sam Davis CLA 2012-10-10 19:45:43 EDT
*** Bug 244075 has been marked as a duplicate of this bug. ***
Comment 23 Mitchell Hall CLA 2013-02-10 23:24:31 EST
Any progress on this?  This would make my life so much easier.

It's been in the pipeline for years and who cares whether it's a defect or an enhancement, I just want to see it working.
Comment 24 Dennis Ding CLA 2016-07-08 14:35:13 EDT
Any progress on this bug?  I started using Mylyn recently and this bug is impeding my workflow especially when context/task switching often.  Because of this I'm not sure if I can recommend it to other co-workers because I know they all use split windows/editors all the time.

Thanks for the otherwise excellent work!
Comment 25 Sam Davis CLA 2016-07-08 16:00:41 EDT
We are not looking into this currently but the bug has been marked helpwanted to indicate that we would be happy to support a community contribution to resolve it.
Comment 26 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn