@Test public void testCreateComponentValueSetterComponentWrapper() { EnabledAspectDefinition aspectDefinition = new EnabledAspectDefinition( EnabledType.ENABLED); Consumer<Boolean> setter = aspectDefinition.createComponentValueSetter(componentWrapper); assertThat(componentWrapper.getComponent().isEnabled(), is(false)); setter.accept(true); assertThat(componentWrapper.getComponent().isEnabled(), is(true)); }
@Override public Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper) { return componentWrapper::setEnabled; }
EnabledAspectDefinition extends ModelToUiAspectDefinition<Boolean> { @Override public Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper) { return componentWrapper::setEnabled; } }
EnabledAspectDefinition extends ModelToUiAspectDefinition<Boolean> { @Override public Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper) { return componentWrapper::setEnabled; } EnabledAspectDefinition(EnabledType enabledType); }
EnabledAspectDefinition extends ModelToUiAspectDefinition<Boolean> { @Override public Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper) { return componentWrapper::setEnabled; } EnabledAspectDefinition(EnabledType enabledType); @Override Aspect<Boolean> createAspect(); @Override Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper); }
EnabledAspectDefinition extends ModelToUiAspectDefinition<Boolean> { @Override public Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper) { return componentWrapper::setEnabled; } EnabledAspectDefinition(EnabledType enabledType); @Override Aspect<Boolean> createAspect(); @Override Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper); static final String NAME; }