Search in sources :

Example 1 with ContentChangeHandler

use of org.guvnor.ala.ui.client.util.ContentChangeHandler in project kie-wb-common by kiegroup.

the class ProviderTypeItemPresenterTest method testOnItemClickWhenSelected.

@Test
public void testOnItemClickWhenSelected() {
    ContentChangeHandler changeHandler = mock(ContentChangeHandler.class);
    presenter.addContentChangeHandler(changeHandler);
    when(view.isSelected()).thenReturn(true);
    presenter.onItemClick();
    verify(view, times(1)).setSelected(false);
    verify(changeHandler, times(1)).onContentChange();
}
Also used : ContentChangeHandler(org.guvnor.ala.ui.client.util.ContentChangeHandler) Test(org.junit.Test)

Example 2 with ContentChangeHandler

use of org.guvnor.ala.ui.client.util.ContentChangeHandler in project kie-wb-common by kiegroup.

the class EnableProviderTypePagePresenter method setup.

public void setup(final List<Pair<ProviderType, ProviderTypeStatus>> providerTypeStatus) {
    view.clear();
    clearProviderTypes();
    final ContentChangeHandler contentChangeHandler = this::onProviderTypeSelectionChange;
    providerTypeStatus.forEach(pair -> {
        final ProviderTypeItemPresenter presenter = newProviderTypeItemPresenter();
        presenter.setup(pair.getK1(), pair.getK2());
        presenter.addContentChangeHandler(contentChangeHandler);
        itemPresenters.add(presenter);
        view.addProviderType(presenter.getView());
    });
}
Also used : ProviderTypeItemPresenter(org.guvnor.ala.ui.client.wizard.providertype.item.ProviderTypeItemPresenter) ContentChangeHandler(org.guvnor.ala.ui.client.util.ContentChangeHandler)

Example 3 with ContentChangeHandler

use of org.guvnor.ala.ui.client.util.ContentChangeHandler in project kie-wb-common by kiegroup.

the class ProviderTypeItemPresenterTest method testContentChange.

@Test
public void testContentChange() {
    ContentChangeHandler changeHandler = mock(ContentChangeHandler.class);
    presenter.addContentChangeHandler(changeHandler);
    presenter.fireChangeHandlers();
    verify(changeHandler, times(1)).onContentChange();
}
Also used : ContentChangeHandler(org.guvnor.ala.ui.client.util.ContentChangeHandler) Test(org.junit.Test)

Example 4 with ContentChangeHandler

use of org.guvnor.ala.ui.client.util.ContentChangeHandler in project kie-wb-common by kiegroup.

the class ProviderTypeItemPresenterTest method testOnItemClickWhenNotSelected.

@Test
public void testOnItemClickWhenNotSelected() {
    ContentChangeHandler changeHandler = mock(ContentChangeHandler.class);
    presenter.addContentChangeHandler(changeHandler);
    when(view.isSelected()).thenReturn(false);
    presenter.onItemClick();
    verify(view, times(1)).setSelected(true);
    verify(changeHandler, times(1)).onContentChange();
}
Also used : ContentChangeHandler(org.guvnor.ala.ui.client.util.ContentChangeHandler) Test(org.junit.Test)

Aggregations

ContentChangeHandler (org.guvnor.ala.ui.client.util.ContentChangeHandler)4 Test (org.junit.Test)3 ProviderTypeItemPresenter (org.guvnor.ala.ui.client.wizard.providertype.item.ProviderTypeItemPresenter)1