Package org.zanata.webtrans.client.events

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


    }

    private void ensureRowSelection(TransUnitId transUnitId) {
        if (!equal(currentTransUnitId, transUnitId)) {
            // user click on editor area that is not on current selected row
            eventBus.fireEvent(new TableRowSelectedEvent(transUnitId));
        }
    }
View Full Code Here


        }
    }

    private void ensureRowSelection(TransUnitId id) {
        if (!Objects.equal(id, currentTransUnitId)) {
            eventBus.fireEvent(new TableRowSelectedEvent(id));
        }
    }
View Full Code Here

                    TransUnitId selectedId =
                            units.get(result.getGotoRow()).getId();
                    navigationStateHolder.updateSelected(selectedId);
                    // in case there is pending save (as fuzzy) happening, we do
                    // not want to trigger another pending save
                    eventBus.fireEvent(new TableRowSelectedEvent(selectedId)
                            .setSuppressSavePending(true));
                }
                eventBus.fireEvent(new PageChangeEvent(result
                        .getTargetPageIndex()));
                highlightSearch();
View Full Code Here

        }
        int targetPage = navigationStateHolder.getTargetPage(targetId);
        Log.info("target page : [" + targetPage + "] target TU id: " + targetId);

        if (navigationStateHolder.getCurrentPage() == targetPage) {
            eventBus.fireEvent(new TableRowSelectedEvent(targetId));
        } else {
            loadPageAndGoToRow(targetPage, targetId);
        }
    }
View Full Code Here

            BookmarkedTextFlowEvent bookmarkedTextFlowEvent) {
        int oldOffset = contextHolder.getContext().getOffset();
        int offset = bookmarkedTextFlowEvent.getOffset();
        if (oldOffset == offset) {
            // target text flow is on current page
            eventBus.fireEvent(new TableRowSelectedEvent(
                    bookmarkedTextFlowEvent.getTargetTransUnitId()));
        } else {
            execute(bookmarkedTextFlowEvent);
        }
    }
View Full Code Here

        service.selectByRowIndex(0);

        service.onNavTransUnit(NavTransUnitEvent.FIRST_ENTRY_EVENT);

        verify(eventBus, atLeastOnce()).fireEvent(eventCaptor.capture());
        TableRowSelectedEvent tableRowSelectedEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        TableRowSelectedEvent.class);
        assertThat(tableRowSelectedEvent.getSelectedId(),
                Matchers.equalTo(data.get(0).getId()));
    }
View Full Code Here

        service.selectByRowIndex(0);

        service.onNavTransUnit(NavTransUnitEvent.NEXT_ENTRY_EVENT);

        verify(eventBus, atLeastOnce()).fireEvent(eventCaptor.capture());
        TableRowSelectedEvent tableRowSelectedEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        TableRowSelectedEvent.class);
        assertThat(tableRowSelectedEvent.getSelectedId(),
                Matchers.equalTo(data.get(1).getId()));
    }
View Full Code Here

        service.init(initContext);
        service.selectByRowIndex(2);
        service.onNavTransUnit(NavTransUnitEvent.PREV_ENTRY_EVENT);

        verify(eventBus, atLeastOnce()).fireEvent(eventCaptor.capture());
        TableRowSelectedEvent tableRowSelectedEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        TableRowSelectedEvent.class);
        assertThat(tableRowSelectedEvent.getSelectedId(),
                Matchers.equalTo(data.get(1).getId()));
    }
View Full Code Here

        service.selectByRowIndex(0);

        service.onNavTransUnit(NavTransUnitEvent.NEXT_STATE_EVENT);

        verify(eventBus, atLeastOnce()).fireEvent(eventCaptor.capture());
        TableRowSelectedEvent tableRowSelectedEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        TableRowSelectedEvent.class);
        assertThat(tableRowSelectedEvent.getSelectedId(),
                Matchers.equalTo(data.get(2).getId()));
    }
View Full Code Here

        service.selectByRowIndex(2);

        service.onNavTransUnit(NavTransUnitEvent.PREV_STATE_EVENT);

        verify(eventBus, atLeastOnce()).fireEvent(eventCaptor.capture());
        TableRowSelectedEvent tableRowSelectedEvent =
                TestFixture.extractFromEvents(eventCaptor.getAllValues(),
                        TableRowSelectedEvent.class);
        assertThat(tableRowSelectedEvent.getSelectedId(),
                Matchers.equalTo(data.get(2).getId()));
    }
View Full Code Here

TOP

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

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.