Communicating between Views [message #33389] |
Thu, 15 May 2003 12:01  |
Eclipse User |
|
|
|
Originally posted by: george.hetrick.hp.com
The Java perspective has Views that update in response to changes in other
Views -- for example, switching editors causes the Outline View and the
Package Explorer to update themselves.
What are the Views listening for, and when do they establish themselves as
listeners? I'd expect that they might be using
getSite().setSelectionProvider()
and
getSite().getSelectionProvider().addSelectionChangedListener ()
but I always get a null back from getSite().getSelectionProvider(), so I
haven't figured out how to control the order of things in different Views.
Pointing me towards the appropriate source would be fine.
|
|
|
|
|
|
|
|
Re: Communicating between Views [message #35159 is a reply to message #34330] |
Fri, 16 May 2003 04:57  |
Eclipse User |
|
|
|
Originally posted by: anthony.saucet.freesbee.fr
It's a interesting thread and I try to do the same with a simple view.
I'm quite newbie in eclipse and java, and don't really know where to seek
the right classes and don't really know what happens during a view
lifecycle.
Is there a tutorial on this? Or does anybody could explain to me?
If I want to update a simple view (not viewer or special view like the
outline one) containing only SWT things (layout, combos, texts, labels),
what do I have to implement to have my view automatically updated to have
the combos, texts and labels displaying new info?
many thx for helping me, I'm a bit lost.
anthony
Knut Radloff wrote:
> "George Hetrick" <george.hetrick@hp.com> wrote in message
news:ba0i8s$kop$1@rogue.oti.com...
> > I think I see now -- each of my Views that wants to respond to editor
> > changes establishes a PartListener on the Page. And my Outline View wants
> Yes, when you register an IPartListener you get a partActivated and
partDeactivated notification when editors are switched.
> > to create itself as a PageBookView, so it doesn't need to regenerate its
> > tree when different editors come up. DOes that sound correct?
> It should be sufficient if you create a
ContentOutlinePage/IContentOutlinePage. You don't have to create a
PageBookView. The default
> outline view is a PageBookView and you don't really want to reimplement
that. The beauty of the content outliner is that you can
> just plug in your own page.
> Each editor has its own IContentOutlinePage. The outline view caches the
pages of any editors that are activated so they aren't
> recreated constantly when you switch editors.
> Have a look at the readme example (org.eclipse.ui.examples.readmetool). It
implements an outline page. You will also find many other
> uses of the outliner if you search for references to IContentOutlinePage in
the Eclipse code base.
> Knut
|
|
|
Powered by
FUDForum. Page generated in 0.08798 seconds