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

Bug 365747

Summary: [Table] Cell editors aren't scrolled into view on a Table with fixed columns
Product: [RT] RAP Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan
Version: unspecified   
Target Milestone: 1.5 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Project to reproduce the bug
none
Proposed patch against Tree_Table_Merge branch with JUnit tests. none

Description Rüdiger Herrmann CLA 2011-12-06 10:00:32 EST
On a table with fixed columns, the cell editor is not scrolled into view.
To reproduce, use the attached project (table with two fixed columns and cell editor suport):
* narrow the browser window so that only three columns are visible
* select a cell in the first column and tab throught the cells
-> notice that the cell editor on fourth column is not scrolled into view

On a table that has only one fixed column, the problem is not reproducible.
Comment 1 Rüdiger Herrmann CLA 2011-12-06 10:09:31 EST
Created attachment 207996 [details]
Project to reproduce the bug
Comment 2 Ivan Furnadjiev CLA 2011-12-06 11:05:10 EST
TestCase:
public void testShowColumnWithFixedColumns() {
    Fixture.fakePhase( PhaseId.PROCESS_ACTION );
    int numColumns = 4;
    int columnWidth = 100;
    Table table = new Table( shell, SWT.NONE );
    table.setData( "fixedColumns", new Integer( 2 ) );
    table.setSize( columnWidth  * ( numColumns - 1 ), 100 );
    for( int i = 0; i < numColumns; i++ ) {
      TableColumn column = new TableColumn( table, SWT.NONE );
      column.setWidth( columnWidth );
    }

    table.showColumn( table.getColumn( 3 ) );

    ITableAdapter adapter = ( ITableAdapter )table.getAdapter( ITableAdapter.class );
    assertEquals( 100, adapter.getLeftOffset() );
  }
Comment 3 Ivan Furnadjiev CLA 2011-12-06 15:23:00 EST
Created attachment 208021 [details]
Proposed patch against Tree_Table_Merge branch with JUnit tests.

This patch fixes the scrolling issue and the position of the cell editors by always align the shown column left in the view-port.
Comment 4 Rüdiger Herrmann CLA 2011-12-07 06:35:24 EST
Applied patch from attachment 208021 [details] to tree_table_merge branch.
Comment 5 Rüdiger Herrmann CLA 2011-12-07 06:52:20 EST
Also applied patch from attachment 208021 [details] to HEAD.