|
Lines 13-18
Link Here
|
| 13 |
import junit.framework.TestCase; |
13 |
import junit.framework.TestCase; |
| 14 |
|
14 |
|
| 15 |
import org.eclipse.rwt.graphics.Graphics; |
15 |
import org.eclipse.rwt.graphics.Graphics; |
|
|
16 |
import org.eclipse.rwt.internal.lifecycle.RWTLifeCycle; |
| 16 |
import org.eclipse.rwt.lifecycle.PhaseId; |
17 |
import org.eclipse.rwt.lifecycle.PhaseId; |
| 17 |
import org.eclipse.swt.*; |
18 |
import org.eclipse.swt.*; |
| 18 |
import org.eclipse.swt.events.*; |
19 |
import org.eclipse.swt.events.*; |
|
Lines 329-344
Link Here
|
| 329 |
} |
330 |
} |
| 330 |
} |
331 |
} |
| 331 |
|
332 |
|
| 332 |
private static boolean find( final int element, final int[] array ) { |
|
|
| 333 |
boolean result = false; |
| 334 |
for( int i = 0; i < array.length; i++ ) { |
| 335 |
if( element == array[ i ] ) { |
| 336 |
result = true; |
| 337 |
} |
| 338 |
} |
| 339 |
return result; |
| 340 |
} |
| 341 |
|
| 342 |
public void testReduceSetItemCountWithSelection() { |
333 |
public void testReduceSetItemCountWithSelection() { |
| 343 |
// Create a table that is populated with setItemCount with all selected |
334 |
// Create a table that is populated with setItemCount with all selected |
| 344 |
RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); |
335 |
RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); |
|
Lines 1438-1443
Link Here
|
| 1438 |
assertEquals( 0, table.getColumnOrder()[ 0 ] ); |
1429 |
assertEquals( 0, table.getColumnOrder()[ 0 ] ); |
| 1439 |
assertEquals( 1, table.getColumnOrder()[ 1 ] ); |
1430 |
assertEquals( 1, table.getColumnOrder()[ 1 ] ); |
| 1440 |
} |
1431 |
} |
|
|
1432 |
|
| 1433 |
public void testRedrawAfterDisposeVirtual() { |
| 1434 |
RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); |
| 1435 |
Display display = new Display(); |
| 1436 |
Shell shell = new Shell( display ); |
| 1437 |
Table table = new Table( shell, SWT.VIRTUAL ); |
| 1438 |
table.setSize( 100, 100 ); |
| 1439 |
table.setItemCount( 150 ); |
| 1440 |
// 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 |
| 1442 |
// table |
| 1443 |
table.getItem( 0 ).dispose(); |
| 1444 |
assertTrue( RWTLifeCycle.needsFakeRedraw( table ) ); |
| 1445 |
} |
| 1441 |
|
1446 |
|
| 1442 |
public void testSetColumnOrderWithInvalidArguments() { |
1447 |
public void testSetColumnOrderWithInvalidArguments() { |
| 1443 |
Display display = new Display(); |
1448 |
Display display = new Display(); |
|
Lines 2190-2195
Link Here
|
| 2190 |
table.remove( 5 ); |
2195 |
table.remove( 5 ); |
| 2191 |
} |
2196 |
} |
| 2192 |
|
2197 |
|
|
|
2198 |
private static boolean find( final int element, final int[] array ) { |
| 2199 |
boolean result = false; |
| 2200 |
for( int i = 0; i < array.length; i++ ) { |
| 2201 |
if( element == array[ i ] ) { |
| 2202 |
result = true; |
| 2203 |
} |
| 2204 |
} |
| 2205 |
return result; |
| 2206 |
} |
| 2207 |
|
| 2193 |
private static int countResolvedItems( final Table table ) { |
2208 |
private static int countResolvedItems( final Table table ) { |
| 2194 |
Object adapter = table.getAdapter( ITableAdapter.class ); |
2209 |
Object adapter = table.getAdapter( ITableAdapter.class ); |
| 2195 |
ITableAdapter tableAdapter = ( ITableAdapter )adapter; |
2210 |
ITableAdapter tableAdapter = ( ITableAdapter )adapter; |