Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357251 - Need a way to activate an appropriate part that is a visible and rendered part of the presentation
Summary: Need a way to activate an appropriate part that is a visible and rendered par...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.2 M3   Edit
Assignee: Dean Roberts CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340875
  Show dependency tree
 
Reported: 2011-09-09 11:27 EDT by Dean Roberts CLA
Modified: 2011-10-26 14:56 EDT (History)
1 user (show)

See Also:


Attachments
Change to scope requestActivation to parts in the presentation (2.50 KB, patch)
2011-09-09 15:14 EDT, Dean Roberts CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Roberts CLA 2011-09-09 11:27:09 EDT
EPartService needs either a deactivate() method OR API for accessing the activation history.  I believe a deactivate() method makes more sense.

As part of the work on Fast Views, I have a use case where I need to deactivate the currently active part.  In such an event, an appropriate part from the activation history should be activated.

I could accomplish this by either calling a deactivate method on the part service, and count on it activating an appropriate part from the activation history, or I could query the part service for its activation history, find an appropriate part to activate, and call activatePart on it.

I think from an API point of view, a deactivate() method makes more sense than exposing the activation history in the part service.

I propose that the history selection algorithm be the same one used by hidePart.

There is an open question as to what happens when you deactivate() a part that is not active.  Clearly this is a no-op, but should the activation history be modified or not.  Whichever decision is made, I believe hidePart() should behave the same way.

Currently I believe hidePart() will attempt to remove a part from the activation history, even if the part is currently hidden.
Comment 1 Dean Roberts CLA 2011-09-09 15:06:25 EDT
After more discussion it seems this API will not give me all of what I need, and the parts it does give me are trivial and nobody else would need this API anyhow.

Instead, we might achieve our desired results with a small change to the existing requestActivation() API.

Currently this API will do nothing if the currently active part is in the windows part list, regardless of whether the active part is in the presentation or not.

Since the fast view part stacks are never in the presentation, and arguably it does not make sense to activate a part that is not in the presentation fixing this API to only consider parts that are in the presentation will work and is likely more correct.

Interestingly, the code that looks for a candidate in the activation history already only considers visible and rendered parts in the presentation.  It is simply that the activation history is never consulted in cases where the currently active part is any part in the window.
Comment 2 Dean Roberts CLA 2011-09-09 15:14:33 EDT
Created attachment 203087 [details]
Change to scope requestActivation to parts in the presentation
Comment 3 Eric Moffatt CLA 2011-09-21 10:35:08 EDT
Pushed in >20110921.

commit a3384757e11ae898cac097a6fae7636dc94d99ac
Comment 4 Dean Roberts CLA 2011-10-26 14:56:38 EDT
Verified on I20111014-1625