Package org.zanata.webtrans.client.events

Examples of org.zanata.webtrans.client.events.FilterViewEvent


                        currentHistoryState.isFilterHasError())
                || editorFilterChanged) {
            Log.info("[gwt-history] message filter has changed");

            eventBus.fireEvent(UserConfigChangeEvent.EDITOR_CONFIG_CHANGE_EVENT);
            eventBus.fireEvent(new FilterViewEvent(token.isFilterTranslated(),
                    token.isFilterFuzzy(), token.isFilterUntranslated(), token
                            .isFilterApproved(), token.isFilterRejected(),
                    token.isFilterHasError(), newEditorToken, false));
        }
    }
View Full Code Here


        hideFilterConfirmationAndDoFiltering();
    }

    @Override
    public void cancelFilter() {
        eventBus.fireEvent(new FilterViewEvent(previousFilterOptions
                .isFilterTranslated(), previousFilterOptions.isFilterFuzzy(),
                previousFilterOptions.isFilterUntranslated(),
                previousFilterOptions.isFilterApproved(), previousFilterOptions
                        .isFilterRejected(), previousFilterOptions
                        .isFilterHasError(), previousFilterOptions
View Full Code Here

        presenter.onRevealDisplay();
    }

    @Test
    public void willSetOptionsBackOnFilterViewCancelEvent() {
        FilterViewEvent event =
                new FilterViewEvent(true, true, true, true, true, false,
                        EditorFilter.ALL, true);
        HistoryToken historyToken = new HistoryToken();
        when(history.getHistoryToken()).thenReturn(historyToken);

        presenter.onFilterView(event);

        verify(display).setTranslatedFilter(event.isFilterUntranslated());
        verify(display).setNeedReviewFilter(event.isFilterTranslated());
        verify(display).setUntranslatedFilter(event.isFilterFuzzy());
        verify(display).setApprovedFilter(event.isFilterApproved());
        verify(display).setRejectedFilter(event.isFilterRejected());

        assertThat(historyToken.isFilterUntranslated(),
                Matchers.equalTo(event.isFilterUntranslated()));
        assertThat(historyToken.isFilterTranslated(),
                Matchers.equalTo(event.isFilterTranslated()));
        assertThat(historyToken.isFilterFuzzy(),
                Matchers.equalTo(event.isFilterFuzzy()));
        assertThat(historyToken.isFilterApproved(),
                Matchers.equalTo(event.isFilterApproved()));
        assertThat(historyToken.isFilterRejected(),
                Matchers.equalTo(event.isFilterRejected()));
        assertThat(historyToken.isFilterHasError(),
                Matchers.equalTo(event.isFilterHasError()));
    }
View Full Code Here

                Matchers.equalTo(event.isFilterHasError()));
    }

    @Test
    public void willUpdateSearchTermIfItsNotCancelEvent() {
        FilterViewEvent cancelEvent =
                new FilterViewEvent(true, true, true, true, true, false,
                        EditorFilter.ALL, false);

        presenter.onFilterView(cancelEvent);

        verify(display).setSearchTerm("");
View Full Code Here

        boolean viewApproved = true;
        boolean viewRejected = true;
        boolean viewHasError = false;
        boolean cancelFilter = true;

        presenter.onFilterView(new FilterViewEvent(viewTranslated, viewFuzzy,
                viewUntranslated, viewApproved, viewRejected, viewHasError,
                EditorFilter.ALL, cancelFilter));

        verifyNoMoreInteractions(eventBus, display, targetContentsPresenter);
    }
View Full Code Here

        // Given: current editor content has changed
        when(targetContentsPresenter.currentEditorContentHasChanged())
                .thenReturn(true);

        // When: not a cancel event
        presenter.onFilterView(new FilterViewEvent(true, false, true, false,
                false, false, EditorFilter.ALL, false));

        // Then:
        verify(display).showFilterConfirmation();
    }
View Full Code Here

    @Test
    public void onFilterViewEventWillHideConfirmationAndDoFilter() {
        // Given: current edtior hasn't changed
        when(targetContentsPresenter.currentEditorContentHasChanged())
                .thenReturn(false);
        FilterViewEvent event =
                new FilterViewEvent(true, false, true, false, false, false,
                        EditorFilter.ALL, false);

        // When:
        presenter.onFilterView(event);
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.client.events.FilterViewEvent

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.