24 lines
625 B
Java
24 lines
625 B
Java
package de.neitzel.fxdesigner.preview;
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
/** Owned example state. The NeitzelLib adapter requires C to be an ApplicationContext. */
|
|
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;
|
|
}
|