List of usage examples for com.vaadin.client WidgetUtil measureVerticalBorder
public static int measureVerticalBorder(Element element)
From source file:org.tltv.gantt.client.GanttConnector.java
License:Apache License
void updateDelegateTargetHeight() { if (delegateScrollTableTarget == null) { return;//from w w w.ja va 2 s . c o m } int headerHeight = 0; if (delegateScrollTableTarget.tHead != null) { // update table header height to match the Gantt widget's header // height int border = WidgetUtil.measureVerticalBorder(delegateScrollTableTarget.tHead.getElement()); headerHeight = getWidget().getTimelineHeight(); delegateScrollTableTarget.tHead.setHeight(Math.max(0, headerHeight - border) + "px"); } int border = WidgetUtil.measureVerticalBorder(delegateScrollPanelTarget.getElement()); // Adjust table's scroll container height to match the Gantt widget's // scroll container height. int newTableScrollContainerHeight = getWidget().getScrollContainerHeight(); boolean tableHorScrollbarVisible = border >= WidgetUtil.getNativeScrollbarSize(); if (getWidget().isContentOverflowingHorizontally()) { getWidget().hideHorizontalScrollbarSpacer(); if (tableHorScrollbarVisible) { newTableScrollContainerHeight += WidgetUtil.getNativeScrollbarSize(); } } else { if (tableHorScrollbarVisible) { getWidget().showHorizontalScrollbarSpacer(); } else { getWidget().hideHorizontalScrollbarSpacer(); } } delegateScrollPanelTarget.setHeight(Math.max(0, newTableScrollContainerHeight) + "px"); getLayoutManager().setNeedsMeasure((ComponentConnector) getState().verticalScrollDelegateTarget); }