IPartListener lifecycle question [message #330567] |
Sat, 02 August 2008 23:08  |
Eclipse User |
|
|
|
Originally posted by: no.ddress.now
Specifically, is #getViewReference guaranteed to become valid between
#partOpen and #partActivated, or is using #partActivated just better at
concealing a race condition to when #getViewReference is valid.
Here is the problem: I have a set of Views that all must track and
update based on which other members of the set are open or closed. All
Views init with
getSite().getPage().addPartListener(viewPartListener);
and check on #partOpen and #partClosed for the existing set of Views
getViewSite().getPage().getViewReferences();
On platform start-up, the correct set of ViewReferences is returned
following from the #partOpen event. Yet when views are manually
opened, #partOpen/#getViewReference returns an incorrect set: it omits
the view that is then in the process of being opened.
If I switch to using #partActivated/#getViewReference, the correct set
of ViewReferences *appears* to be returned both on platform start-up
and on manually opening Views. So, can I rely on using #partActivated/
#getViewReference to alway work corrctly?
|
|
|
Re: IPartListener lifecycle question [message #330683 is a reply to message #330567] |
Fri, 08 August 2008 12:27  |
Eclipse User |
|
|
|
Gerald Rosenberg wrote:
> Specifically, is #getViewReference guaranteed to become valid between
> #partOpen and #partActivated, or is using #partActivated just better at
> concealing a race condition to when #getViewReference is valid.
>
> Here is the problem: I have a set of Views that all must track and
> update based on which other members of the set are open or closed. All
> Views init with
>
> getSite().getPage().addPartListener(viewPartListener);
>
> and check on #partOpen and #partClosed for the existing set of Views
>
> getViewSite().getPage().getViewReferences();
>
> On platform start-up, the correct set of ViewReferences is returned
> following from the #partOpen event. Yet when views are manually
> opened, #partOpen/#getViewReference returns an incorrect set: it omits
> the view that is then in the process of being opened.
>
That might be a bug worth reporting.
Dani
> If I switch to using #partActivated/#getViewReference, the correct set
> of ViewReferences *appears* to be returned both on platform start-up
> and on manually opening Views. So, can I rely on using #partActivated/
> #getViewReference to alway work corrctly?
>
|
|
|
Powered by
FUDForum. Page generated in 0.04273 seconds