Project: Eclipse_Platform_UI
Bug 357251 Need a way to activate an appropriate part that is a visible and rendered part of the presentation
Reported: 2011-09-09 11:27:09 | Status: verified fixed

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.

Files changed in fix:
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartActivationHistory.java bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EPartService.java