Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341010 - "Reset Perspective" will not restore view that was dragged into editor area
Summary: "Reset Perspective" will not restore view that was dragged into editor area
Status: RESOLVED WORKSFORME
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-25 17:28 EDT by Eugene Ostroukhov CLA
Modified: 2019-06-05 07:44 EDT (History)
4 users (show)

See Also:


Attachments
Patch to remove views from the shared area on a perspective reset (12.05 KB, patch)
2011-05-04 10:35 EDT, Eric Moffatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Ostroukhov CLA 2011-03-25 17:28:37 EDT
1. Start e4 SDK and open Java perspective.
2. Drag the outline into editor area (i.e. put it to the right of the editor but in the editor area).
3. Do "Reset Perspective..."
4. Notice that Outline was not restored to its original position.
5. Drag Outline out of the editor area (i.e. put it to left of the Package Explorer)
6. Click "Reset Perspective..."

Outline is restored to its original position.
Comment 1 Remy Suen CLA 2011-03-26 13:45:14 EDT
This is the expected behaviour.
Comment 2 Eric Moffatt CLA 2011-05-04 10:35:12 EDT
Created attachment 194720 [details]
Patch to remove views from the shared area on a perspective reset


This is necessary as there is currently no way to restore the perspective to its original state. The main logic change was to set the MPlaceholder to have TBR == false (rather than removing it). This allows the reset in Perspective 'A' to remove a view in the shared area but still allows the view to be re-opened in perspective 'B' in its correct location.

Also changes the logic in 'findPlaceholderFor' to explicitly check whether there are two MPlaceholders for a Part and, if so, choose the one in the shared area.
Comment 3 Eric Moffatt CLA 2011-05-04 10:44:10 EDT
Committed in >20110504. Applied the patch.

There are still a number of edge conditions which are not well handled but at least you can always get a perspective back to a clean state with a 'reset'.

One of the edges is:

Have two perspectives 'A' and 'B' both showing part "P".
In 'A' drag P into the shared area (B's placeholder for P is hidden)
Switch to B and drag P into a perspective stack, now there's two placeholders for P, both in the perspective.

A deeper one is:

In the Java perspective drag the 'left' *stack* into the shared area.
Drag an editor into the stack
Reset

In this case we end up with two stacks with the id 'left'. Note that if there's no editor in the 'left' stack in the shared area then the reset will end up removing it (because it'll go empty once all of its placeholders are removed).
Comment 4 Remy Suen CLA 2011-06-14 12:25:42 EDT
(In reply to comment #2)
> Created attachment 194720 [details]
> Patch to remove views from the shared area on a perspective reset

This patch has introduced a regression, see bug 349331.
Comment 5 Christoph Keimel CLA 2011-07-18 11:39:56 EDT
Can the "Reset Perspective" be called in an e4-Application? Where is the API?
Comment 6 Remy Suen CLA 2011-07-18 11:41:17 EDT
(In reply to comment #5)
> Can the "Reset Perspective" be called in an e4-Application? Where is the API?

No, that API isn't there. You could theoretically model this I suppose.
Comment 7 Eclipse Genie CLA 2018-10-02 14:42:49 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 8 Lars Vogel CLA 2019-06-05 07:44:24 EDT
This is a mass change to close all e4 bugs marked with "stalebug" whiteboard.

If this bug is still valid, please reopen and remove the "stalebug" keyword.