use of org.eclipse.nebula.widgets.nattable.viewport.VerticalScrollBarHandler in project nebula.widgets.nattable by eclipse.
the class VerticalScrollBarHandlerTest method verticalScrollbarThumbSizeCalcNoScrollingNeeded.
@Test
public void verticalScrollbarThumbSizeCalcNoScrollingNeeded() throws Exception {
this.viewport = new ViewportLayerFixture(new Rectangle(0, 0, 500, 500));
this.scrollHandler = new VerticalScrollBarHandler(this.viewport, this.scrollBar);
assertEquals(465, this.viewport.getWidth());
assertEquals(465, this.viewport.getWidth());
this.scrollHandler.recalculateScrollBarSize();
assertEquals(365, this.scrollHandler.scroller.getThumb());
assertFalse(this.scrollBar.isEnabled());
assertFalse(this.scrollBar.isVisible());
}
use of org.eclipse.nebula.widgets.nattable.viewport.VerticalScrollBarHandler in project nebula.widgets.nattable by eclipse.
the class VerticalScrollBarHandlerTest method verticalScrollbarThumbSize.
@Test
public void verticalScrollbarThumbSize() throws Exception {
this.viewport = new ViewportLayerFixture(new Rectangle(0, 0, 250, 100));
this.scrollHandler = new VerticalScrollBarHandler(this.viewport, this.scrollBar);
assertEquals(250, this.viewport.getWidth());
this.scrollHandler.recalculateScrollBarSize();
// Fixture data - viewport height (100px), scrollable height (365px)
// No overhang
assertEquals(100, this.scrollHandler.scroller.getThumb());
this.viewport.moveRowPositionIntoViewport(5);
assertEquals(100, this.scrollHandler.scroller.getThumb());
}
use of org.eclipse.nebula.widgets.nattable.viewport.VerticalScrollBarHandler 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