use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ViewportLayerFixture in project nebula.widgets.nattable by eclipse.
the class HorizontalScrollBarHandlerTest method issueNTBL99MoveByColumn.
/*
* Test for issue reported in http://nattable.org/jira/browse/NTBL-99.
* Resizing the last column to be larger than the width of a table and
* scrolling to the right results in a all white background and no columns
*
* COLUMNS 0 1 |------|------| 250 250
*/
@Test
public void issueNTBL99MoveByColumn() throws Exception {
this.viewport = new ViewportLayerFixture(2, 1, 250, 40);
this.scrollHandler = new HorizontalScrollBarHandler(this.viewport, this.scrollBar);
assertEquals(200, this.viewport.getClientAreaWidth());
assertEquals(1, this.viewport.getColumnCount());
assertEquals(0, this.viewport.getColumnIndexByPosition(0));
scrollViewportByOffset(200);
assertEquals(0, this.viewport.getColumnIndexByPosition(0));
scrollViewportByOffset(200);
assertEquals(1, this.viewport.getColumnIndexByPosition(0));
// No more scrolling
scrollViewportByOffset(200);
assertEquals(1, this.viewport.getColumnIndexByPosition(0));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ViewportLayerFixture in project nebula.widgets.nattable by eclipse.
the class HorizontalScrollBarHandlerTest method horizontalScrollbarThumbSizeCalcNoScrollingNeeded.
@Test
public void horizontalScrollbarThumbSizeCalcNoScrollingNeeded() throws Exception {
this.viewport = new ViewportLayerFixture(new Rectangle(0, 0, 500, 500));
this.scrollHandler = new HorizontalScrollBarHandler(this.viewport, this.scrollBar);
this.scrollHandler.recalculateScrollBarSize();
assertEquals(465, this.viewport.getWidth());
assertEquals(465, this.scrollHandler.scroller.getThumb());
assertFalse(this.scrollBar.isEnabled());
assertFalse(this.scrollBar.isVisible());
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ViewportLayerFixture in project nebula.widgets.nattable by eclipse.
the class HorizontalScrollBarHandlerTest method horizontalScrollbarThumbSize.
@Test
public void horizontalScrollbarThumbSize() throws Exception {
this.viewport = new ViewportLayerFixture(new Rectangle(0, 0, 250, 100));
this.scrollHandler = new HorizontalScrollBarHandler(this.viewport, this.scrollBar);
assertEquals(250, this.viewport.getWidth());
this.scrollHandler.recalculateScrollBarSize();
// Fixture data - viewport (250px), scrollable(465px)
assertEquals(250, this.scrollHandler.scroller.getThumb());
this.viewport.moveColumnPositionIntoViewport(9);
assertEquals(250, this.scrollHandler.scroller.getThumb());
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.ViewportLayerFixture in project nebula.widgets.nattable by eclipse.
the class VerticalScrollBarHandlerTest method init.
@Before
public void init() {
this.viewport = new ViewportLayerFixture();
this.scrollBar = ViewportLayerFixture.DEFAULT_SCROLLABLE.getVerticalBar();
this.scrollHandler = new VerticalScrollBarHandler(this.viewport, this.scrollBar);
assertEquals(0, this.viewport.getRowIndexByPosition(0));
assertEquals(1, this.viewport.getRowIndexByPosition(1));
}
Aggregations