Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 208021 Details for
Bug 365747
[Table] Cell editors aren't scrolled into view on a Table with fixed columns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch against Tree_Table_Merge branch with JUnit tests.
Bug-365747-v14.patch (text/plain), 5.95 KB, created by
Ivan Furnadjiev
on 2011-12-06 15:23:00 EST
(
hide
)
Description:
Proposed patch against Tree_Table_Merge branch with JUnit tests.
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2011-12-06 15:23:00 EST
Size:
5.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/widgets/Table.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java,v >retrieving revision 1.100.2.1.2.9 >diff -u -r1.100.2.1.2.9 Table.java >--- src/org/eclipse/swt/widgets/Table.java 24 Jun 2011 13:21:25 -0000 1.100.2.1.2.9 >+++ src/org/eclipse/swt/widgets/Table.java 6 Dec 2011 20:17:09 -0000 >@@ -1605,20 +1605,35 @@ > int index = indexOf( column ); > if( 0 <= index && index < getColumnCount() ) { > int leftColumnsWidth = 0; >+ int rightColumnsWidth = 0; > int columnWidth = column.getWidth(); > int clientWidth = getClientArea().width; > int[] columnOrder = getColumnOrder(); > boolean found = false; >- for( int i = 0; i < columnOrder.length && !found; i++ ) { >- found = index == columnOrder[ i ]; >- if( !found && !isFixedColumn( i ) ) { >- leftColumnsWidth += getColumn( columnOrder[ i ] ).getWidth(); >+ for( int i = 0; i < columnOrder.length; i++ ) { >+ if( index != columnOrder[ i ] ) { >+ int currentColumnWidth = getColumn( columnOrder[ i ] ).getWidth(); >+ if( found ) { >+ rightColumnsWidth += currentColumnWidth; >+ } else { >+ if( isFixedColumn( columnOrder[ i ] ) ) { >+ clientWidth -= currentColumnWidth; >+ } else { >+ leftColumnsWidth += currentColumnWidth; >+ } >+ } >+ } else { >+ found = true; > } > } > if( getColumnLeftOffset( index ) > leftColumnsWidth ) { > leftOffset = leftColumnsWidth; > } else if( leftOffset < leftColumnsWidth + columnWidth - clientWidth ) { >- leftOffset = leftColumnsWidth + columnWidth - clientWidth; >+ if( columnWidth + rightColumnsWidth < clientWidth ) { >+ leftOffset = leftColumnsWidth + columnWidth + rightColumnsWidth - clientWidth; >+ } else { >+ leftOffset = leftColumnsWidth; >+ } > } > } > } >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/widgets/Table_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/swt/widgets/Table_Test.java,v >retrieving revision 1.72.2.1.2.2 >diff -u -r1.72.2.1.2.2 Table_Test.java >--- src/org/eclipse/swt/widgets/Table_Test.java 24 Jun 2011 13:04:25 -0000 1.72.2.1.2.2 >+++ src/org/eclipse/swt/widgets/Table_Test.java 6 Dec 2011 20:17:10 -0000 >@@ -2183,21 +2183,16 @@ > > public void testShowColumn() { > Fixture.fakePhase( PhaseId.PROCESS_ACTION ); >- shell.setSize( 800, 600 ); > Table table = new Table( shell, SWT.NONE ); >- table.setSize( 300, 100 ); >+ table.setSize( 325, 100 ); > for( int i = 0; i < 10; i++ ) { > TableColumn column = new TableColumn( table, SWT.NONE ); > column.setWidth( 50 ); > } >- for( int i = 0; i < 10; i++ ) { >- new TableItem( table, SWT.NONE ); >- } >- ITableAdapter adapter >- = ( ITableAdapter )table.getAdapter( ITableAdapter.class ); >+ ITableAdapter adapter = ( ITableAdapter )table.getAdapter( ITableAdapter.class ); > assertEquals( 0, adapter.getLeftOffset() ); > table.showColumn( table.getColumn( 8 ) ); >- assertEquals( 165, adapter.getLeftOffset() ); >+ assertEquals( 175, adapter.getLeftOffset() ); > table.showColumn( table.getColumn( 1 ) ); > assertEquals( 50, adapter.getLeftOffset() ); > table.showColumn( table.getColumn( 3 ) ); >@@ -2222,7 +2217,7 @@ > table.showColumn( table.getColumn( 8 ) ); > assertEquals( 0, adapter.getLeftOffset() ); > table.showColumn( table.getColumn( 5 ) ); >- assertEquals( 115, adapter.getLeftOffset() ); >+ assertEquals( 125, adapter.getLeftOffset() ); > } > > public void testShowFixedColumn() { >@@ -2243,24 +2238,41 @@ > assertEquals( 100, adapter.getLeftOffset() ); > } > >- public void testShowColumnBehindFixedColumn() { >+ public void testShowColumnWithFixedColumns_ScrolledToLeft() { > Fixture.fakePhase( PhaseId.PROCESS_ACTION ); >- shell.setSize( 800, 600 ); > Table table = createFixedColumnsTable(); >- table.setSize( 300, 100 ); >- for( int i = 0; i < 10; i++ ) { >+ int numColumns = 4; >+ int columnWidth = 100; >+ table.setSize( columnWidth * ( numColumns - 1 ), 100 ); >+ for( int i = 0; i < numColumns; i++ ) { > TableColumn column = new TableColumn( table, SWT.NONE ); >- column.setWidth( 50 ); >- } >- for( int i = 0; i < 10; i++ ) { >- new TableItem( table, SWT.NONE ); >+ column.setWidth( columnWidth ); > } > ITableAdapter adapter = ( ITableAdapter )table.getAdapter( ITableAdapter.class ); > adapter.setLeftOffset( 100 ); >- table.showColumn( table.getColumn( 1 ) ); >+ >+ table.showColumn( table.getColumn( 2 ) ); >+ > assertEquals( 0, adapter.getLeftOffset() ); > } > >+ public void testShowColumnWithFixedColumns_ScrolledToRight() { >+ Fixture.fakePhase( PhaseId.PROCESS_ACTION ); >+ int numColumns = 4; >+ int columnWidth = 100; >+ Table table = createFixedColumnsTable(); >+ 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() ); >+ } >+ > public void testScrollBars() { > Table table = new Table( shell, SWT.NONE ); > assertNotNull( table.getHorizontalBar() ); >@@ -2382,7 +2394,7 @@ > > private Table createFixedColumnsTable() { > Table table = new Table( shell, SWT.NONE ); >- table.setData( "fixedColumns", new Integer( 1 ) ); >+ table.setData( "fixedColumns", new Integer( 2 ) ); > return table; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 365747
:
207996
| 208021