Activation and deactivation of editors [message #448303] |
Thu, 20 April 2006 15:54  |
Eclipse User |
|
|
|
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 04:45  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03689 seconds