how to change selection in treeviewer? [message #445783] |
Thu, 11 November 2004 09:55 |
Eclipse User |
|
|
|
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> </DIV>
<DIV><FONT face=3DArial size=3D2>please advice ..thx</FONT></DIV><FONT =
face=3DArial=20
size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV></BODY></HTML>
------=_NextPart_000_023D_01C4C817.AD095710--
|
|
|
|
Re: how to change selection in treeviewer? [message #445785 is a reply to message #445784] |
Thu, 11 November 2004 10:32 |
Eclipse User |
|
|
|
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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2>how should i do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR>-- <BR>HGC</DIV>
<DIV> </DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>>=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> </DIV>
<DIV> </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" <<A href=3D"mailto:fina@sd.com">fina@sd.com</A>> =
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> </DIV>
<DIV><FONT face=3DArial size=3D2>please advice =
...thx</FONT></DIV><FONT=20
face=3DArial size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV></BLOCKQUOTE></BLOCKQUOTE></BODY ></HTML>
------=_NextPart_000_027D_01C4C81C.D4165790--
|
|
|
|
Re: how to change selection in treeviewer? [message #445788 is a reply to message #445787] |
Thu, 11 November 2004 11:04 |
Eclipse User |
|
|
|
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> </DIV>
<DIV><FONT face=3DArial size=3D2>thx...</FONT></DIV>
<DIV><BR>-- <BR>HGC</DIV>
<DIV> </DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>>=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> </DIV>
<DIV><FONT face=3DArial =
size=3D2>this.myTreeViewer.getTree().setSelection(=20
treeItem[] );</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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" <<A href=3D"mailto:fina@sd.com">fina@sd.com</A>> =
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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2>how should i do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR>-- <BR>HGC</DIV>
<DIV> </DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:daniel.santos.ro@hotmail.de">daniel.santos.ro@hotmail.de</=
A>>=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> </DIV>
<DIV> </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" <<A =
href=3D"mailto:fina@sd.com">fina@sd.com</A>> 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> </DIV>
<DIV><FONT face=3DArial size=3D2>please advice =
...thx</FONT></DIV><FONT=20
face=3DArial size=3D2>
<DIV><BR>-- <BR>HGC</DIV>
<DIV> </DIV>
=
<DIV></FONT> </DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUO=
TE></BODY></HTML>
------=_NextPart_000_0299_01C4C821.38A65F80--
|
|
|
|
Re: how to change selection in treeviewer? [message #445790 is a reply to message #445783] |
Thu, 11 November 2004 13:09 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02037 seconds