Search in sources :

Example 1 with ScrollPositionHandler

use of com.vaadin.client.ScrollPositionHandler in project flow by vaadin.

the class GwtRouterLinkHandlerTest method gwtSetUp.

@Override
protected void gwtSetUp() throws Exception {
    super.gwtSetUp();
    invocations = JsCollections.array();
    ServerConnector connector = new ServerConnector(null) {

        @Override
        public void sendNavigationMessage(String location, Object stateObject, boolean routerLinkEvent) {
            invocations.push(location);
        }
    };
    UILifecycle lifecycle = new UILifecycle();
    lifecycle.setState(UIState.RUNNING);
    registry = new Registry() {

        {
            set(UILifecycle.class, lifecycle);
            set(ServerConnector.class, connector);
            set(MessageHandler.class, new MessageHandler(this));
            set(RequestResponseTracker.class, new RequestResponseTracker(this));
            set(ScrollPositionHandler.class, new ScrollPositionHandler(this));
        }
    };
    boundElement = Browser.getDocument().createDivElement();
    Browser.getDocument().getBody().appendChild(boundElement);
    RouterLinkHandler.bind(registry, boundElement);
}
Also used : ServerConnector(com.vaadin.client.communication.ServerConnector) ScrollPositionHandler(com.vaadin.client.ScrollPositionHandler) MessageHandler(com.vaadin.client.communication.MessageHandler) UILifecycle(com.vaadin.client.UILifecycle) Registry(com.vaadin.client.Registry) RequestResponseTracker(com.vaadin.client.communication.RequestResponseTracker)

Aggregations

Registry (com.vaadin.client.Registry)1 ScrollPositionHandler (com.vaadin.client.ScrollPositionHandler)1 UILifecycle (com.vaadin.client.UILifecycle)1 MessageHandler (com.vaadin.client.communication.MessageHandler)1 RequestResponseTracker (com.vaadin.client.communication.RequestResponseTracker)1 ServerConnector (com.vaadin.client.communication.ServerConnector)1