[Views] Communication between views. [message #75411] |
Mon, 16 June 2003 09:16  |
Eclipse User |
|
|
|
Hi,
I am having couple of views with treeViewers. I want to pass the selection
of treeviewer in one view to the other view. Anybody have any idea abt it.
(I want something like IEditorInput).
Currently I am using showView() API to open the secong view.
Thanks,
Dinesh
|
|
|
|
|
|
Worked >> [Views] Communication between views. [message #76232 is a reply to message #75499] |
Tue, 17 June 2003 08:23  |
Eclipse User |
|
|
|
Thanks a lot, The second option worked fine for me. I didn't tested with the
first one.
Thanks,
Dinesh
"Emil Einarsson" <emil.einarsson@solme.se> wrote in message
news:bckir3$6qn$1@rogue.oti.com...
> Hi.
>
> A few ways spring to mind.
>
> 1 - Using singleton static getInstance() methods in the views.
> By statically referencing the views, like this:
> View1{
> method(){
> View2.getInstance().newSelection(selection);
> }
>
> View2{
> public static View2 getInstance(){
> return instance;
> }
> public void newSelection(...){
> // do stuff
> }
> }
>
> 2 - Using ViewPart.setSelectionProvider(treeviewer)
> register selection provider in one view (can be a tree viewer):
> this.getSite().setSelectionProvider(theTreeViewer);
>
> and register selectionchangedlistener in some other view:
>
this.getSite().getSelectionProvider().addSelectionChangedLis tener(aSelection
> ChangedListener);
>
> Good luck,
> Emil
>
> "Dinesh Varadharajan" <dvaradharajan@selectica.com> skrev i meddelandet
> news:bckfud$3sj$1@rogue.oti.com...
> > Hi,
> > I am having couple of views with treeViewers. I want to pass the
selection
> > of treeviewer in one view to the other view. Anybody have any idea abt
it.
> > (I want something like IEditorInput).
> >
> > Currently I am using showView() API to open the secong view.
> >
> > Thanks,
> > Dinesh
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03379 seconds