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

Bug 294641

Summary: [CoolItem] Index is messed up after inserting new items
Product: [RT] RAP Reporter: Benjamin Muskalla <b.muskalla>
Component: RWTAssignee: Ralf Zahn <ralf.zahn>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ruediger.herrmann
Version: 1.3   
Target Milestone: 1.3 M6   
Hardware: All   
OS: All   
Whiteboard:

Description Benjamin Muskalla CLA 2009-11-09 13:07:07 EST
Inserting new items before others is messed up as getItem returns the wrong item.


  public void testIndexOnCreation() throws Exception {
    Display display = new Display();
    Shell shell = new Shell( display, SWT.NONE );
    CoolBar coolBar = new CoolBar(shell, 0);
    CoolItem coolItem = new CoolItem(coolBar, 0);
    coolItem.setText( "1" );
    assertSame( coolItem, coolBar.getItem( 0 ) );
    CoolItem coolItem2 = new CoolItem(coolBar, 0, 0);
    coolItem2.setText( "2" );
    assertSame( coolItem2, coolBar.getItem( 0 ) );
  }
Comment 1 Ivan Furnadjiev CLA 2010-02-23 10:50:46 EST
The problem was in CoolBar#getItem( int ), which returned a wrong item when there is more than 1 row.