Establish buildable modules and shared host-service boundaries
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package de.neitzel.fxdesigner.kit;
|
||||
|
||||
import com.oracle.javafx.scenebuilder.kit.editor.EditorController;
|
||||
import de.neitzel.fxdesigner.host.HostServices;
|
||||
import java.util.Objects;
|
||||
import javafx.application.Platform;
|
||||
|
||||
/**
|
||||
* Shared Kit instance. Host setup/toolkit checks must complete before construction on the FX
|
||||
* thread.
|
||||
*/
|
||||
public final class KitView {
|
||||
private final HostServices host;
|
||||
private final EditorController editor;
|
||||
|
||||
public KitView(HostServices host) {
|
||||
if (!Platform.isFxApplicationThread())
|
||||
throw new IllegalStateException("Kit requires the FX thread");
|
||||
this.host = Objects.requireNonNull(host);
|
||||
this.editor = new EditorController();
|
||||
}
|
||||
|
||||
public EditorController editor() {
|
||||
return editor;
|
||||
}
|
||||
|
||||
public HostServices host() {
|
||||
return host;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user