Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 276675 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java (-3 / +4 lines)
Lines 168-174 Link Here
168
          newSelection[ i ] = Integer.parseInt( selectedIndices[ i ] );
168
          newSelection[ i ] = Integer.parseInt( selectedIndices[ i ] );
169
        }
169
        }
170
      }
170
      }
171
      table.setSelection( newSelection );
171
      table.deselectAll();
172
      table.select( newSelection );
172
    }
173
    }
173
  }
174
  }
174
175
Lines 215-221 Link Here
215
216
216
  private static void readWidgetSelected( final Table table ) {
217
  private static void readWidgetSelected( final Table table ) {
217
    if( WidgetLCAUtil.wasEventSent( table, JSConst.EVENT_WIDGET_SELECTED ) ) {
218
    if( WidgetLCAUtil.wasEventSent( table, JSConst.EVENT_WIDGET_SELECTED ) ) {
218
      // TODO [rh] do something reasonable when index points to unresolved item 
219
      // TODO [rh] do something reasonable when index points to unresolved item
219
      int index = getWidgetSelectedIndex();
220
      int index = getWidgetSelectedIndex();
220
      // Bugfix: check if index is valid before firing event to avoid problems
221
      // Bugfix: check if index is valid before firing event to avoid problems
221
      //         with fast scrolling
222
      //         with fast scrolling
Lines 382-388 Link Here
382
      writer.call( "setScrollBarsVisibile", args );
383
      writer.call( "setScrollBarsVisibile", args );
383
    }
384
    }
384
  }
385
  }
385
  
386
386
  //////////////////
387
  //////////////////
387
  // Helping methods
388
  // Helping methods
388
389
(-)src/org/eclipse/swt/internal/widgets/tablekit/TableLCA_Test.java (+20 lines)
Lines 752-757 Link Here
752
    assertEquals( 5, tableAdapter.getFocusIndex() );
752
    assertEquals( 5, tableAdapter.getFocusIndex() );
753
  }
753
  }
754
754
755
  public void testReadTopIndex() {
756
    Display display = new Display();
757
    Shell shell = new Shell( display );
758
    Table table = new Table( shell, SWT.MULTI );
759
    table.setSize( 485, 485 );
760
    for( int i = 0; i < 115; i++ ) {
761
      new TableItem( table, SWT.NONE );
762
    }
763
    String tableId = WidgetUtil.getId( table );
764
    String indices = "114,70,71,72,73,74,75,76,77,78,79,80,81,82,83,"
765
      + "84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,"
766
      + "99,100,101,102,103,104,105,106,107,108,109,"
767
      + "110,111,112,113,0";
768
    Fixture.fakeRequestParam( tableId + ".topIndex", "0" );
769
    Fixture.fakeRequestParam( tableId + ".selection", indices );
770
    TableLCA tableLCA = new TableLCA();
771
    tableLCA.readData( table );
772
    assertEquals( 0, table.getTopIndex() );
773
  }
774
755
  protected void setUp() throws Exception {
775
  protected void setUp() throws Exception {
756
    RWTFixture.setUp();
776
    RWTFixture.setUp();
757
  }
777
  }

Return to bug 276675