Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » how to change selection in treeviewer?
how to change selection in treeviewer? [message #445783] Thu, 11 November 2004 09:55 Go to next message
Eclipse UserFriend
Originally posted by: fina.sd.com

This is a multi-part message in MIME format.

------=_NextPart_000_023D_01C4C817.AD095710
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable

i have an data object and wanna the viewer to select on it. i only find =
treeviewer.setselection(ISelecton) .... i just dunno how to handle it =
with my data object..

please advice ..thx

--=20
HGC


------=_NextPart_000_023D_01C4C817.AD095710
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.3790.218" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>i have an data object and wanna the =
viewer to=20
select on it. i only find treeviewer.setselection(ISelecton) .... i just =
dunno=20
how to handle it with my data object..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>please advice ..thx</FONT></DIV><FONT =
face=3DArial=20
size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_023D_01C4C817.AD095710--
Re: how to change selection in treeviewer? [message #445784 is a reply to message #445783] Thu, 11 November 2004 10:25 Go to previous messageGo to next message
dd is currently offline ddFriend
Messages: 4
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C4C7E1.2AD7A0C0
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable

You from treeviewer.getTree() methode that return you an Tree Object.
Now you can get currentSelection ( getSelection() ) or you define a new =
one!


"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvcsh$8mg$1@eclipse.org...
i have an data object and wanna the viewer to select on it. i only =
find treeviewer.setselection(ISelecton) .... i just dunno how to handle =
it with my data object..

please advice ..thx

--=20
HGC


------=_NextPart_000_000C_01C4C7E1.2AD7A0C0
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>You from treeviewer.getTree() methode =
that return=20
you an Tree Object.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Now you can get currentSelection ( =
getSelection() )=20
or you define a new one!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt; =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:cmvcsh$8mg$1@eclipse.org">news:cmvcsh$8mg$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>i have an data object and wanna the =
viewer to=20
select on it. i only find treeviewer.setselection(ISelecton) .... i =
just dunno=20
how to handle it with my data object..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>please advice ..thx</FONT></DIV><FONT =
face=3DArial=20
size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML >

------=_NextPart_000_000C_01C4C7E1.2AD7A0C0--
Re: how to change selection in treeviewer? [message #445785 is a reply to message #445784] Thu, 11 November 2004 10:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fina.sd.com

This is a multi-part message in MIME format.

------=_NextPart_000_027D_01C4C81C.D4165790
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable

hi ..

what i want is to change another treeitem, so i need to create a new =
selection from it ?

how should i do?

--=20
HGC


"dd" <daniel.santos.ro@hotmail.de> wrote in message =
news:cmvem0$c2f$1@eclipse.org...
You from treeviewer.getTree() methode that return you an Tree Object.
Now you can get currentSelection ( getSelection() ) or you define a =
new one!


"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvcsh$8mg$1@eclipse.org...
i have an data object and wanna the viewer to select on it. i only =
find treeviewer.setselection(ISelecton) .... i just dunno how to handle =
it with my data object..

please advice ..thx

--=20
HGC


------=_NextPart_000_027D_01C4C81C.D4165790
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.3790.218" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi ..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what i want is to change another =
treeitem, so i=20
need to create a new selection from it ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>how&nbsp;should i do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"dd" &lt;<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>&gt;=20
wrote in message <A=20
=
href=3D"news:cmvem0$c2f$1@eclipse.org">news:cmvem0$c2f$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>You from treeviewer.getTree() methode =
that return=20
you an Tree Object.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Now you can get currentSelection ( =
getSelection()=20
) or you define a new one!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt; =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:cmvcsh$8mg$1@eclipse.org">news:cmvcsh$8mg$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>i have an data object and wanna the =
viewer to=20
select on it. i only find treeviewer.setselection(ISelecton) .... i =
just=20
dunno how to handle it with my data object..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>please advice =
...thx</FONT></DIV><FONT=20
face=3DArial size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BODY ></HTML>

------=_NextPart_000_027D_01C4C81C.D4165790--
Re: how to change selection in treeviewer? [message #445787 is a reply to message #445785] Thu, 11 November 2004 11:01 Go to previous messageGo to next message
dd is currently offline ddFriend
Messages: 4
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C4C7E6.2C633080
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable

do like that:

this.myTreeViewer.getTree().setSelection( treeItem[] );

//treeItem[] list of treeItems
"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvf1m$con$1@eclipse.org...
hi ..

what i want is to change another treeitem, so i need to create a new =
selection from it ?

how should i do?

--=20
HGC


"dd" <daniel.santos.ro@hotmail.de> wrote in message =
news:cmvem0$c2f$1@eclipse.org...
You from treeviewer.getTree() methode that return you an Tree =
Object.
Now you can get currentSelection ( getSelection() ) or you define a =
new one!


"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvcsh$8mg$1@eclipse.org...
i have an data object and wanna the viewer to select on it. i only =
find treeviewer.setselection(ISelecton) .... i just dunno how to handle =
it with my data object..

please advice ..thx

--=20
HGC


------=_NextPart_000_000B_01C4C7E6.2C633080
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>do like that:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>this.myTreeViewer.getTree().setSelection(=20
treeItem[] );</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//treeItem[] list of =
treeItems</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt; =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:cmvf1m$con$1@eclipse.org">news:cmvf1m$con$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>hi ..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what i want is to change another =
treeitem, so i=20
need to create a new selection from it ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>how&nbsp;should i do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"dd" &lt;<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>&gt;=20
wrote in message <A=20
=
href=3D"news:cmvem0$c2f$1@eclipse.org">news:cmvem0$c2f$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>You from treeviewer.getTree() =
methode that=20
return you an Tree Object.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Now you can get currentSelection (=20
getSelection() ) or you define a new one!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt; =
schrieb=20
im Newsbeitrag <A=20
=
href=3D"news:cmvcsh$8mg$1@eclipse.org">news:cmvcsh$8mg$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>i have an data object and wanna =
the viewer to=20
select on it. i only find treeviewer.setselection(ISelecton) .... =
i just=20
dunno how to handle it with my data object..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>please advice =
...thx</FONT></DIV><FONT=20
face=3DArial size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
=
<DIV></FONT>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BODY></H=
TML>

------=_NextPart_000_000B_01C4C7E6.2C633080--
Re: how to change selection in treeviewer? [message #445788 is a reply to message #445787] Thu, 11 November 2004 11:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fina.sd.com

This is a multi-part message in MIME format.

------=_NextPart_000_0299_01C4C821.38A65F80
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable

how should i get the treeitem as i only have the data reference on hand, =
instead of its corresponding treeitem in the viewer... ?

thx...

--=20
HGC


"dd" <daniel.santos.ro@hotmail.de> wrote in message =
news:cmvgp3$fv5$1@eclipse.org...
do like that:

this.myTreeViewer.getTree().setSelection( treeItem[] );

//treeItem[] list of treeItems
"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvf1m$con$1@eclipse.org...
hi ..

what i want is to change another treeitem, so i need to create a new =
selection from it ?

how should i do?

--=20
HGC


"dd" <daniel.santos.ro@hotmail.de> wrote in message =
news:cmvem0$c2f$1@eclipse.org...
You from treeviewer.getTree() methode that return you an Tree =
Object.
Now you can get currentSelection ( getSelection() ) or you define =
a new one!


"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvcsh$8mg$1@eclipse.org...
i have an data object and wanna the viewer to select on it. i =
only find treeviewer.setselection(ISelecton) .... i just dunno how to =
handle it with my data object..

please advice ..thx

--=20
HGC


------=_NextPart_000_0299_01C4C821.38A65F80
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.3790.218" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>how should i get the treeitem as i only =
have the=20
data reference on hand, instead of its corresponding treeitem in the =
viewer...=20
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thx...</FONT></DIV>
<DIV><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"dd" &lt;<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>&gt;=20
wrote in message <A=20
=
href=3D"news:cmvgp3$fv5$1@eclipse.org">news:cmvgp3$fv5$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>do like that:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>this.myTreeViewer.getTree().setSelection(=20
treeItem[] );</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//treeItem[] list of =
treeItems</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt; =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:cmvf1m$con$1@eclipse.org">news:cmvf1m$con$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>hi ..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what i want is to change another =
treeitem, so i=20
need to create a new selection from it ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>how&nbsp;should i do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"dd" &lt;<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>&gt;=20
wrote in message <A=20
=
href=3D"news:cmvem0$c2f$1@eclipse.org">news:cmvem0$c2f$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>You from treeviewer.getTree() =
methode that=20
return you an Tree Object.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Now you can get currentSelection =
(=20
getSelection() ) or you define a new one!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A =
href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt; schrieb=20
im Newsbeitrag <A=20
=
href=3D"news:cmvcsh$8mg$1@eclipse.org">news:cmvcsh$8mg$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>i have an data object and wanna =
the viewer=20
to select on it. i only find treeviewer.setselection(ISelecton) =
..... i=20
just dunno how to handle it with my data object..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>please advice =
...thx</FONT></DIV><FONT=20
face=3DArial size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
=
<DIV></FONT>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUO=
TE></BODY></HTML>

------=_NextPart_000_0299_01C4C821.38A65F80--
Re: how to change selection in treeviewer? [message #445789 is a reply to message #445788] Thu, 11 November 2004 12:21 Go to previous messageGo to next message
dd is currently offline ddFriend
Messages: 4
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.

------=_NextPart_000_0026_01C4C7F1.534086C0
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable

You can loop over the Tree and catch the elements (TreeItems)
"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvgsk$g6c$1@eclipse.org...
how should i get the treeitem as i only have the data reference on =
hand, instead of its corresponding treeitem in the viewer... ?

thx...

--=20
HGC


"dd" <daniel.santos.ro@hotmail.de> wrote in message =
news:cmvgp3$fv5$1@eclipse.org...
do like that:

this.myTreeViewer.getTree().setSelection( treeItem[] );

//treeItem[] list of treeItems
"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvf1m$con$1@eclipse.org...
hi ..

what i want is to change another treeitem, so i need to create a =
new selection from it ?

how should i do?

--=20
HGC


"dd" <daniel.santos.ro@hotmail.de> wrote in message =
news:cmvem0$c2f$1@eclipse.org...
You from treeviewer.getTree() methode that return you an Tree =
Object.
Now you can get currentSelection ( getSelection() ) or you =
define a new one!


"Bush" <fina@sd.com> schrieb im Newsbeitrag =
news:cmvcsh$8mg$1@eclipse.org...
i have an data object and wanna the viewer to select on it. i =
only find treeviewer.setselection(ISelecton) .... i just dunno how to =
handle it with my data object..

please advice ..thx

--=20
HGC


------=_NextPart_000_0026_01C4C7F1.534086C0
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>You can loop over the Tree and catch =
the elements=20
(TreeItems)</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt; =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:cmvgsk$g6c$1@eclipse.org">news:cmvgsk$g6c$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>how should i get the treeitem as i =
only have the=20
data reference on hand, instead of its corresponding treeitem in the =
viewer...=20
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thx...</FONT></DIV>
<DIV><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"dd" &lt;<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>&gt;=20
wrote in message <A=20
=
href=3D"news:cmvgp3$fv5$1@eclipse.org">news:cmvgp3$fv5$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>do like that:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>this.myTreeViewer.getTree().setSelection(=20
treeItem[] );</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//treeItem[] list of =
treeItems</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt; =
schrieb=20
im Newsbeitrag <A=20
=
href=3D"news:cmvf1m$con$1@eclipse.org">news:cmvf1m$con$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>hi ..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what i want is to change another =
treeitem, so=20
i need to create a new selection from it ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>how&nbsp;should i =
do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"dd" &lt;<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>&gt;=20
wrote in message <A=20
=
href=3D"news:cmvem0$c2f$1@eclipse.org">news:cmvem0$c2f$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>You from treeviewer.getTree() =
methode that=20
return you an Tree Object.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Now you can get =
currentSelection (=20
getSelection() ) or you define a new one!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bush" &lt;<A =
href=3D"mailto:fina@sd.com">fina@sd.com</A>&gt;=20
schrieb im Newsbeitrag <A=20
=
href=3D"news:cmvcsh$8mg$1@eclipse.org">news:cmvcsh$8mg$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>i have an data object and =
wanna the=20
viewer to select on it. i only find =
treeviewer.setselection(ISelecton)=20
.... i just dunno how to handle it with my data =
object..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>please advice =
...thx</FONT></DIV><FONT=20
face=3DArial size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV>&nbsp;</DIV>
=
<DIV></FONT>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUO=
TE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0026_01C4C7F1.534086C0--
Re: how to change selection in treeviewer? [message #445790 is a reply to message #445783] Thu, 11 November 2004 13:09 Go to previous message
Eclipse UserFriend
Originally posted by: micasim.gmx.de

Hi Bush,

TreeViewer is a StructuredViewer. The methods get-/setSelection() of a
StructuredViewer works with a IStructuredSelection.
A default implementation of IStructuredSelection is
org.eclipse.jface.viewers.StructuredSelection.
So to select one single (data) object you just have to

yourTreeViewer.setSelection (new StructuredSelection (dataObjectToSelect)).

If the branch that contains the object's representation is collapsed
automatically is expanded.

Hope this helps,
Michael
Previous Topic:Gtk and GLContext question.
Next Topic:Table "grid" visible only for rows that actually exist?
Goto Forum:
  


Current Time: Tue Oct 27 22:19:14 GMT 2020

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

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

Back to the top