Search in sources :

Example 1 with FormRefreshedEventPayload

use of org.eclipse.sirius.components.collaborative.forms.dto.FormRefreshedEventPayload in project sirius-components by eclipse-sirius.

the class FormEventProcessor method refresh.

@Override
public void refresh(ChangeDescription changeDescription) {
    if (this.shouldRefresh(changeDescription)) {
        Form form = this.refreshForm();
        this.currentForm.set(form);
        if (this.sink.currentSubscriberCount() > 0) {
            EmitResult emitResult = this.sink.tryEmitNext(new FormRefreshedEventPayload(changeDescription.getInput().getId(), form));
            if (emitResult.isFailure()) {
                // $NON-NLS-1$
                String pattern = "An error has occurred while emitting a FormRefreshedEventPayload: {}";
                this.logger.warn(pattern, emitResult);
            }
        }
    }
}
Also used : Form(org.eclipse.sirius.components.forms.Form) FormRefreshedEventPayload(org.eclipse.sirius.components.collaborative.forms.dto.FormRefreshedEventPayload) EmitResult(reactor.core.publisher.Sinks.EmitResult)

Example 2 with FormRefreshedEventPayload

use of org.eclipse.sirius.components.collaborative.forms.dto.FormRefreshedEventPayload in project sirius-components by eclipse-sirius.

the class FormEventProcessor method getOutputEvents.

@Override
public Flux<IPayload> getOutputEvents(IInput input) {
    var initialRefresh = Mono.fromCallable(() -> new FormRefreshedEventPayload(input.getId(), this.currentForm.get()));
    var refreshEventFlux = Flux.concat(initialRefresh, this.sink.asFlux());
    // @formatter:off
    return Flux.merge(refreshEventFlux, this.widgetSubscriptionManager.getFlux(input), this.subscriptionManager.getFlux(input));
// @formatter:on
}
Also used : FormRefreshedEventPayload(org.eclipse.sirius.components.collaborative.forms.dto.FormRefreshedEventPayload)

Aggregations

FormRefreshedEventPayload (org.eclipse.sirius.components.collaborative.forms.dto.FormRefreshedEventPayload)2 Form (org.eclipse.sirius.components.forms.Form)1 EmitResult (reactor.core.publisher.Sinks.EmitResult)1