Search in sources :

Example 1 with MouseMoveHandler

use of com.google.gwt.event.dom.client.MouseMoveHandler in project gerrit by GerritCodeReview.

the class DraftBox method initResizeHandler.

private void initResizeHandler() {
    resizeTimer = new Timer() {

        @Override
        public void run() {
            getCommentGroup().resize();
        }
    };
    addDomHandler(new MouseMoveHandler() {

        @Override
        public void onMouseMove(MouseMoveEvent event) {
            int h = editArea.getOffsetHeight();
            if (isEdit() && h != editAreaHeight) {
                getCommentGroup().resize();
                resizeTimer.scheduleRepeating(50);
                editAreaHeight = h;
            }
        }
    }, MouseMoveEvent.getType());
    addDomHandler(new MouseUpHandler() {

        @Override
        public void onMouseUp(MouseUpEvent event) {
            resizeTimer.cancel();
            getCommentGroup().resize();
        }
    }, MouseUpEvent.getType());
}
Also used : Timer(com.google.gwt.user.client.Timer) MouseMoveEvent(com.google.gwt.event.dom.client.MouseMoveEvent) MouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler) MouseUpEvent(com.google.gwt.event.dom.client.MouseUpEvent) MouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler)

Aggregations

MouseMoveEvent (com.google.gwt.event.dom.client.MouseMoveEvent)1 MouseMoveHandler (com.google.gwt.event.dom.client.MouseMoveHandler)1 MouseUpEvent (com.google.gwt.event.dom.client.MouseUpEvent)1 MouseUpHandler (com.google.gwt.event.dom.client.MouseUpHandler)1 Timer (com.google.gwt.user.client.Timer)1