27 lines
713 B
Java
27 lines
713 B
Java
package de.neitzel.fxdesigner.preview;
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
/**
|
|
* Owned example state. Return ViewDependencies on FX runtimes with the DI adapter API.
|
|
* An ApplicationContext is supported on runtimes that provide the legacy loaders.
|
|
*/
|
|
public interface PreviewSession<M, C> extends AutoCloseable {
|
|
M model();
|
|
|
|
C context();
|
|
|
|
/**
|
|
* Called after View loading/CSS/layout, on FX. Never block FX; complete asynchronously if needed.
|
|
*/
|
|
default CompletionStage<Void> ready() {
|
|
return CompletableFuture.completedFuture(null);
|
|
}
|
|
|
|
/**
|
|
* Release owned services/timers/listeners. Called once on FX, including load/readiness failure.
|
|
*/
|
|
@Override
|
|
void close() throws Exception;
|
|
}
|