|
Lines 16-23
Link Here
|
| 16 |
import org.eclipse.rwt.lifecycle.PhaseId; |
16 |
import org.eclipse.rwt.lifecycle.PhaseId; |
| 17 |
import org.eclipse.swt.RWTFixture; |
17 |
import org.eclipse.swt.RWTFixture; |
| 18 |
import org.eclipse.swt.SWT; |
18 |
import org.eclipse.swt.SWT; |
| 19 |
import org.eclipse.swt.events.ModifyEvent; |
19 |
import org.eclipse.swt.events.*; |
| 20 |
import org.eclipse.swt.events.ModifyListener; |
|
|
| 21 |
import org.eclipse.swt.graphics.Point; |
20 |
import org.eclipse.swt.graphics.Point; |
| 22 |
import org.eclipse.swt.widgets.*; |
21 |
import org.eclipse.swt.widgets.*; |
| 23 |
|
22 |
|
|
Lines 537-542
Link Here
|
| 537 |
expected = new Point( 100, 100 ); |
536 |
expected = new Point( 100, 100 ); |
| 538 |
assertEquals( expected, combo.computeSize( 100, 100 ) ); |
537 |
assertEquals( expected, combo.computeSize( 100, 100 ) ); |
| 539 |
} |
538 |
} |
|
|
539 |
|
| 540 |
public void testSetTextAndSelection() throws Exception { |
| 541 |
RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); |
| 542 |
Display display = new Display(); |
| 543 |
Shell shell = new Shell( display, SWT.NONE ); |
| 544 |
final CCombo combo = new CCombo( shell, SWT.NONE ); |
| 545 |
combo.add( "test" ); |
| 546 |
combo.add( "test1" ); |
| 547 |
combo.add( "test2" ); |
| 548 |
combo.addVerifyListener( new VerifyListener() { |
| 549 |
public void verifyText( VerifyEvent event ) { |
| 550 |
event.text = event.text + "2"; |
| 551 |
} |
| 552 |
} ); |
| 553 |
combo.setText( "test" ); |
| 554 |
assertEquals( 2, combo.getSelectionIndex() ); |
| 555 |
} |
| 540 |
|
556 |
|
| 541 |
protected void setUp() throws Exception { |
557 |
protected void setUp() throws Exception { |
| 542 |
RWTFixture.setUp(); |
558 |
RWTFixture.setUp(); |