Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT TableViewer - setExpanded() not working - bug ?
SWT TableViewer - setExpanded() not working - bug ? [message #451118] Wed, 23 February 2005 16:04 Go to next message
Eric Bredtmann is currently offline Eric BredtmannFriend
Messages: 4
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------020801080207030106000802
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hey there,

while working on an SWT TreeViewer, I encountered following problem:

When expanding a treeviewer manually using mouse or keyboard control,
the selected Node expands, the subtree is loaded according to my content
provider and the child nodes are displayed correctly.

I am trying to expand the desired tree node via program code now.

Example:
*Code:*

TreeItem item = viewer.getTree().getItems()[0];
item.setExpanded( true )


When triggering the function *setExpanded(true)* via code now *while the
tree has never been expanded manually before*,
the node tries to expand, but the child nodes are not loaded / displayed
at all.

As a matter of fact, if I manually open up the tree structure before,
and then expand the appropriate tree node via code,
the tree opens up o.k. and the child nodes or sub-tree gets loaded
correctly.

Is this a bug (are there any workarounds yet?) or do I miss anything
there ???

Thanks in advance !

Cheers,
Eric


--------------020801080207030106000802
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<span class="postbody">Hey there,
<br>
<br>
while working on an SWT TreeViewer, I encountered following problem:<br>
<br>
When expanding a treeviewer manually using mouse or keyboard control,<br>
the selected Node expands, the subtree is loaded according to my
content provider and the child nodes are displayed correctly.<br>
<br>
I am trying to expand the desired tree node via program code now.<br>
<br>
Example:<br>
</span>
<table align="center" border="0" cellpadding="3" cellspacing="1"
width="90%">
<tbody>
<tr>
<td><span class="genmed"><b>Code:</b></span></td>
</tr>
<tr>
<td class="code"><br>
TreeItem item = viewer.getTree().getItems()[0]; <br>
item.setExpanded( true ) <br>
</td>
</tr>
</tbody>
</table>
<span class="postbody"><br>
When triggering the function <b>setExpanded(true)</b> via code now <b>while
the tree has never been expanded manually before</b>,<br>
the node tries to expand, but the child nodes are not loaded /
displayed at all.<br>
<br>
As a matter of fact, if I manually open up the tree structure before,
and then expand the appropriate tree node via code,<br>
the tree opens up o.k. and the child nodes or sub-tree gets loaded
correctly.<br>
</span><span class="postbody"><br>
Is this a bug (are there any workarounds yet?) or do I miss anything
there ???<br>
<br>
Thanks in advance !<br>
<br>
Cheers,<br>
Eric<br>
<br>
</span>
</body>
</html>

--------------020801080207030106000802--
Re: SWT TableViewer - setExpanded() not working - bug ? [message #451122 is a reply to message #451118] Wed, 23 February 2005 19:31 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_00AC_01C519B4.68507C40
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

Are you relying on the Expand event to fill in the children? When you =
programmatically call TreeItem.setExpanded(boolean) no event is sent. =
When the user clicks on the "+" in a tree (or hits the "+" key on the =
keyboard), an Expand event is sent.
"Eric Bredtmann" <eb@innovationgate.de> wrote in message =
news:421CA984.4040208@innovationgate.de...
Hey there,=20

while working on an SWT TreeViewer, I encountered following problem:

When expanding a treeviewer manually using mouse or keyboard control,
the selected Node expands, the subtree is loaded according to my =
content provider and the child nodes are displayed correctly.

I am trying to expand the desired tree node via program code now.

Example:
Code:=20

TreeItem item =3D viewer.getTree().getItems()[0];=20
item.setExpanded( true )=20
=20

When triggering the function setExpanded(true) via code now while the =
tree has never been expanded manually before,
the node tries to expand, but the child nodes are not loaded / =
displayed at all.

As a matter of fact, if I manually open up the tree structure before, =
and then expand the appropriate tree node via code,
the tree opens up o.k. and the child nodes or sub-tree gets loaded =
correctly.

Is this a bug (are there any workarounds yet?) or do I miss anything =
there ???

Thanks in advance !

Cheers,
Eric


------=_NextPart_000_00AC_01C519B4.68507C40
Content-Type: text/html;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-15>
<META content=3D"MSHTML 6.00.2900.2604" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT size=3D2>Are you relying on the Expand event to fill in the=20
children?&nbsp; When you programmatically call =
TreeItem.setExpanded(boolean) no=20
event is sent.&nbsp; When the user clicks on the "+" in a tree (or hits =
the "+"=20
key on the keyboard), an Expand event is sent.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Eric Bredtmann" &lt;<A=20
href=3D"mailto:eb@innovationgate.de">eb@innovationgate.de</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:421CA984.4040208@innovationgate.de">news:421CA984.4040208@in=
novationgate.de</A>...</DIV><SPAN=20
class=3Dpostbody>Hey there, <BR><BR>while working on an SWT =
TreeViewer, I=20
encountered following problem:<BR><BR>When expanding a treeviewer =
manually=20
using mouse or keyboard control,<BR>the selected Node expands, the =
subtree is=20
loaded according to my content provider and the child nodes are =
displayed=20
correctly.<BR><BR>I am trying to expand the desired tree node via =
program code=20
now.<BR><BR>Example:<BR></SPAN>
<TABLE cellSpacing=3D1 cellPadding=3D3 width=3D"90%" align=3Dcenter =
border=3D0>
<TBODY>
<TR>
<TD><SPAN class=3Dgenmed><B>Code:</B></SPAN></TD></TR>
<TR>
<TD class=3Dcode><BR>TreeItem item =3D =
viewer.getTree().getItems()[0];=20
<BR>item.setExpanded( true ) <BR></TD></TR></TBODY></TABLE><SPAN =

class=3Dpostbody><BR>When triggering the function =
<B>setExpanded(true)</B> via=20
code now <B>while the tree has never been expanded manually =
before</B>,<BR>the=20
node tries to expand, but the child nodes are not loaded / displayed =
at=20
all.<BR><BR>As a matter of fact, if I manually open up the tree =
structure=20
before, and then expand the appropriate tree node via code,<BR>the =
tree opens=20
up o.k. and the child nodes or sub-tree gets loaded =
correctly.<BR></SPAN><SPAN=20
class=3Dpostbody><BR>Is this a bug (are there any workarounds yet?) or =
do I miss=20
anything there ???<BR><BR>Thanks in advance=20
!<BR><BR>Cheers,<BR>Eric<BR><BR></BLOCKQUOTE></SPAN ></BODY></HTML>

------=_NextPart_000_00AC_01C519B4.68507C40--
Previous Topic:Swing JDialogs and SWT_AWT.new_Frame()
Next Topic:new 3m5 tree widget color change
Goto Forum:
  


Current Time: Thu Apr 25 13:55:57 GMT 2024

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

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

Back to the top