Package org.zanata.webtrans.client.events

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


    }

    @Override
    public void goToFirstEntry() {
        targetContentsPresenter.savePendingChangesIfApplicable();
        eventBus.fireEvent(new NavTransUnitEvent(NavigationType.FirstEntry));
    }
View Full Code Here


    }

    @Override
    public void goToLastEntry() {
        targetContentsPresenter.savePendingChangesIfApplicable();
        eventBus.fireEvent(new NavTransUnitEvent(NavigationType.LastEntry));
    }
View Full Code Here

    }

    @Override
    public void goToPreviousState() {
        targetContentsPresenter.savePendingChangesIfApplicable();
        eventBus.fireEvent(new NavTransUnitEvent(NavigationType.PrevState));
    }
View Full Code Here

    }

    @Override
    public void goToNextState() {
        targetContentsPresenter.savePendingChangesIfApplicable();
        eventBus.fireEvent(new NavTransUnitEvent(NavigationType.NextState));
    }
View Full Code Here

                        .setHandler(new KeyShortcutEventHandler() {
                            @Override
                            public void onKeyShortcut(KeyShortcutEvent event) {
                                targetContentsPresenter
                                    .savePendingChangesIfApplicable();
                                eventBus.fireEvent(new NavTransUnitEvent(
                                    NextState));
                            }
                        }).build();
        keyShortcutPresenter.register(nextStateShortcut);

        prevStateShortcut =
                KeyShortcut.Builder.builder()
                        .addKey(new Keys(Keys.ALT_KEY, KeyCodes.KEY_PAGEUP))
                        .setContext(ShortcutContext.Edit)
                        .setDescription(messages.prevIncomplete())
                        .setPreventDefault(true).setStopPropagation(true)
                        .setHandler(new KeyShortcutEventHandler() {
                            @Override
                            public void onKeyShortcut(KeyShortcutEvent event) {
                                targetContentsPresenter
                                    .savePendingChangesIfApplicable();
                                eventBus.fireEvent(new NavTransUnitEvent(
                                    PrevState));
                            }
                        }).build();
        keyShortcutPresenter.register(prevStateShortcut);
    }
View Full Code Here

                        TransUnitSaveEvent.class);
        assertThat(saveEvent.getTransUnitId(), equalTo(selectedTU.getId()));
        assertThat(saveEvent.getTargets(), Matchers.equalTo(NEW_TARGETS));
        assertThat(saveEvent.getStatus(), equalTo(ContentState.Translated));

        NavTransUnitEvent navEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        NavTransUnitEvent.class);
        assertThat(navEvent.getRowType(),
                equalTo(NavTransUnitEvent.NavigationType.NextEntry));
    }
View Full Code Here

        // test key handlers
        prevKey.getHandler().onKeyShortcut(null);
        verify(targetContentsPresenter, atLeastOnce())
                .savePendingChangesIfApplicable();
        verify(eventBus).fireEvent(
                new NavTransUnitEvent(
                        NavTransUnitEvent.NavigationType.PrevEntry));

        nextKey.getHandler().onKeyShortcut(null);
        verify(targetContentsPresenter, atLeastOnce())
                .savePendingChangesIfApplicable();
        verify(eventBus).fireEvent(
                new NavTransUnitEvent(
                        NavTransUnitEvent.NavigationType.NextEntry));

        // by default all other presenters are not focused
        when(translationEditorPresenter.getDisplay()).thenReturn(
                translationEditorDisplay);
View Full Code Here

TOP

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

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.