Bug 300742 - Implement part activation history
Summary: Implement part activation history
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1 M3   Edit
Assignee: Remy Suen CLA
QA Contact: Oleg Besedin CLA
URL:
Whiteboard:
Keywords:
: 320476 (view as bug list)
Depends on: 327366
Blocks:
  Show dependency tree
 
Reported: 2010-01-25 17:22 EST by Remy Suen CLA
Modified: 2010-10-26 09:10 EDT (History)
3 users (show)

See Also:


Attachments
EPartService patch v1 (37.72 KB, patch)
2010-10-05 17:04 EDT, Remy Suen CLA
no flags Details | Diff
EPartService patch v2 (45.99 KB, patch)
2010-10-06 11:28 EDT, Remy Suen CLA
no flags Details | Diff
EPartService patch v3 (45.49 KB, patch)
2010-10-06 13:13 EDT, Remy Suen CLA
no flags Details | Diff
EPartService patch v4 (16.12 KB, patch)
2010-10-07 16:52 EDT, Remy Suen CLA
no flags Details | Diff
EPartService patch v5 (43.66 KB, patch)
2010-10-13 10:30 EDT, Remy Suen CLA
no flags Details | Diff
EPartService patch v6 (53.31 KB, patch)
2010-10-13 14:29 EDT, Remy Suen CLA
no flags Details | Diff
EPartService patch v7 (53.54 KB, patch)
2010-10-13 17:44 EDT, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2010-01-25 17:22:11 EST
I need activation information to merge properly. Information about active parts is in the context and not in the model.
Comment 1 Yves YANG CLA 2010-01-25 18:10:30 EST
It seems e4 Designer needs this information as well.
Comment 2 Remy Suen CLA 2010-01-25 18:13:51 EST
(In reply to comment #1)
> It seems e4 Designer needs this information as well.

What are your use cases for this information, Yves?
Comment 3 Yves YANG CLA 2010-01-25 18:18:29 EST
(In reply to comment #2)
> (In reply to comment #1)
> > It seems e4 Designer needs this information as well.
> 
> What are your use cases for this information, Yves?

In a PerspectiveStack, we need a possibility to switch from one to another. I'm not sure if this information is IEclipseContext or in model. 

In case we can load e4 application in the model of OSGi, we need to show the content of active Part. In PartStack, we need to change the active part.
Comment 4 Remy Suen CLA 2010-01-25 18:23:10 EST
(In reply to comment #3)
> In a PerspectiveStack, we need a possibility to switch from one to another. I'm
> not sure if this information is IEclipseContext or in model. 

You'd have to change the active child and modify the context accordingly. Perhaps this should be in the EPartService, or maybe we need an EWindowService or EPerspectiveService.

> In case we can load e4 application in the model of OSGi, we need to show the
> content of active Part. In PartStack, we need to change the active part.

If you want to just activate another part, I would think you should be able to get around that by just calling EPartService's API directly.
Comment 5 Remy Suen CLA 2010-02-11 11:08:01 EST
(In reply to comment #3)
> In case we can load e4 application in the model of OSGi, we need to show the
> content of active Part. In PartStack, we need to change the active part.

Yves, does the EPartService API work for you? Altering the selected element of a stack should now work properly now that bug 298797 has been fixed.
Comment 6 Remy Suen CLA 2010-10-05 17:04:01 EDT
Created attachment 180288 [details]
EPartService patch v1

Prototype of activation history that's recorded by the EPS based on calls to activate(MPart) and hidePart(*).
Comment 7 Remy Suen CLA 2010-10-06 11:28:56 EDT
Created attachment 180342 [details]
EPartService patch v2

Updated patch so that the activation histories of perspectives are not arbitrarily purged when a part has been hidden in one perspective.
Comment 8 Remy Suen CLA 2010-10-06 13:13:43 EDT
Created attachment 180352 [details]
EPartService patch v3

Updated patch to compensate for the merging of bug 326182's changes.
Comment 9 Remy Suen CLA 2010-10-06 13:15:37 EDT
(In reply to comment #8)
> Created an attachment (id=180352) [details]
> EPartService patch v3

Released to CVS HEAD. Still need tweaks for some cases of perspective switches.
Comment 10 Remy Suen CLA 2010-10-06 13:20:07 EDT
*** Bug 320476 has been marked as a duplicate of this bug. ***
Comment 11 Remy Suen CLA 2010-10-07 16:52:14 EDT
Created attachment 180455 [details]
EPartService patch v4

Preliminary implementation of perspective activation preservation/reconsiderations across perspective switching and the hiding of active parts that are shared (i.e. parts in the shared area).

In 3.x, IWorkbenchPage's setPerspective(IPerspectiveDescriptor) method, oddly enough (or not), will actually activate the workbench window even though it is just a "setter". Not totally sure this makes sense in e4. It seems to me like the activation should be more explicit.
Comment 12 Remy Suen CLA 2010-10-08 08:31:20 EDT
(In reply to comment #11)
> In 3.x, IWorkbenchPage's setPerspective(IPerspectiveDescriptor) method, oddly
> enough (or not), will actually activate the workbench window even though it is
> just a "setter".

Continuing in the spirit of this behaviour, if you have a window A with an active part behind another window B and you ask another part in window A's active part's part stack to be brought to top, window A will get activated.
Comment 13 Remy Suen CLA 2010-10-13 10:30:15 EDT
Created attachment 180770 [details]
EPartService patch v5
Comment 14 Remy Suen CLA 2010-10-13 14:29:48 EDT
Created attachment 180812 [details]
EPartService patch v6

Corrects a problem in the activation candidate calculation that was returning a part under a part stack that wasn't actually the selected element.
Comment 15 Remy Suen CLA 2010-10-13 17:44:06 EDT
Created attachment 180832 [details]
EPartService patch v7

Final patch that is to be released.
Comment 16 Remy Suen CLA 2010-10-13 17:45:04 EDT
(In reply to comment #15)
> Created an attachment (id=180832) [details]
> EPartService patch v7

Patch released to CVS HEAD.

Introduced a new API method into EPartService:
-switchPerspective(MPerspective)
Comment 17 Remy Suen CLA 2010-10-26 09:10:56 EDT
Verified on Windows XP with I20101025-1602.