Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 386850

Summary: Tree column resize doesn't refresh Control which uses TreeEditor.
Product: [RT] RAP Reporter: Angelo ZERR <azerr>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: azerr, ivan
Version: 1.5   
Target Milestone: 2.0 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot with Progressbar in a Tree by using TreeEditor
none
Screenshot with Progressbar in a Tree by using TreeEditor after resize of the first column none

Description Angelo ZERR CLA 2012-08-08 11:19:56 EDT
Created attachment 219674 [details]
Screenshot with Progressbar in a Tree by using TreeEditor

Hi, 

I would lie using TreeEditor to add ProgressBar in some TreeItem (see the screenshot TreeEditorProgressBar_OK.png). I have used the sample with TableEditor http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet149.java

It works great. I have replaced Table with Tree like this : 

-----------------------------------------
		Tree tree = new Tree (sbody, SWT.BORDER);
		tree.setHeaderVisible (true);
		tree.setLinesVisible(true);
		for (int i=0; i<2; i++) {
			new TreeColumn (tree, SWT.NONE);
		}
		tree.getColumn (0).setText ("Task");
		tree.getColumn (1).setText ("Progress");
		for (int i=0; i<40; i++) {
			TreeItem item = new TreeItem (tree, SWT.NONE);
			item.setText ("Task " + i);
			if ( i % 5 == 0) {
				ProgressBar bar = new ProgressBar (tree, SWT.NONE);
				bar.setSelection (i);
				TreeEditor editor = new TreeEditor (tree);
				editor.grabHorizontal = editor.grabVertical = true;
				editor.setEditor (bar, item, 1);
			}
		}
		tree.getColumn (0).pack ();
		tree.getColumn (1).setWidth (128);
---------------------------------------

It works with RAP but if you remove the size of the first column, progressbar is not repainted and progressbar is not moved and cut the first column.
(see TreeEditorProgressBar_NOK.png)

With TableEditor you have not the problem.

After debugging, I have seen that TableColumn#setWidth call processNextColumnsMoveEvent(); method (which fix the problem) although TreeColumn#setWidht doesn't a processNextColumnsMoveEvent methdod like.

Regards Angelo
Comment 1 Angelo ZERR CLA 2012-08-08 11:20:52 EDT
Created attachment 219675 [details]
Screenshot with Progressbar in a Tree by using TreeEditor after resize of the first column
Comment 2 Ivan Furnadjiev CLA 2012-08-09 05:00:17 EDT
Fixed in master with commit 7fc573add187cbe0c851077fb3da167d78debc7a.