Working example of revealing a tree node [message #51324] |
Wed, 28 May 2003 05:35  |
Eclipse User |
|
|
|
Originally posted by: pavan_podila.persistent.co.in
Can someone please show me a working example of how to reveal a particular
node in a tree. I've tried the code given in the Eclipse Article but in
vain. Please help asap.
thanks,
--
O-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-O
Pavan Podila
Member of Technical Staff
Persistent Systems Pvt. Ltd.
Phone: 567 8900 X 479
http://pavanpodila.cjb.net/
O-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-O
|
|
|
|
|
|
Re: Working example of revealing a tree node [message #55427 is a reply to message #54124] |
Fri, 30 May 2003 03:58   |
Eclipse User |
|
|
|
Originally posted by: pavan_podila.persistent.co.in
Hello Knut,
Could you send me your new article source. I've tried using the
setSelection() but it fails and I'm not seeing any selection made on my
treeviewer.
thanks
"Knut Radloff" <knut_radloff@oti.com> wrote in message
news:bb5bkk$6o6$1@rogue.oti.com...
> reveal only shows an element (i.e., expands the parent elements and
scrolls the tree if necessary). Use setSelection(ISelection,
> true) if you want to set the selection and make the selected element
visible.
> In the JFace Tree Viewer article example I added
> viewer.setSelection(new StructuredSelection((Model)event.receiver()),
true);
> to MovingBoxContentProvider.add to select and reveal a newly added item.
>
> Knut
>
> "Pavan Podila" <pavan_podila@persistent.co.in> wrote in message
news:bb3uh1$8ma$1@rogue.oti.com...
> > I want to set the selection on this node in the tree and expand all
parents
> > if necessary. There is a method called reveal() which can be called on
the
> > treeviewer (I am using a treeviewer and have knowledge of only the
objects
> > and not in terms of treeitems), but it is not doing it's job. Can
someone
> > tell me how the reveal() method can be used on a treeviewer ???
> >
> >
> > "Stelian Iancu" <stelian.iancu@gmxREMOVE.net> wrote in message
> > news:bb211t$jo0$1@rogue.oti.com...
> > > "Pavan Podila" <pavan_podila@persistent.co.in> wrote in message
> > > news:bb1vr5$iso$1@rogue.oti.com...
> > > > Can someone please show me a working example of how to reveal a
> > particular
> > > > node in a tree. I've tried the code given in the Eclipse Article but
in
> > > > vain. Please help asap.
> > > >
> > >
> > > Revealing, like in expanding ? Or ?
> > > For selecting an item, see the setSelection(TreeItem[] items) method
of
> > the
> > > Tree class. If you want to expand an Item, see the setExpanded(boolean
> > > expanded) method of TreeItem.
> > >
> > >
> > > > thanks,
> > > >
> > > > --
> > > > O-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-O
> > > > Pavan Podila
> > > > Member of Technical Staff
> > > > Persistent Systems Pvt. Ltd.
> > > > Phone: 567 8900 X 479
> > > > http://pavanpodila.cjb.net/
> > > > O-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-O
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Working example of revealing a tree node [message #66071 is a reply to message #55427] |
Fri, 06 June 2003 19:13  |
Eclipse User |
|
|
|
Originally posted by: knut_radloff.oti.com
This is MovingBoxContentProvider.add
public void add(DeltaEvent event) {
Object movingBox = ((Model)event.receiver()).getParent();
viewer.refresh(movingBox, false);
viewer.setExpandedState(movingBox, true);
viewer.setSelection(new StructuredSelection((Model)event.receiver()), true);
// viewer.reveal((Model)event.receiver());
}
Knut
"Pavan Podila" <pavan_podila@persistent.co.in> wrote in message news:bb72td$b29$1@rogue.oti.com...
> Hello Knut,
> Could you send me your new article source. I've tried using the
> setSelection() but it fails and I'm not seeing any selection made on my
> treeviewer.
>
> thanks
>
> "Knut Radloff" <knut_radloff@oti.com> wrote in message
> news:bb5bkk$6o6$1@rogue.oti.com...
> > reveal only shows an element (i.e., expands the parent elements and
> scrolls the tree if necessary). Use setSelection(ISelection,
> > true) if you want to set the selection and make the selected element
> visible.
> > In the JFace Tree Viewer article example I added
> > viewer.setSelection(new StructuredSelection((Model)event.receiver()),
> true);
> > to MovingBoxContentProvider.add to select and reveal a newly added item.
> >
> > Knut
> >
> > "Pavan Podila" <pavan_podila@persistent.co.in> wrote in message
> news:bb3uh1$8ma$1@rogue.oti.com...
> > > I want to set the selection on this node in the tree and expand all
> parents
> > > if necessary. There is a method called reveal() which can be called on
> the
> > > treeviewer (I am using a treeviewer and have knowledge of only the
> objects
> > > and not in terms of treeitems), but it is not doing it's job. Can
> someone
> > > tell me how the reveal() method can be used on a treeviewer ???
> > >
> > >
> > > "Stelian Iancu" <stelian.iancu@gmxREMOVE.net> wrote in message
> > > news:bb211t$jo0$1@rogue.oti.com...
> > > > "Pavan Podila" <pavan_podila@persistent.co.in> wrote in message
> > > > news:bb1vr5$iso$1@rogue.oti.com...
> > > > > Can someone please show me a working example of how to reveal a
> > > particular
> > > > > node in a tree. I've tried the code given in the Eclipse Article but
> in
> > > > > vain. Please help asap.
> > > > >
> > > >
> > > > Revealing, like in expanding ? Or ?
> > > > For selecting an item, see the setSelection(TreeItem[] items) method
> of
> > > the
> > > > Tree class. If you want to expand an Item, see the setExpanded(boolean
> > > > expanded) method of TreeItem.
> > > >
> > > >
> > > > > thanks,
> > > > >
> > > > > --
> > > > > O-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-O
> > > > > Pavan Podila
> > > > > Member of Technical Staff
> > > > > Persistent Systems Pvt. Ltd.
> > > > > Phone: 567 8900 X 479
> > > > > http://pavanpodila.cjb.net/
> > > > > O-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-O
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.28792 seconds