Package org.thechiselgroup.choosel.core.client.visualization.model

Examples of org.thechiselgroup.choosel.core.client.visualization.model.VisualItemContainerChangeEventHandler


        setUpResolverProvider(factory1, factory2);

        underTest = new DefaultManagedSlotMappingConfiguration(resolverProvider,
                slotMappingInitializer, visualizationModel, errorModel);

        VisualItemContainerChangeEventHandler visualItemContainerHandler = captureVisualItemContainerChangeEventHandler();

        ManagedSlotMappingConfigurationChangedEventHandler handler = mock(ManagedSlotMappingConfigurationChangedEventHandler.class);
        underTest
                .addManagedSlotMappingConfigurationChangedEventHandler(handler);

        VisualItemContainerChangeEvent event = new VisualItemContainerChangeEvent(
                visualItemContainer, Delta.createAddedDelta(CollectionFactory
                        .<VisualItem> createLightweightList()));
        visualItemContainerHandler.onVisualItemContainerChanged(event);

        verify(handler, never()).onSlotMappingStateChanged(
                any(ManagedSlotMappingConfigurationChangedEvent.class));
    }
View Full Code Here


        return captor.getValue();
    }

    @Test
    public void fireVisualItemContainerChangeEventWhenVisualItemIsAdded() {
        VisualItemContainerChangeEventHandler handler = mock(VisualItemContainerChangeEventHandler.class);

        underTest.getFullVisualItemContainer().addHandler(handler);

        Resource resource = ResourceSetTestUtils.createResource(1);
        helper.getContainedResources().add(resource);
View Full Code Here

        assertEquals(true, resources.contains(resource));
    }

    @Test
    public void fireVisualItemContainerChangeEventWhenVisualItemIsRemoved() {
        VisualItemContainerChangeEventHandler handler = mock(VisualItemContainerChangeEventHandler.class);

        HandlerRegistration registration = underTest
                .getFullVisualItemContainer().addHandler(handler);

        Resource resource = ResourceSetTestUtils.createResource(1);
        helper.getContainedResources().add(resource);

        VisualItem visualItem = captureEvent(handler).getDelta()
                .getAddedElements().iterator().next();

        VisualItemContainerChangeEventHandler handler2 = mock(VisualItemContainerChangeEventHandler.class);

        registration.removeHandler();
        underTest.getFullVisualItemContainer().addHandler(handler2);

        helper.getContainedResources().remove(resource);
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.core.client.visualization.model.VisualItemContainerChangeEventHandler

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.