Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369804 - [Text] Selection is wrong after inserting a text
Summary: [Text] Selection is wrong after inserting a text
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-26 09:14 EST by Ivan Furnadjiev CLA
Modified: 2012-01-26 09:31 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.