Community
Participate
Working Groups
If an item has subitems, when setting subitems to zero, the expanded state never change, for example if the node was expanded, remain expanded. Then when the sub items is zero, you can't more change the expand state In my opionion this is not correct, and when use a virtual tree, the problem is propagated in the SetData event Forcing setExpanded(false) is not a solution because this can generate unwanted selections event Code: Display display = new Display (); Shell shell = new Shell(display); Tree t = new Tree(shell, SWT.NONE); t.setBounds(0,0,400,400); TreeItem t1 = new TreeItem(t, SWT.NONE); t1.setText("A"); TreeItem t2 = new TreeItem(t1, SWT.NONE); t2.setText("B"); t1.setExpanded(true); System.out.println( "expanded = " + t1.getExpanded() ); t1.setItemCount(0); System.out.println( "expanded = " + t1.getExpanded() ); t1.setExpanded(false); System.out.println( "expanded = " + t1.getExpanded() ); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose ();
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.