|
Lines 251-256
Link Here
|
| 251 |
table.getItem( 3 ).dispose(); |
251 |
table.getItem( 3 ).dispose(); |
| 252 |
} |
252 |
} |
| 253 |
assertEquals( 0, table.getTopIndex() ); |
253 |
assertEquals( 0, table.getTopIndex() ); |
|
|
254 |
|
| 255 |
// Ensure that topIndex is adjusted if it is bigger than item count |
| 256 |
table.removeAll(); |
| 257 |
for( int i = 0; i < 20; i++ ) { |
| 258 |
new TableItem( table, SWT.NONE ); |
| 259 |
} |
| 260 |
table.setTopIndex( 14 ); |
| 261 |
for( int i = 10; i < 20; i++ ) { |
| 262 |
table.getItem( 10 ).dispose(); |
| 263 |
} |
| 264 |
int itemCount = table.getItemCount(); |
| 265 |
int visibleItemCount = table.getVisibleItemCount( false ); |
| 266 |
assertEquals( itemCount - visibleItemCount - 1, table.getTopIndex() ); |
| 254 |
} |
267 |
} |
| 255 |
|
268 |
|
| 256 |
public void testDispose() { |
269 |
public void testDispose() { |
|
Lines 1429-1435
Link Here
|
| 1429 |
assertEquals( 0, table.getColumnOrder()[ 0 ] ); |
1442 |
assertEquals( 0, table.getColumnOrder()[ 0 ] ); |
| 1430 |
assertEquals( 1, table.getColumnOrder()[ 1 ] ); |
1443 |
assertEquals( 1, table.getColumnOrder()[ 1 ] ); |
| 1431 |
} |
1444 |
} |
| 1432 |
|
1445 |
|
| 1433 |
public void testRedrawAfterDisposeVirtual() { |
1446 |
public void testRedrawAfterDisposeVirtual() { |
| 1434 |
RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); |
1447 |
RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); |
| 1435 |
Display display = new Display(); |
1448 |
Display display = new Display(); |
|
Lines 1437-1443
Link Here
|
| 1437 |
Table table = new Table( shell, SWT.VIRTUAL ); |
1450 |
Table table = new Table( shell, SWT.VIRTUAL ); |
| 1438 |
table.setSize( 100, 100 ); |
1451 |
table.setSize( 100, 100 ); |
| 1439 |
table.setItemCount( 150 ); |
1452 |
table.setItemCount( 150 ); |
| 1440 |
// dispose the first item, this must cause a "redraw" which in turn triggers |
1453 |
// dispose the first item, this must cause a "redraw" which in turn triggers |
| 1441 |
// a SetData event to populate the newly appeared item at the bottom of the |
1454 |
// a SetData event to populate the newly appeared item at the bottom of the |
| 1442 |
// table |
1455 |
// table |
| 1443 |
table.getItem( 0 ).dispose(); |
1456 |
table.getItem( 0 ).dispose(); |