Package com.cedarsolutions.client.gwt.module.view.ModuleTabView

Examples of com.cedarsolutions.client.gwt.module.view.ModuleTabView.SelectionHandler


        TabLayoutPanel parentPanel = new TabLayoutPanel(10, Unit.CM);
        view.setContext(parentPanel, 1);
        view.setInitializationEventHandler(initHandler);
        view.setSelectedEventHandler(selectedHandler);

        SelectionHandler handler = new SelectionHandler(view);

        handler.onBeforeSelection(2);
        assertFalse(view.isInitialized());
        assertEquals(0, initHandler.calls);
        assertEquals(0, selectedHandler.calls);

        handler.onBeforeSelection(1);
        assertTrue(view.isInitialized());
        assertEquals(1, initHandler.calls);
        assertEquals(UnifiedEventType.INIT_EVENT, initHandler.lastType);
        assertEquals(1, selectedHandler.calls);
        assertEquals(UnifiedEventType.SELECTED_EVENT, selectedHandler.lastType);

        handler.disable();
        handler.onBeforeSelection(1);
        assertTrue(view.isInitialized());
        assertEquals(1, initHandler.calls);
        assertEquals(UnifiedEventType.INIT_EVENT, initHandler.lastType);
        assertEquals(1, selectedHandler.calls);
        assertEquals(UnifiedEventType.SELECTED_EVENT, selectedHandler.lastType);

        handler.enable();
        handler.onBeforeSelection(1);
        assertTrue(view.isInitialized());
        assertEquals(1, initHandler.calls);
        assertEquals(UnifiedEventType.INIT_EVENT, initHandler.lastType);
        assertEquals(2, selectedHandler.calls);
        assertEquals(UnifiedEventType.SELECTED_EVENT, selectedHandler.lastType);

        handler.onBeforeSelection(1);
        assertTrue(view.isInitialized());
        assertEquals(1, initHandler.calls);
        assertEquals(UnifiedEventType.INIT_EVENT, initHandler.lastType);
        assertEquals(3, selectedHandler.calls);
        assertEquals(UnifiedEventType.SELECTED_EVENT, selectedHandler.lastType);
View Full Code Here

TOP

Related Classes of com.cedarsolutions.client.gwt.module.view.ModuleTabView.SelectionHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.