/** This method is called when the dimensions of the parent element change. Subclasses should override this method as needed. * * Move the text to the center of the progress bar. * * @param width the new client width of the element * @param height the new client height of the element */ public void onResize (int width, int height) { if (textVisible) { int textWidth = DOM.getElementPropertyInt(textElement, "offsetWidth"); int left = (width / 2) - (textWidth / 2); DOM.setStyleAttribute(textElement, "left", left + "px"); } }
/** This method is called when the dimensions of the parent element change. Subclasses should override this method as needed. * * Move the text to the center of the progress bar. * * @param width the new client width of the element * @param height the new client height of the element */ public void onResize (int width, int height) { if (textVisible) { int textWidth = DOM.getElementPropertyInt(textElement, "offsetWidth"); int left = (width / 2) - (textWidth / 2); DOM.setStyleAttribute(textElement, "left", left + "px"); } }
/** Redraw the progress bar when something changes the layout. */ public void redraw () { if (isAttached()) { int width = DOM.getElementPropertyInt(getElement(), "clientWidth"); int height = DOM.getElementPropertyInt(getElement(), "clientHeight"); onResize(width, height); } }
/** Redraw the progress bar when something changes the layout. */ public void redraw () { if (isAttached()) { int width = DOM.getElementPropertyInt(getElement(), "clientWidth"); int height = DOM.getElementPropertyInt(getElement(), "clientHeight"); onResize(width, height); } }
/** * Returns the horizontal scroll position. * * @return the scroll position */ public int getScrollLeft() { return DOM.getElementPropertyInt(dom, "scrollLeft"); }
/** * Gets element height. * * @param element is an element * @return height in pizels. */ protected int getElementHeight(Element element) { return DOM.getElementPropertyInt(element, "offsetHeight"); }
/** * Returns the element's client height property. * * @return the client width value */ public int getClientHeight() { return DOM.getElementPropertyInt(dom, "clientHeight"); }
/** * Returns the current vertical scroll position. * * @return the scroll position */ public int getScrollTop() { return DOM.getElementPropertyInt(dom, "scrollTop"); }
/** * Gets the amount of padding that is added around all cells. * * @return the cell padding, in pixels */ public int getCellPadding() { return DOM.getElementPropertyInt(tableElem, "cellPadding"); }
/** * Gets the amount of spacing that is added around all cells. * * @return the cell spacing, in pixels */ public int getCellSpacing() { return DOM.getElementPropertyInt(tableElem, "cellSpacing"); }
/** * Gets the row index of a row element. * * @param tr the row element * @return the row index */ public static int getRowIndex(Element tr) { return DOM.getElementPropertyInt(tr, "rowIndex"); } }
/** * Returns the element's client width property. * * @return the client width value */ public int getClientWidth() { return DOM.getElementPropertyInt(dom, "clientWidth"); }
/** * Constructor. * * @param widget the widget that will be monitored */ public ResizableWidgetInfo(ResizableWidget widget) { curWidth = DOM.getElementPropertyInt(widget.getElement(), "clientWidth"); curHeight = DOM.getElementPropertyInt(widget.getElement(), "clientHeight"); }
/** * Gets the column span for the given cell. This is the number of logical * columns covered by the cell. * * @param row the cell's row * @param column the cell's column * @return the cell's column span * @throws IndexOutOfBoundsException */ public int getColSpan(int row, int column) { return DOM.getElementPropertyInt(getElement(row, column), "colSpan"); }
/** * Redraw the progress bar when something changes the layout. */ public void redraw() { if (isAttached()) { int width = DOM.getElementPropertyInt(getElement(), "clientWidth"); int height = DOM.getElementPropertyInt(getElement(), "clientHeight"); onResize(width, height); } }
/** Redraw the progress bar when something changes the layout. */ public void redraw () { if (isAttached()) { int width = DOM.getElementPropertyInt(getElement(), "clientWidth"); int height = DOM.getElementPropertyInt(getElement(), "clientHeight"); onResize(width, height); } }
/** * Construct a new {@link TableHeightInfo}. */ public TableHeightInfo() { int totalHeight = DOM.getElementPropertyInt(getElement(), "clientHeight"); headerTableHeight = headerTable.getOffsetHeight(); if (footerTable != null) { footerTableHeight = footerTable.getOffsetHeight(); } dataTableHeight = totalHeight - headerTableHeight - footerTableHeight; } }
@Override protected void onUpdate(double progress) { int scrollHeight = DOM.getElementPropertyInt(curPanel.content.getElement(), "scrollHeight"); int height = (int) (progress * scrollHeight); if (!opening) { height = scrollHeight - height; } height = Math.max(height, 1); DOM.setStyleAttribute(curPanel.content.getElement(), "height", height + "px"); DOM.setStyleAttribute(curPanel.content.getElement(), "width", "auto"); } }
private void updateFloatingCopysPosition(int x, int y) { x -= DOM.getElementPropertyInt(floatingCopyOfHeaderCell, "offsetWidth") / 2; floatingCopyOfHeaderCell.getStyle().setLeft(x, Unit.PX); if (y > 0) { floatingCopyOfHeaderCell.getStyle().setTop(y + 7, Unit.PX); } }
@Override public void onBrowserEvent(Event event) { if (enabled) { if (event.getEventTarget().cast() == columnSelector) { final int left = DOM.getAbsoluteLeft(columnSelector); final int top = DOM.getAbsoluteTop(columnSelector) + DOM.getElementPropertyInt(columnSelector, "offsetHeight"); client.getContextMenu().showAt(this, left, top); } } }