Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » IPartListener lifecycle question
IPartListener lifecycle question [message #330567] Sat, 02 August 2008 23:08 Go to next message
Eclipse UserFriend
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 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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?
>
Previous Topic:Annotatioin Presentation Layer
Next Topic:Running Ruler Action in code
Goto Forum:
  


Current Time: Wed Jul 03 01:26:42 GMT 2024

Powered by FUDForum. Page generated in 0.03889 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top