@Test public void testCreateComponentValueSetter_SetsString() { Label label = new Label(); Consumer<Object> valueSetter = new LabelValueAspectDefinition() .createComponentValueSetter(new LabelComponentWrapper(label)); valueSetter.accept("foo"); assertThat(label.getValue(), is("foo")); }
@Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }  }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }  @Override Aspect<Object> createAspect(); @Override Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper); }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }  @Override Aspect<Object> createAspect(); @Override Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper); static final String NAME; }