Edit and exercise Archiver CommandBindings in the IntelliJ designer
This commit is contained in:
+3
-2
@@ -52,7 +52,8 @@ public final class PreviewChecks {
|
||||
if (mode.equals("unstable")
|
||||
|| mode.equals("full")
|
||||
|| mode.equals("full-empty")
|
||||
|| mode.equals("card")) {
|
||||
|| mode.equals("card")
|
||||
|| mode.equals("command-card")) {
|
||||
StageChecks.run(mode);
|
||||
return;
|
||||
}
|
||||
@@ -345,7 +346,7 @@ public final class PreviewChecks {
|
||||
() -> {
|
||||
var view = ready.loadedView();
|
||||
check(view.getViewModel() instanceof PersonViewModel, "Named ViewModel not selected");
|
||||
var controller = Examples.context.getComponent(PersonController.class);
|
||||
var controller = PersonController.boundController;
|
||||
check(controller.received == view.getViewModel(), "Controller ViewModel handoff");
|
||||
check(controller.greeting == Examples.service, "Configured service not injected");
|
||||
var card = (Card) view.getRoot().lookup("#card");
|
||||
|
||||
+20
-4
@@ -20,17 +20,25 @@ public final class StageChecks {
|
||||
if (!started.await(10, TimeUnit.SECONDS)) throw new AssertionError("FX startup");
|
||||
var descriptor =
|
||||
ExampleCatalog.discover(StageChecks.class.getClassLoader()).stream()
|
||||
.filter(e -> e.id().equals(mode.equals("unstable") ? "full" : mode))
|
||||
.filter(
|
||||
e ->
|
||||
e.id()
|
||||
.equals(
|
||||
mode.equals("unstable")
|
||||
? "full"
|
||||
: mode.equals("command-card") ? "card" : mode))
|
||||
.findFirst()
|
||||
.orElseThrow();
|
||||
if (mode.equals("unstable"))
|
||||
if (mode.equals("unstable") || mode.equals("command-card"))
|
||||
descriptor =
|
||||
new de.neitzel.fxdesigner.preview.ExampleDescriptor(
|
||||
descriptor.id(),
|
||||
descriptor.label(),
|
||||
descriptor.modelType(),
|
||||
descriptor.providerClass(),
|
||||
"fixture/components/Unstable.fxml",
|
||||
mode.equals("unstable")
|
||||
? "fixture/components/Unstable.fxml"
|
||||
: "fixture/components/CommandCard.fxml",
|
||||
descriptor.componentPackage());
|
||||
var preview =
|
||||
TargetPreview.open(descriptor, StageChecks.class.getClassLoader(), Duration.ofSeconds(15));
|
||||
@@ -55,7 +63,15 @@ public final class StageChecks {
|
||||
PreviewChecks.fx(
|
||||
() -> {
|
||||
var root = ready.loadedView().getRoot();
|
||||
if (mode.equals("card")) {
|
||||
if (mode.equals("command-card")) {
|
||||
var button = (Button) root.lookup("#run");
|
||||
var model = (fixture.model.Address) ((CommandCard) root).modelProperty().get();
|
||||
button.fire();
|
||||
PreviewChecks.check(
|
||||
model.getStreet().equals("Command executed"), "Component command");
|
||||
PreviewChecks.check(
|
||||
button.isDisabled(), "Component command disabled after execution");
|
||||
} else if (mode.equals("card")) {
|
||||
var card = (Card) root;
|
||||
PreviewChecks.check(
|
||||
card.street().getText().equals("Independent Card sample"),
|
||||
|
||||
Reference in New Issue
Block a user