Search in sources :

Example 26 with Element

use of com.google.gwt.user.client.Element in project GwtMobile by dennisjzh.

the class ScrollPanel method onDragEnd.

@Override
public void onDragEnd(DragEvent e) {
    Element widgetEle = getWidget().getElement();
    int current = getScrollPosition();
    if (current == 0) {
        return;
    }
    int panelHeight = Utils.getHeight(this.getElement());
    int widgetHeight = widgetEle.getOffsetHeight();
    if (//exceed top boundary
    current > 0 || panelHeight > widgetHeight) {
        Utils.setTransitionDuration(widgetEle, 500);
        setScrollPosition(0);
    } else if (-current + panelHeight > widgetHeight) {
        //exceed bottom boundary
        Utils.setTransitionDuration(widgetEle, 500);
        setScrollPosition(panelHeight - widgetHeight);
    }
}
Also used : Element(com.google.gwt.user.client.Element)

Example 27 with Element

use of com.google.gwt.user.client.Element in project GwtMobile by dennisjzh.

the class TextArea method onKeyUp.

@Override
public void onKeyUp(KeyUpEvent event) {
    Element ele = getElement();
    final int extraLineHeight = 15;
    int scrollHeight = ele.getScrollHeight();
    int clientHeight = ele.getClientHeight();
    Utils.Console(scrollHeight + " " + clientHeight);
    if (clientHeight < scrollHeight) {
        ele.getStyle().setHeight(scrollHeight + extraLineHeight, Unit.PX);
    }
}
Also used : Element(com.google.gwt.user.client.Element)

Aggregations

Element (com.google.gwt.user.client.Element)27 BlurEvent (com.google.gwt.event.dom.client.BlurEvent)1 BlurHandler (com.google.gwt.event.dom.client.BlurHandler)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)1 FormValidator (cz.metacentrum.perun.webgui.client.applicationresources.FormValidator)1 RegistrarFormItemGenerator (cz.metacentrum.perun.webgui.client.applicationresources.RegistrarFormItemGenerator)1