| Summary: | Unable to scroll down using scroll bar when a tree has large number of TreeItems | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Janash <janash_oustine> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | eclipse.felipe, jan.hvozdovic |
| Version: | 4.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Server 2003 | ||
| Whiteboard: | stalebug | ||
I think the bug is closely related to the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=307727 But I don't agree with the conclusion. I used the enclosed sample and observed that the bar is working fine for 65333. But if the number is higher than the control behaves unexpectedly, see below. I am using Windows XP SP3. My observations are a) 65535 nodes - bar is not visible. b) 100000 nodes - bar is visible but the tree is not working correctly. I can't see all nodes and if I use SW.VIRTUAL I am not getting the event SWT.SetData. I used following example from the related bug /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ /* * Tree example snippet: create a tree * * For a list of all SWT example snippets see * http://www.eclipse.org/swt/snippets/ */ import org.eclipse.swt.*; import org.eclipse.swt.widgets.*; import org.eclipse.swt.layout.*; public class Snippet15 { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); final Tree tree = new Tree(shell, SWT.BORDER); System.out.println("Tree is starting to be built"); TreeItem item1 = new TreeItem(tree, SWT.NULL); item1.setText("Node 1"); long ms = System.currentTimeMillis(); int i; // for (i = 0; i < 65533; i++) { // for (i = 0; i < 65535; i++) { for (i = 0; i < 100000; i++) { TreeItem item11 = new TreeItem(item1, SWT.NULL); item11.setText("Node " + i); } ms = System.currentTimeMillis() - ms; System.out.println("Bulding tree no = " + i + ", time = " + ms); TreeItem item2 = new TreeItem(tree, SWT.NULL); item2.setText("Node 2"); for (i = 0; i < 1; i++) { TreeItem item21 = new TreeItem(item2, SWT.NULL); item21.setText("Node " + i); } shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } To what control is tree mapped? I found some note on web that ComCtrl32.tree has limit of 65K nodes. (In reply to comment #2) > To what control is tree mapped? TreeView http://msdn.microsoft.com/en-us/library/bb759988(v=VS.85).aspx 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. This bug has been marked as stalebug a while ago without any further interaction. If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard flag. This bug was marked as stalebug a while ago. Marking as worksforme. If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag. |
Build Identifier: 20100218-1602 When a Tree constains large number (>75000) of TreeItems, the scroll bar is not scrollable beyond approxinmately 10000 rows, since the thumb element of the scroll bar is positioned at the maximum. Tree is not scrollable using the scroll bar after this point. Reproducible: Always Steps to Reproduce: Please try the following cod to reproduce the issue: public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); final Tree tree = new Tree(shell, SWT.MULTI); shell.setSize(300, 300); TreeItem root = new TreeItem(tree, 0); root.setText("Root Node"); for (int i = 0; i < 75000; i++) { TreeItem item = new TreeItem(root, 0); item.setText("Child Node " + i); } tree.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { System.out.println(((TreeItem[])tree.getSelection())[0].getText()); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } Steps: 1) Run the SWT application using the above code 2) Expand the node "Root Node" in the Tree. 3) Scroll down using the scroll bar Bug: Unable to scroll down beyond "Child Node 9463", since the scroll bar thumb element is at the maximum position for this node.