Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324584 - [TableEditor] doesn't redraw correctly if the column with the tableEditor is resized using the left edge of the column
Summary: [TableEditor] doesn't redraw correctly if the column with the tableEditor is ...
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-06 10:11 EDT by marco CLA
Modified: 2010-09-07 06:38 EDT (History)
0 users

See Also:


Attachments
status before the column resize (8.08 KB, image/jpeg)
2010-09-06 10:16 EDT, marco CLA
no flags Details
status after the column resizing (7.91 KB, image/jpeg)
2010-09-06 10:17 EDT, marco CLA
no flags Details
Test case (2.06 KB, patch)
2010-09-07 04:09 EDT, Ivan Furnadjiev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description marco CLA 2010-09-06 10:11:31 EDT
Build Identifier: I20090611-1540

I notice that if a column (e.g the last column) on a table with more than one columns contains a tableEditor (e.g with a Text control inside) and that column is resized using the left edge of the column (resizing using the right edge is fine) or if one of the previous columns is resized, then the tableEditor isn't redrow correctly

Reproducible: Always

Steps to Reproduce:
1. make a table with 2 columns
2. create a tableEditor on the second column with a Text control
3. enlarge the first column -> the textEditor doesn't move with the column
Comment 1 marco CLA 2010-09-06 10:16:04 EDT
Created attachment 178268 [details]
status before the column resize

screenshot of the table before the column resizing
Comment 2 marco CLA 2010-09-06 10:17:22 EDT
Created attachment 178269 [details]
status after the column resizing

status of the tabel after the column resizing.
the tableEditor didn't redraw itself.
Comment 3 Ivan Furnadjiev CLA 2010-09-06 10:51:13 EDT
I can't reproduce it with 1.3 release or CVS HEAD. Looks like you are using 1.2 (20090611-1540). For me, when I click on the table header to enlarge the column, the active cell editor is automatically deactivated. Can you check it with 1.3 or CVS HEAD?
Comment 4 marco CLA 2010-09-06 11:29:26 EDT
(In reply to comment #3)
> I can't reproduce it with 1.3 release or CVS HEAD. Looks like you are using 1.2
> (20090611-1540). For me, when I click on the table header to enlarge the
> column, the active cell editor is automatically deactivated. Can you check it
> with 1.3 or CVS HEAD?

I'm already using rap 1.3.0 the problem shows not when resizing the column with the cell editor, but when resizing the columns on its left.
Comment 5 Ivan Furnadjiev CLA 2010-09-06 11:37:38 EDT
Marco, as I can't reproduce it with Controls Demo -> TableViewer Tab, please provide a snippet for this issue with complete steps how to reproduce.
Comment 6 marco CLA 2010-09-06 11:54:31 EDT
(In reply to comment #5)
> Marco, as I can't reproduce it with Controls Demo -> TableViewer Tab, please
> provide a snippet for this issue with complete steps how to reproduce.

Thanks for the answer.
I'm not using TableViewer, but directly the TableEditor in a table like in the exemple present on the eclipse documentation at:

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/custom/TableEditor.html


this is the example present in the TableEditor javadoc (only added table.setHeaderVisible(true)):


final Table table = new Table(shell, SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
TableColumn column1 = new TableColumn(table, SWT.NONE);
TableColumn column2 = new TableColumn(table, SWT.NONE);
table.setHeaderVisible(true);
for (int i = 0; i < 10; i++) {
	TableItem item = new TableItem(table, SWT.NONE);
	item.setText(new String[] {"item " + i, "edit this value"});
}
column1.pack();
column2.pack();

final TableEditor editor = new TableEditor(table);
//The editor must have the same size as the cell and must
//not be any smaller than 50 pixels.
editor.horizontalAlignment = SWT.LEFT;
editor.grabHorizontal = true;
editor.minimumWidth = 50;
// editing the second column
final int EDITABLECOLUMN = 1;

table.addSelectionListener(new SelectionAdapter() {
	public void widgetSelected(SelectionEvent e) {
		// Clean up any previous editor control
		Control oldEditor = editor.getEditor();
		if (oldEditor != null) oldEditor.dispose();

		// Identify the selected row
		TableItem item = (TableItem)e.item;
		if (item == null) return;

		// The control that will be the editor must be a child of the Table
		Text newEditor = new Text(table, SWT.NONE);
		newEditor.setText(item.getText(EDITABLECOLUMN));
		newEditor.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				Text text = (Text)editor.getEditor();
				editor.getItem().setText(EDITABLECOLUMN, text.getText());
			}
		});
		newEditor.selectAll();
		newEditor.setFocus();
		editor.setEditor(newEditor, item, EDITABLECOLUMN);
	}
});




resizing column 1 , the editor on column2 (if visible) doesn't redraw correctly.
Comment 7 Ivan Furnadjiev CLA 2010-09-07 03:55:45 EDT
Now everything is in place... I can reproduce to problem. Thanks for the snippet.
Comment 8 Ivan Furnadjiev CLA 2010-09-07 04:09:41 EDT
Created attachment 178300 [details]
Test case

In RAP if a column is resized, the columns after it do not fire control move event.
Comment 9 marco CLA 2010-09-07 05:01:25 EDT
(In reply to comment #8)

Thanks Ivan.

> Created an attachment (id=178300) [details]
> Test case
> 
> In RAP if a column is resized, the columns after it do not fire control move
> event.
Comment 10 Ivan Furnadjiev CLA 2010-09-07 06:38:54 EDT
Fixed in CVS HEAD.