Search in sources :

Example 1 with EventViewAttributeBinder

use of org.robobinding.viewattribute.event.EventViewAttributeBinder in project RoboBinding by RoboBinding.

the class ChildViewAttributesBuilderImpl method add.

@Override
public void add(String attributeName, EventViewAttribute<ViewType, ? extends ViewAddOn> viewAttribute) {
    EventAttribute attribute = resolvedGroupAttributes.eventAttributeFor(attributeName);
    EventViewAttributeBinder viewAttributeBinder = viewAttributeBinderFactory.binderFor(viewAttribute, attribute);
    childViewAttributeMap.put(attributeName, viewAttributeBinder);
}
Also used : EventAttribute(org.robobinding.attribute.EventAttribute) EventViewAttributeBinder(org.robobinding.viewattribute.event.EventViewAttributeBinder)

Example 2 with EventViewAttributeBinder

use of org.robobinding.viewattribute.event.EventViewAttributeBinder in project RoboBinding by RoboBinding.

the class ByBindingAttributeMappingsResolverTest method givenAnEventAttribute_whenResolve_thenAResolvedEventViewAttributeShouldBeReturned.

@Test
public void givenAnEventAttribute_whenResolve_thenAResolvedEventViewAttributeShouldBeReturned() {
    EventViewAttributeBinder viewAttributeBinder = Mockito.mock(EventViewAttributeBinder.class);
    ByBindingAttributeMappingsResolver byBindingAttributeMappingsResolver = newByBindingAttributeMappingsResolver(aBindingAttributeMappings().withEventAttribute("eventAttribute", viewAttributeBinder).build());
    Collection<ViewAttributeBinder> viewAttributes = byBindingAttributeMappingsResolver.resolve(pendingAttributesForView);
    assertThat(Sets.newHashSet(viewAttributes), equalTo(Sets.<ViewAttributeBinder>newHashSet(viewAttributeBinder)));
}
Also used : ViewAttributeBinder(org.robobinding.viewattribute.ViewAttributeBinder) PropertyViewAttributeBinder(org.robobinding.viewattribute.property.PropertyViewAttributeBinder) MultiTypePropertyViewAttributeBinder(org.robobinding.viewattribute.property.MultiTypePropertyViewAttributeBinder) GroupedViewAttributeBinder(org.robobinding.viewattribute.grouped.GroupedViewAttributeBinder) EventViewAttributeBinder(org.robobinding.viewattribute.event.EventViewAttributeBinder) EventViewAttributeBinder(org.robobinding.viewattribute.event.EventViewAttributeBinder) Test(org.junit.Test)

Example 3 with EventViewAttributeBinder

use of org.robobinding.viewattribute.event.EventViewAttributeBinder in project RoboBinding by RoboBinding.

the class MockInitializedBindingAttributeMappingsBuilder method withEventAttribute.

public MockInitializedBindingAttributeMappingsBuilder withEventAttribute(String attribute, final EventViewAttributeBinder viewAttributeBinder) {
    eventAttributes.add(attribute);
    eventViewAttributeBinderFactoryMap.put(attribute, new EventViewAttributeBinderFactory(null, null) {

        @Override
        public EventViewAttributeBinder create(Object view, String attributeName, String attributeValue) {
            return viewAttributeBinder;
        }
    });
    return this;
}
Also used : EventViewAttributeBinderFactory(org.robobinding.viewattribute.event.EventViewAttributeBinderFactory) EventViewAttributeBinder(org.robobinding.viewattribute.event.EventViewAttributeBinder)

Example 4 with EventViewAttributeBinder

use of org.robobinding.viewattribute.event.EventViewAttributeBinder in project RoboBinding by RoboBinding.

the class ChildViewAttributesBuilderImpl method add.

@Override
public void add(String attributeName, EventViewAttributeFactory<ViewType> factory) {
    EventAttribute attribute = resolvedGroupAttributes.eventAttributeFor(attributeName);
    EventViewAttributeBinder viewAttributeBinder = viewAttributeBinderFactory.binderFor(factory, attribute);
    childViewAttributeMap.put(attributeName, viewAttributeBinder);
}
Also used : EventAttribute(org.robobinding.attribute.EventAttribute) EventViewAttributeBinder(org.robobinding.viewattribute.event.EventViewAttributeBinder)

Aggregations

EventViewAttributeBinder (org.robobinding.viewattribute.event.EventViewAttributeBinder)4 EventAttribute (org.robobinding.attribute.EventAttribute)2 Test (org.junit.Test)1 ViewAttributeBinder (org.robobinding.viewattribute.ViewAttributeBinder)1 EventViewAttributeBinderFactory (org.robobinding.viewattribute.event.EventViewAttributeBinderFactory)1 GroupedViewAttributeBinder (org.robobinding.viewattribute.grouped.GroupedViewAttributeBinder)1 MultiTypePropertyViewAttributeBinder (org.robobinding.viewattribute.property.MultiTypePropertyViewAttributeBinder)1 PropertyViewAttributeBinder (org.robobinding.viewattribute.property.PropertyViewAttributeBinder)1