Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance modal documentation #94

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/features/4-modals.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ A BiConsumer provides access to the component instance and the stage for configu
When displaying the component, the parameters `modalStage` and `ownerStage` will be passed so that the modal can for
example be closed from inside the component class.

The same component instance cannot be used twice for displaying a modal. When using Dagger it is recommended to inject a provider and use it to create an instance for every modal.

```java

@Component
Expand All @@ -35,12 +37,13 @@ public class ModalComponent extends VBox {
```

```java
Modals.showModal(app, modalComponent, (stage, component) -> {
// As every modal needs its own instance, we use a provider (e.g. with Dagger)
Modals.showModal(app, modalComponentProvider.get(), (stage, component) -> {
stage.doSomething();
component.doSomethingElse();
});
```

---

[⬅ History](3-history.md) | [Overview](README.md) | [Duplicator ➡](5-node-duplicator.md)
[⬅ History](3-history.md) | [Overview](README.md) | [Duplicator ➡](5-node-duplicator.md)