Package com.cedarsolutions.client.gwt.event

Examples of com.cedarsolutions.client.gwt.event.UnifiedEvent


        when(presenter.getDefaultCriteria()).thenReturn(criteria);
        when(presenter.getRenderer()).thenReturn(renderer);
        when(presenter.createDataSource()).thenReturn(null);

        BackendDataInitializeHandler<String, String> handler = new BackendDataInitializeHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event);

        // Criteria will be set, but nothing else happens
        verify(renderer).setSearchCriteria(criteria);
        verify(presenter, times(0)).setDataSource(isA(BackendDataSource.class));
View Full Code Here


        IBackendDataPresenter<String, String> presenter = mock(IBackendDataPresenter.class);
        when(presenter.createDataSource()).thenReturn(dataSource);
        when(presenter.getDataSource()).thenReturn(dataSource); // for consistency

        BackendDataInitializeHandler<String, String> handler = new BackendDataInitializeHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event);

        // Data source will be set, but nothing else happens
        verify(presenter).setDataSource(dataSource);
        verify(presenter, times(0)).getDefaultCriteria();
View Full Code Here

        when(presenter.getRenderer()).thenReturn(renderer);
        when(presenter.createDataSource()).thenReturn(dataSource);
        when(presenter.getDataSource()).thenReturn(dataSource); // for consistency

        BackendDataInitializeHandler<String, String> handler = new BackendDataInitializeHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event);

        // Criteria will be set first, then data source set, but no display will be configured
        InOrder order = inOrder(presenter, renderer);
        order.verify(renderer).setSearchCriteria(criteria);
View Full Code Here

        when(presenter.getRenderer()).thenReturn(renderer);
        when(presenter.createDataSource()).thenReturn(dataSource);
        when(presenter.getDataSource()).thenReturn(dataSource); // for consistency

        BackendDataInitializeHandler<String, String> handler = new BackendDataInitializeHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event);

        // Criteria will be set first, then data source and displasy will be configured
        InOrder order = inOrder(presenter, renderer, dataProvider);
        order.verify(renderer).setSearchCriteria(criteria);
View Full Code Here

        String criteria = "criteria";
        IBackendDataPresenter<String, String> presenter = mock(IBackendDataPresenter.class);
        when(presenter.getDefaultCriteria()).thenReturn(criteria);

        BackendDataCriteriaResetHandler<String, String> handler = new BackendDataCriteriaResetHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event);
    }
View Full Code Here

        IBackendDataPresenter<String, String> presenter = mock(IBackendDataPresenter.class);
        when(presenter.getDefaultCriteria()).thenReturn(criteria);
        when(presenter.getRenderer()).thenReturn(renderer);

        BackendDataCriteriaResetHandler<String, String> handler = new BackendDataCriteriaResetHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event);

        verify(renderer).setSearchCriteria(criteria);
        verify(renderer, times(1)).getRefreshEventHandler();
    }
View Full Code Here

        IBackendDataPresenter<String, String> presenter = mock(IBackendDataPresenter.class);
        when(presenter.getDefaultCriteria()).thenReturn(criteria);
        when(presenter.getRenderer()).thenReturn(renderer);

        BackendDataCriteriaResetHandler<String, String> handler = new BackendDataCriteriaResetHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event);

        verify(renderer).setSearchCriteria(criteria);
        verify(refreshHandler).handleEvent(event);
    }
View Full Code Here

        BackendDataSource<String, String> dataSource = mock(BackendDataSource.class);
        IBackendDataPresenter<String, String> presenter = mock(IBackendDataPresenter.class);
        when(presenter.getDataSource()).thenReturn(dataSource);

        BackendDataRefreshHandler<String, String> handler = new BackendDataRefreshHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event)// just make sure it doesn't blow up
    }
View Full Code Here

        BackendDataSource<String, String> dataSource = mock(BackendDataSource.class);
        IBackendDataPresenter<String, String> presenter = mock(IBackendDataPresenter.class);
        when(presenter.getDataSource()).thenReturn(dataSource);

        BackendDataRefreshHandler<String, String> handler = new BackendDataRefreshHandler<String, String>(presenter);
        UnifiedEvent event = new UnifiedEvent((UnifiedEventType) null)// doesn't matter what contents are
        handler.handleEvent(event);

        verify(dataSource).clear();
    }
View Full Code Here

    /** Select the tab, as if the normal BeforeSelectionHandler was invoked. */
    @Override
    public void selectTab() {
        if (!this.isInitialized()) {
            if (this.getInitializationEventHandler() != null) {
                UnifiedEvent init = new UnifiedEvent(UnifiedEventType.INIT_EVENT);
                this.getInitializationEventHandler().handleEvent(init);
            }

            this.markInitialized();
        }

        // The selected event handler is always called, even when initialize is also called.
        // That way, the client doesn't need any special logic for the "selected first time" case.
        if (this.getSelectedEventHandler() != null) {
            UnifiedEvent selected = new UnifiedEvent(UnifiedEventType.SELECTED_EVENT);
            this.getSelectedEventHandler().handleEvent(selected);
        }

        if (this.getHistoryToken() != null) {
            History.newItem(this.getHistoryToken(), false);
View Full Code Here

TOP

Related Classes of com.cedarsolutions.client.gwt.event.UnifiedEvent

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.