Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Activation and deactivation of editors
Activation and deactivation of editors [message #448303] Thu, 20 April 2006 19:54 Go to next message
Lukas Zapletal is currently offline Lukas ZapletalFriend
Messages: 44
Registered: July 2009
Member
Hello,

I have sevral views and editors, its a standard thing. Editors got
opened/closed, activated and deactivated. Views shows some information
from these editors.

All my views implement IPartListener to see when user change editor.
The view needs to reload the data from the activated editor. This works
(but is this a good way to do it?)

Now the problem - when user closes one editor, the methods from
IPartListener are called in strange order:

one of the remaining editors got activated
the editor got closed

Shoudnt it be - closed, then activated?

My implementation of IPartListener is:

activated - load the data from the current editor
closed - clear the view

In the order I mentoined this couldnt work... :-(

--
Best regards,
Lukas Zapletal
Re: Activation and deactivation of editors [message #448357 is a reply to message #448303] Fri, 21 April 2006 19:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: msullivan.nmss.com

I'd imagine that the order you are seeing is done so that there is never a
'current editor' that is closed. That is, you switch anyone listening to
the current editor to a new editor before closing the one they are listening
on.

Perhaps you could change your code to only clear the view if the editor
being closed is the current editor?

Or just ignore the close event all together and just look at the change
events?

"Lukas Zapletal" <lukas.zapletal@linuxexpres.cz> wrote in message
news:20060420215442.99bb3a4b.lukas.zapletal@linuxexpres.cz...
> Hello,
>
> I have sevral views and editors, its a standard thing. Editors got
> opened/closed, activated and deactivated. Views shows some information
> from these editors.
>
> All my views implement IPartListener to see when user change editor.
> The view needs to reload the data from the activated editor. This works
> (but is this a good way to do it?)
>
> Now the problem - when user closes one editor, the methods from
> IPartListener are called in strange order:
>
> one of the remaining editors got activated
> the editor got closed
>
> Shoudnt it be - closed, then activated?
>
> My implementation of IPartListener is:
>
> activated - load the data from the current editor
> closed - clear the view
>
> In the order I mentoined this couldnt work... :-(
>
> --
> Best regards,
> Lukas Zapletal
Re: Activation and deactivation of editors [message #448359 is a reply to message #448357] Sat, 22 April 2006 08:45 Go to previous message
Alexander Karnstedt is currently offline Alexander KarnstedtFriend
Messages: 68
Registered: July 2009
Member
Another option could be to extend your view from PageBookView - like the
Outline View from the IDE.

The PageBookView does all the tricky IPartListener stuff so you don't have
to care.

Alex

"Mike Sullivan" <msullivan@nmss.com> schrieb im Newsbeitrag
news:e2bcuu$9dd$1@utils.eclipse.org...
> I'd imagine that the order you are seeing is done so that there is never a
> 'current editor' that is closed. That is, you switch anyone listening to
> the current editor to a new editor before closing the one they are
listening
> on.
>
> Perhaps you could change your code to only clear the view if the editor
> being closed is the current editor?
>
> Or just ignore the close event all together and just look at the change
> events?
>
> "Lukas Zapletal" <lukas.zapletal@linuxexpres.cz> wrote in message
> news:20060420215442.99bb3a4b.lukas.zapletal@linuxexpres.cz...
> > Hello,
> >
> > I have sevral views and editors, its a standard thing. Editors got
> > opened/closed, activated and deactivated. Views shows some information
> > from these editors.
> >
> > All my views implement IPartListener to see when user change editor.
> > The view needs to reload the data from the activated editor. This works
> > (but is this a good way to do it?)
> >
> > Now the problem - when user closes one editor, the methods from
> > IPartListener are called in strange order:
> >
> > one of the remaining editors got activated
> > the editor got closed
> >
> > Shoudnt it be - closed, then activated?
> >
> > My implementation of IPartListener is:
> >
> > activated - load the data from the current editor
> > closed - clear the view
> >
> > In the order I mentoined this couldnt work... :-(
> >
> > --
> > Best regards,
> > Lukas Zapletal
>
>
Previous Topic:How to open an editor in createInitialLayout
Next Topic:Intro as plugin
Goto Forum:
  


Current Time: Mon Nov 11 18:24:50 GMT 2024

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

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

Back to the top