Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369804

Summary: [Text] Selection is wrong after inserting a text
Product: [RT] RAP Reporter: Ivan Furnadjiev <ivan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 1.5 M5   
Hardware: All   
OS: All   
Whiteboard:

Description Ivan Furnadjiev CLA 2012-01-26 09:14:30 EST
When you insert a text, the selection and the caret position should be moved after the inserted text. Test case:
public void testSelectionAfterInsertText() {
  Text text = new Text( shell, SWT.NONE );
  text.setText( "foobar" );
  text.setSelection( 3 );

  text.insert( "xxx" );

  assertEquals( new Point( 6, 6 ), text.getSelection() );
}
Comment 1 Ivan Furnadjiev CLA 2012-01-26 09:31:29 EST
Set the selection in Text#insert. Changes are in CVS HEAD.