| Summary: | [CoolItem] Index is messed up after inserting new items | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Benjamin Muskalla <b.muskalla> |
| Component: | RWT | Assignee: | 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: | |||
The problem was in CoolBar#getItem( int ), which returned a wrong item when there is more than 1 row. |
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 ) ); }