Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Working example of revealing a tree node
Working example of revealing a tree node [message #51324] Wed, 28 May 2003 05:35 Go to next message
Eclipse UserFriend
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 #51408 is a reply to message #51324] Wed, 28 May 2003 05:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stelian.iancu.gmxREMOVE.net

"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 #52886 is a reply to message #51408] Wed, 28 May 2003 23:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pavan_podila.persistent.co.in

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 #54124 is a reply to message #52886] Thu, 29 May 2003 12:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: knut_radloff.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 #55427 is a reply to message #54124] Fri, 30 May 2003 03:58 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:Opening Java Editor from Double Click
Next Topic:How to add a builder?
Goto Forum:
  


Current Time: Thu May 01 08:08:54 EDT 2025

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

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

Back to the top