Community
Participate
Working Groups
In a Tree with TreeEditors expanding or collapsing a TreeItem causes all the editors in the tree to be redrawn. This causes lot of flickering. We should (atleast) prevent the editors above the expanding/collapsing item from being affected. Snippet to show the problem:- public class TreeEditorFlicker { public static void main(String[] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout (new FillLayout ()); Tree tree = new Tree (shell, SWT.BORDER | SWT.MULTI|SWT.V_SCROLL|SWT.FULL_SELECTION); tree.setLinesVisible (true); for (int i=0; i<3; i++) { TreeColumn column = new TreeColumn(tree, SWT.NONE); column.setWidth (100); } for (int i=0; i<10; i++) { TreeItem item = new TreeItem (tree, SWT.NONE); for (int j = 0; j < 5; j++) { new TreeItem (item, SWT.NONE); } } TreeItem [] items = tree.getItems (); for (int i=0; i<items.length; i++) { createEditors(tree, items[i], i); TreeItem [] children = items[i].getItems(); for (int j = 0; j < children.length; j++) { createEditors(tree, children[j], i+j); } } tree.pack(); shell.pack (); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } static void createEditors(Tree tree, TreeItem child, int i) { TreeEditor editor = new TreeEditor (tree); Text text = new Text (tree, SWT.NONE); text.setText("Text" + i); editor.grabHorizontal = true; editor.setEditor(text, child, 0); editor = new TreeEditor (tree); Combo combo = new Combo (tree, SWT.NONE); combo.setText("Combo" + i); combo.add("item 1"); combo.add("item 2"); editor.grabHorizontal = true; editor.setEditor(combo, child, 1); editor = new TreeEditor (tree); Button button = new Button(tree, SWT.CHECK); editor.grabHorizontal = true; editor.setEditor(button, child, 2); editor = new TreeEditor (tree); } }
I have the exact same problem, is there a workaround?
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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.