@Override @Nonnull public PresentationModel createPresentationModel (final @Nonnull Object... instanceRoles) { final Styleable styleable = new DefaultStyleable(getStyles()); return jobEvent.findChildren() .stream() .map(jobEvent -> (JobEventSpi)jobEvent) .sorted(comparing(JobEventSpi::getDateTime)) .map(jobEvent -> jobEvent.as(Presentable).createPresentationModel()) .collect(toCompositePresentationModel(aggregateBuilder().create(), styleable)); // FIXME: use SimpleCompositePresentable? }
@Override public PresentationModel createPresentationModel (final @Nonnull Object... instanceRoles) { final Styleable styleable = new DefaultStyleable(getStyles()); return new DefaultPresentationModel("", aggregateBuilder().create(), styleable); }
/******************************************************************************************************************* * * Factory method for the PresentationModel of SimpleDciEntity instances. * ******************************************************************************************************************/ @Nonnull private PresentationModel pmFor (final @Nonnull SimpleDciEntity entity) { // FIXME: column names final Aggregate aggregate = AggregatePresentationModelBuilder.newInstance() .with("C1", new DefaultDisplayable(entity.getName())) .with("C2", new DefaultDisplayable("" + entity.getAttribute1())) .with("C3", new DefaultDisplayable("" + entity.getAttribute2())) .create(); final Selectable selectable = () -> onSelected(entity); final UserAction action1 = new UserActionSupport8(() -> action1(entity), new DefaultDisplayable("Action 1")); final UserAction action2 = new UserActionSupport8(() -> action2(entity), new DefaultDisplayable("Action 2")); final UserAction action3 = new UserActionSupport8(() -> action3(entity), new DefaultDisplayable("Action 3")); // No explicit Displayable here, as the one inside SimpleDciEntity is used. return new DefaultPresentationModel(entity, aggregate, selectable, UserActionProvider.of(action1, action2, action3)); }
invoicedEarnings.greaterThan(earnings) ? "alerted" : "", invoicedEarnings.isEqualTo(earnings) ? "green" : "")) .create();