|
Lines 280-285
Link Here
|
| 280 |
assertEquals( column, event.getSource() ); |
280 |
assertEquals( column, event.getSource() ); |
| 281 |
} |
281 |
} |
| 282 |
|
282 |
|
|
|
283 |
public void testMoveEvent() { |
| 284 |
Fixture.fakePhase( PhaseId.PROCESS_ACTION ); |
| 285 |
final java.util.List log = new ArrayList(); |
| 286 |
Display display = new Display(); |
| 287 |
Shell shell = new Shell( display ); |
| 288 |
Table table = new Table( shell, SWT.NONE ); |
| 289 |
final TableColumn column = new TableColumn( table, SWT.NONE ); |
| 290 |
column.addControlListener( new ControlListener() { |
| 291 |
public void controlMoved( final ControlEvent event ) { |
| 292 |
fail( "unexpected event: controlMoved" ); |
| 293 |
} |
| 294 |
public void controlResized( final ControlEvent event ) { |
| 295 |
log.add( event ); |
| 296 |
} |
| 297 |
} ); |
| 298 |
final TableColumn column1 = new TableColumn( table, SWT.NONE ); |
| 299 |
column1.addControlListener( new ControlListener() { |
| 300 |
public void controlMoved( final ControlEvent event ) { |
| 301 |
log.add( event ); |
| 302 |
} |
| 303 |
public void controlResized( final ControlEvent event ) { |
| 304 |
fail( "unexpected event: controlResized" ); |
| 305 |
} |
| 306 |
} ); |
| 307 |
ControlEvent event; |
| 308 |
// Changing column width leads to resize event and move event of next |
| 309 |
// columns |
| 310 |
log.clear(); |
| 311 |
column.setWidth( column.getWidth() + 1 ); |
| 312 |
assertEquals( 2, log.size() ); |
| 313 |
event = ( ControlEvent )log.get( 0 ); |
| 314 |
assertSame( column, event.getSource() ); |
| 315 |
event = ( ControlEvent )log.get( 1 ); |
| 316 |
assertSame( column1, event.getSource() ); |
| 317 |
} |
| 318 |
|
| 283 |
public void testDisposeLast() { |
319 |
public void testDisposeLast() { |
| 284 |
Display display = new Display(); |
320 |
Display display = new Display(); |
| 285 |
Shell shell = new Shell( display ); |
321 |
Shell shell = new Shell( display ); |