Package org.zanata.webtrans.client.ui

Examples of org.zanata.webtrans.client.ui.HasSelectableSource


    }

    @Override
    public void onClick(ClickEvent event) {
        if (event.getSource() instanceof HasSelectableSource) {
            HasSelectableSource previousSource = selectedSource;

            selectedSource = (HasSelectableSource) event.getSource();
            ensureRowSelection(selectedSource.getId());

            if (previousSource != null) {
                previousSource.setSelected(false);
            }

            selectedSource.setSelected(true);

            Log.debug("Selected source: " + selectedSource.getSource());
View Full Code Here


    }

    @Test
    public void testOnClick() throws Exception {
        // Given:
        HasSelectableSource firstSelectableSource =
                Mockito.mock(HasSelectableSource.class);
        when(clickEvent.getSource()).thenReturn(firstSelectableSource);

        // When: click on the first time (we don't have any previous selected
        // source)
        presenter.onClick(clickEvent);

        // Then:
        verify(firstSelectableSource).setSelected(true);
        verify(eventBus).fireEvent(RequestValidationEvent.EVENT);

        // When: click again we will have previous selection source
        HasSelectableSource anotherSelectableSource =
                Mockito.mock(HasSelectableSource.class);
        when(clickEvent.getSource()).thenReturn(anotherSelectableSource);
        presenter.onClick(clickEvent);

        verify(firstSelectableSource).setSelected(false);
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.client.ui.HasSelectableSource

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.