Edit form controls and render localized application previews in the IntelliJ designer

This commit is contained in:
2026-11-24 15:13:31 +01:00
parent 73da1f985e
commit 93a9f04b11
18 changed files with 1623 additions and 63 deletions
+20
View File
@@ -60,6 +60,26 @@ public final class WorkflowProbe implements StartupActivity.DumbAware {
return null;
}
static DesignerPane openDesigner(Project project, VirtualFile file) throws Exception {
var editor =
edt(
() -> {
var manager = FileEditorManager.getInstance(project);
var all = manager.openFile(file, true);
manager.setSelectedEditor(file, "neitzel-fx-designer");
return java.util.Arrays.stream(all)
.filter(e -> e.getName().equals("Neitzel Designer"))
.findFirst()
.orElseThrow();
});
await(() -> edt(() -> bridge(editor.getComponent()) != null));
var panel = edt(() -> bridge(editor.getComponent()));
await(() -> fx(() -> panel.getScene() != null));
var pane = fx(() -> (DesignerPane) panel.getScene().getRoot());
await(() -> fx(() -> pane.kit().editor().getFxomDocument() != null));
return pane;
}
static void await(Callable<Boolean> condition) throws Exception {
long until = System.nanoTime() + TimeUnit.SECONDS.toNanos(120);
while (System.nanoTime() < until) {