Package org.zanata.webtrans.client.events

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


        dispatcher.execute(new LoadOptionsAction(prefixes),
                new AsyncCallback<LoadOptionsResult>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        eventBus.fireEvent(new NotificationEvent(
                                NotificationEvent.Severity.Warning,
                                "Unable to Load editor Options"));
                    }

                    @Override
View Full Code Here


    }

    private void refreshOptions() {
        display.setOptionsState(userOptionsService.getConfigHolder().getState());
        eventBus.fireEvent(UserConfigChangeEvent.EDITOR_CONFIG_CHANGE_EVENT);
        eventBus.fireEvent(new NotificationEvent(
                NotificationEvent.Severity.Warning,
                "Loaded default editor options."));
    }
View Full Code Here

                .setDescription(messages.showEditorKeyShortcut())
                .setHandler(new KeyShortcutEventHandler() {
                    @Override
                    public void onKeyShortcut(KeyShortcutEvent event) {
                        if (selectedDocument == null) {
                            eventBus.fireEvent(new NotificationEvent(
                                    Severity.Warning, messages
                                            .noDocumentSelected()));
                        } else {
                            HistoryToken token = history.getHistoryToken();
                            token.setView(MainView.Editor);
View Full Code Here

    public void onWorkspaceContextUpdated(WorkspaceContextUpdateEvent event) {
        userWorkspaceContext.setProjectActive(event.isProjectActive());
        userWorkspaceContext.getWorkspaceContext().getWorkspaceId()
                .getProjectIterationId().setProjectType(event.getProjectType());
        if (userWorkspaceContext.hasReadOnlyAccess()) {
            eventBus.fireEvent(new NotificationEvent(
                    NotificationEvent.Severity.Info, messages
                            .notifyReadOnlyWorkspace()));
        } else {
            eventBus.fireEvent(new NotificationEvent(
                    NotificationEvent.Severity.Info, messages
                            .notifyEditableWorkspace()));
        }
        display.setReadOnlyVisible(userWorkspaceContext.hasReadOnlyAccess());
    }
View Full Code Here

        // Then:
        verify(editor).insertTextInCursorPosition("suggestion");

        verify(eventBus, atLeastOnce()).fireEvent(eventCaptor.capture());
        NotificationEvent notificationEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        NotificationEvent.class);
        MatcherAssert.assertThat(notificationEvent.getMessage(),
                Matchers.equalTo("copied"));

        RunValidationEvent runValidationEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        RunValidationEvent.class);
View Full Code Here

        presenter
                .onDataCopy(new CopyDataToEditorEvent(Arrays.asList("target")));

        verify(editor).setTextAndValidate("target");
        verify(eventBus, atLeastOnce()).fireEvent(eventCaptor.capture());
        NotificationEvent notificationEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        NotificationEvent.class);
        MatcherAssert.assertThat(notificationEvent.getMessage(),
                Matchers.equalTo("copied"));
    }
View Full Code Here

        presenter.onWorkspaceContextUpdated(new WorkspaceContextUpdateEvent(
                contextUpdateData(false, ProjectType.Podir)));

        verify(eventBus).fireEvent(eventCaptor.capture());
        NotificationEvent event = eventCaptor.getValue();
        assertThat(event.getMessage(), Matchers.equalTo("readonly workspace"));
        verify(display).setReadOnlyVisible(userWorkspace.hasReadOnlyAccess());
    }
View Full Code Here

        presenter.onWorkspaceContextUpdated(new WorkspaceContextUpdateEvent(
                contextUpdateData(true, ProjectType.Podir)));

        verify(eventBus).fireEvent(eventCaptor.capture());
        NotificationEvent event = eventCaptor.getValue();
        assertThat(event.getMessage(), Matchers.equalTo("editable workspace"));
        verify(display).setReadOnlyVisible(userWorkspace.hasReadOnlyAccess());
    }
View Full Code Here

        // Then:
        ArgumentCaptor<NotificationEvent> notificationEventCaptor =
                ArgumentCaptor.forClass(NotificationEvent.class);
        verify(eventBus).fireEvent(notificationEventCaptor.capture());
        NotificationEvent event = notificationEventCaptor.getValue();
        assertThat(event.getSeverity(), is(NotificationEvent.Severity.Info));
        assertThat(event.getMessage(), equalTo("saved row 1, id 1"));
        verify(undoLink).prepareUndoFor(result);
        verify(targetContentsPresenter).addUndoLink(rowIndex, undoLink);
        verify(navigationService).updateDataModel(updatedTU);
        verify(targetContentsPresenter).confirmSaved(updatedTU);
        verify(targetContentsPresenter).setFocus();
View Full Code Here

        ArgumentCaptor<NotificationEvent> notificationEventCaptor =
                ArgumentCaptor.forClass(NotificationEvent.class);
        verify(targetContentsPresenter).setEditingState(TRANS_UNIT_ID,
                TargetContentsDisplay.EditingState.UNSAVED);
        verify(eventBus).fireEvent(notificationEventCaptor.capture());
        NotificationEvent event = notificationEventCaptor.getValue();
        assertThat(event.getSeverity(), is(NotificationEvent.Severity.Error));
        assertThat(event.getMessage(), equalTo("update failed"));
        assertThat(event.getInlineLink(),
                Matchers.<InlineLink> sameInstance(goToLink));
    }
View Full Code Here

TOP

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

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.