Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 307217

Summary: No part visibility events fired on startup
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: emoffatt, pablo.gomez
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Remy Suen CLA 2010-03-26 12:51:59 EDT
The current implementation only fires visibility notifications when the 'selectedElement' feature changes. This is not good enough on application startup.
Comment 1 Eric Moffatt CLA 2010-03-26 14:18:14 EDT
Remy I have code already in the LazyStackRenderer that can produce a list of all elements that are exposed/hidden by a change in a stack's selectedElement. Right now it simply gathers the list of the elements, we should get together and decide on what the event I should throw would look like.
Comment 2 Eric Moffatt CLA 2010-06-21 10:09:12 EDT
Remy, is there a more generic version of this defect open some place ?
Comment 3 Remy Suen CLA 2010-06-21 10:10:33 EDT
(In reply to comment #2)
> Remy, is there a more generic version of this defect open some place ?

Mm, don't think so.
Comment 4 Pablo Gomez CLA 2014-04-08 08:58:50 EDT
I was about to fire a bug regarding this, so I just add my description here:

We are working with the IPartListener interface to manage the life cycle of our parts. It works nicely almost in all cases yet the first time when the application is opened.

public interface IPartListener {

	public void partActivated(MPart part);

	public void partBroughtToTop(MPart part);

	public void partDeactivated(MPart part);

	public void partHidden(MPart part);

	public void partVisible(MPart part);

}

We would expect, a Visibility event and perhaps brought to top when the part is created and displayed but this is not happening.
 The problem we see is that in order to fire these events the PartServiceImpl.java is subscribing itself to 	

eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, selectedHandler);


So the problem we have the first time the application is launched is that there is no TOPIC_SELECTEDELEMENT event and therefore there is no fireVisibility nor brought to top events fired even though there is a part visible and on top.



This problem is reproduceable by a simple e4 application with a PartStack and 2 parts. Assuming that we have in the model the part1 as selected in the partstack. Then when the application is launched the PartListener does not receive any event. When we click on the next tab, "Part2", the hidden event for part1 as well as deactivation plus visibility, brought to top and activation for part2 are fired.
Comment 5 Paul Webster CLA 2014-04-09 13:26:54 EDT
(In reply to Pablo Gomez from comment #4)
> I was about to fire a bug regarding this, so I just add my description here:

What version are you seeing this on?

PW
Comment 6 Pablo Gomez CLA 2014-04-09 13:34:14 EDT
(In reply to Paul Webster from comment #5)
> (In reply to Pablo Gomez from comment #4)
> > I was about to fire a bug regarding this, so I just add my description here:
> 
> What version are you seeing this on?
> 
> PW

Kepler SR2
Comment 7 Eclipse Genie CLA 2020-05-24 16:49:59 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.