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 137483 Details for
Bug 278193
[Table] TopIndex is not correct after items removal
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.
Bug-278193.patch (text/plain), 2.67 KB, created by
Ivan Furnadjiev
on 2009-05-28 09:46:18 EDT
(
hide
)
Description:
Proposed patch.
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2009-05-28 09:46:18 EDT
Size:
2.67 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.48 >diff -u -r1.48 Table_Test.java >--- src/org/eclipse/swt/widgets/Table_Test.java 27 May 2009 12:25:02 -0000 1.48 >+++ src/org/eclipse/swt/widgets/Table_Test.java 28 May 2009 13:45:12 -0000 >@@ -251,6 +251,19 @@ > table.getItem( 3 ).dispose(); > } > assertEquals( 0, table.getTopIndex() ); >+ >+ // Ensure that topIndex is adjusted if it is bigger than item count >+ table.removeAll(); >+ for( int i = 0; i < 20; i++ ) { >+ new TableItem( table, SWT.NONE ); >+ } >+ table.setTopIndex( 14 ); >+ for( int i = 10; i < 20; i++ ) { >+ table.getItem( 10 ).dispose(); >+ } >+ int itemCount = table.getItemCount(); >+ int visibleItemCount = table.getVisibleItemCount( false ); >+ assertEquals( itemCount - visibleItemCount - 1, table.getTopIndex() ); > } > > public void testDispose() { >@@ -1429,7 +1442,7 @@ > assertEquals( 0, table.getColumnOrder()[ 0 ] ); > assertEquals( 1, table.getColumnOrder()[ 1 ] ); > } >- >+ > public void testRedrawAfterDisposeVirtual() { > RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); > Display display = new Display(); >@@ -1437,7 +1450,7 @@ > Table table = new Table( shell, SWT.VIRTUAL ); > table.setSize( 100, 100 ); > table.setItemCount( 150 ); >- // dispose the first item, this must cause a "redraw" which in turn triggers >+ // dispose the first item, this must cause a "redraw" which in turn triggers > // a SetData event to populate the newly appeared item at the bottom of the > // table > table.getItem( 0 ).dispose(); >#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.67 >diff -u -r1.67 Table.java >--- src/org/eclipse/swt/widgets/Table.java 27 May 2009 12:25:01 -0000 1.67 >+++ src/org/eclipse/swt/widgets/Table.java 28 May 2009 13:45:15 -0000 >@@ -2345,12 +2345,9 @@ > } > > private void adjustTopIndex() { >- if( topIndex > itemCount - 1 ) { >- if( needsVScrollBar() ) { >- topIndex = Math.max( 0, itemCount - 1 ); >- } else { >- topIndex = 0; >- } >+ int visibleItemCount = getVisibleItemCount( false ); >+ if( topIndex > itemCount - visibleItemCount - 1 ) { >+ topIndex = Math.max( 0, itemCount - visibleItemCount - 1 ); > } > } >
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 278193
: 137483