JavaFXBinder.java

  1. /*
  2.  * *************************************************************************************************************************************************************
  3.  *
  4.  * SteelBlue: DCI User Interfaces
  5.  * http://tidalwave.it/projects/steelblue
  6.  *
  7.  * Copyright (C) 2015 - 2024 by Tidalwave s.a.s. (http://tidalwave.it)
  8.  *
  9.  * *************************************************************************************************************************************************************
  10.  *
  11.  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
  12.  * You may obtain a copy of the License at
  13.  *
  14.  *     http://www.apache.org/licenses/LICENSE-2.0
  15.  *
  16.  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  17.  * CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.
  18.  *
  19.  * *************************************************************************************************************************************************************
  20.  *
  21.  * git clone https://bitbucket.org/tidalwave/steelblue-src
  22.  * git clone https://github.com/tidalwave-it/steelblue-src
  23.  *
  24.  * *************************************************************************************************************************************************************
  25.  */
  26. package it.tidalwave.role.ui.javafx;

  27. import javax.annotation.Nonnull;
  28. import java.util.Collection;
  29. import java.util.Optional;
  30. import java.nio.file.Path;
  31. import javafx.beans.property.Property;
  32. import javafx.scene.Node;
  33. import javafx.scene.control.ButtonBase;
  34. import javafx.scene.control.ComboBox;
  35. import javafx.scene.control.ListView;
  36. import javafx.scene.control.MenuItem;
  37. import javafx.scene.control.TableView;
  38. import javafx.scene.control.TextField;
  39. import javafx.scene.control.ToggleButton;
  40. import javafx.scene.control.TreeTableView;
  41. import javafx.scene.control.TreeView;
  42. import javafx.scene.layout.GridPane;
  43. import javafx.scene.layout.Pane;
  44. import javafx.stage.Window;
  45. import it.tidalwave.util.ui.UserNotification;
  46. import it.tidalwave.util.ui.UserNotificationWithFeedback;
  47. import it.tidalwave.role.ui.BoundProperty;
  48. import it.tidalwave.role.ui.PresentationModel;
  49. import it.tidalwave.role.ui.UserAction;

  50. /***************************************************************************************************************************************************************
  51.  *
  52.  * @author  Fabrizio Giudici
  53.  *
  54.  **************************************************************************************************************************************************************/
  55. public interface JavaFXBinder
  56.   {
  57.     /***********************************************************************************************************************************************************
  58.      * Sets the main window. This operation must be performed before any other method is called. This operation is
  59.      * automatically performed by the SteelBlue runtime.
  60.      *
  61.      * @param   window      the main window
  62.      **********************************************************************************************************************************************************/
  63.     public void setMainWindow (@Nonnull Window window);

  64.     /***********************************************************************************************************************************************************
  65.      * Binds a button to a {@link UserAction}. The following roles o the action are used:
  66.      *
  67.      * <ul>
  68.      * <li>Displayable: to set the label of the button</li>
  69.      * </ul>
  70.      *
  71.      * The action is used as a callback when the button is pressed; invoked in a thread provided by the binder executor.
  72.      * The {@code enabled} property of the {@code UserAction} is bound, negated, to the {@code disabled} property of the
  73.      * button.
  74.      *
  75.      * @param   button      the button
  76.      * @param   action      the action
  77.      **********************************************************************************************************************************************************/
  78.     public void bind (@Nonnull ButtonBase button, @Nonnull UserAction action);

  79.     /***********************************************************************************************************************************************************
  80.      * Binds a menu item to a {@link UserAction}. The following roles o the action are used:
  81.      *
  82.      * <ul>
  83.      * <li>Displayable: to set the label of the menu item</li>
  84.      * </ul>
  85.      *
  86.      * The action is used as a callback when the button is pressed; invoked in a thread provided by the binder executor.
  87.      * The {@code enabled} property of the {@code UserAction} is bound, negated, to the {@code disabled} property of the
  88.      * menu item.
  89.      *
  90.      * @param   menuItem    the menu item
  91.      * @param   action      the action
  92.      **********************************************************************************************************************************************************/
  93.     public void bind (@Nonnull MenuItem menuItem, @Nonnull UserAction action);

  94.     /***********************************************************************************************************************************************************
  95.      * Binds a {@link TableView} to a {@link PresentationModel} and an optional callback.
  96.      *
  97.      * The {@code PresentationModel} is used to populate the table. The following roles are used:
  98.      *
  99.      * <ul>
  100.      * <li>A {@link it.tidalwave.role.SimpleComposite} provides children {@code PresentationModel}s for each row.</li>
  101.      * <li>In each row, an {@link it.tidalwave.role.Aggregate<PresentationModel>} is used to provide the {@code PresentationModel}s for
  102.      *     each column.</li>
  103.      * <li>A {@link it.tidalwave.role.ui.Displayable} (optional) is used to provide the text to render for each item.</li>
  104.      * <li>A {@link it.tidalwave.ui.role.javafx.CustomGraphicProvider} (optional) is used to provide the graphics to render for each item.</li>
  105.      * <li>A {@link it.tidalwave.role.ui.Styleable} (optional) is used to provide the rendering style for each item.</li>
  106.      * <li>A {@link it.tidalwave.role.ui.UserActionProvider} (optional) is used to provide the actions for creating a context menu;
  107.      *     the default action is also bound to the double click or SPACE gesture.</li>
  108.      * </ul>
  109.      *
  110.      * The process of populating data is performed in background threads, so this method quickly returns also in case
  111.      * of large amount of data.
  112.      * The initialization callback is called in the JavaFX thread when data population has been completed.
  113.      *
  114.      * @since   1.0-ALPHA-13
  115.      * @param   tableView       the {@code TablewView}
  116.      * @param   pm              the {@code PresentationModel}
  117.      * @param   initCallback    the callback
  118.      **********************************************************************************************************************************************************/
  119.     public void bind (@Nonnull TableView<PresentationModel> tableView,
  120.                       @Nonnull PresentationModel pm,
  121.                       @Nonnull Optional<Runnable> initCallback);

  122.     /***********************************************************************************************************************************************************
  123.      * Binds a {@link TableView} to a {@link PresentationModel} and a callback.
  124.      * See {@link #bind(javafx.scene.control.TableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  125.      *
  126.      * The process of populating data is performed in background threads, so this method quickly returns also in case
  127.      * of large amount of data.
  128.      * The initialization callback is called in the JavaFX thread when data population has been completed.
  129.      *
  130.      * @param   tableView       the {@code TablewView}
  131.      * @param   pm              the {@code PresentationModel}
  132.      * @param   initCallback    the callback
  133.      **********************************************************************************************************************************************************/
  134.     public default void bind (@Nonnull final TableView<PresentationModel> tableView,
  135.                               @Nonnull final PresentationModel pm,
  136.                               @Nonnull final Runnable initCallback)
  137.       {
  138.         bind(tableView, pm, Optional.of(initCallback));
  139.       }

  140.     /***********************************************************************************************************************************************************
  141.      * Binds a {@link TableView} to a {@link PresentationModel}.
  142.      * See {@link #bind(javafx.scene.control.TableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  143.      *
  144.      * @since   1.0-ALPHA-13
  145.      * @param   tableView       the {@code TablewView}
  146.      * @param   pm              the {@code PresentationModel}
  147.      **********************************************************************************************************************************************************/
  148.     public default void bind (@Nonnull final TableView<PresentationModel> tableView,
  149.                               @Nonnull final PresentationModel pm)
  150.       {
  151.         bind(tableView, pm, Optional.empty());
  152.       }

  153.     /***********************************************************************************************************************************************************
  154.      * Binds a {@link TreeView} to a {@link PresentationModel} and a callback.
  155.      *
  156.      * The {@code PresentationModel} is used to populate the table. The following roles are used:
  157.      *
  158.      * <ul>
  159.      * <li>A {@link it.tidalwave.role.SimpleComposite} provides children {@code PresentationModel}s for each row.</li>
  160.      * <li>In each row, an {@link it.tidalwave.role.Aggregate<PresentationModel>} is used to provide the {@code PresentationModel}s for
  161.      *     each column.</li>
  162.      * <li>A {@link it.tidalwave.role.ui.Displayable} (optional) is used to provide the text to render for each item.</li>
  163.      * <li>A {@link it.tidalwave.ui.role.javafx.CustomGraphicProvider} (optional) is used to provide the graphics to render for each item.</li>
  164.      * <li>A {@link it.tidalwave.role.ui.Styleable} (optional) is used to provide the rendering style for each item.</li>
  165.      * <li>A {@link it.tidalwave.role.ui.UserActionProvider} (optional) is used to provide the actions for creating a context menu;
  166.      *     the default action is also bound to the double click or SPACE gesture.</li>
  167.      * <li>A {@link it.tidalwave.role.ui.Visible} (optional) is used to decide whether the root node should be visible or not.</li>
  168.      * </ul>
  169.      *
  170.      * The process of populating data is performed in background threads, so this method quickly returns also in case
  171.      * of large amount of data.
  172.      * The initialization callback is called in the JavaFX thread when data population has been completed.
  173.      *
  174.      * @param   treeView        the {@code TreeView}
  175.      * @param   pm              the {@code PresentationModel}
  176.      * @param   initCallback    the callback
  177.      **********************************************************************************************************************************************************/
  178.     public void bind (@Nonnull TreeView<PresentationModel> treeView,
  179.                       @Nonnull PresentationModel pm,
  180.                       @Nonnull Optional<Runnable> initCallback);

  181.     /***********************************************************************************************************************************************************
  182.      * Binds a {@link TableView} to a {@link PresentationModel} and a callback.
  183.      * See {@link #bind(javafx.scene.control.TreeView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  184.      *
  185.      * @since   1.0-ALPHA-13
  186.      * @param   treeView        the {@code TreeView}
  187.      * @param   pm              the {@code PresentationModel}
  188.      * @param   initCallback    the callback
  189.      **********************************************************************************************************************************************************/
  190.     public default void bind (@Nonnull final TreeView<PresentationModel> treeView,
  191.                               @Nonnull final PresentationModel pm,
  192.                               @Nonnull final Runnable initCallback)
  193.       {
  194.         bind(treeView, pm, Optional.of(initCallback));
  195.       }

  196.     /***********************************************************************************************************************************************************
  197.      * Binds a {@link TableView} to a {@link PresentationModel}.
  198.      * See {@link #bind(javafx.scene.control.TableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}
  199.      *
  200.      * @since   1.0-ALPHA-13
  201.      * @param   treeView        the {@code TreeView}
  202.      * @param   pm              the {@code PresentationModel}
  203.      **********************************************************************************************************************************************************/
  204.     public default void bind (@Nonnull final TreeView<PresentationModel> treeView,
  205.                               @Nonnull final PresentationModel pm)
  206.       {
  207.         bind(treeView, pm, Optional.empty());
  208.       }

  209.     /***********************************************************************************************************************************************************
  210.      * Binds a {@link TreeTableView} to a {@link PresentationModel} and a callback.
  211.      *
  212.      * The {@code PresentationModel} is used to populate the table. The following roles are used:
  213.      *
  214.      * <ul>
  215.      * <li>A {@link it.tidalwave.role.SimpleComposite} provides children {@code PresentationModel}s for each row.</li>
  216.      * <li>In each row, an {@link it.tidalwave.role.Aggregate<PresentationModel>} is used to provide the {@code PresentationModel}s for
  217.      *     each column.</li>
  218.      * <li>A {@link it.tidalwave.role.ui.Displayable} (optional) is used to provide the text to render for each item.</li>
  219.      * <li>A {@link it.tidalwave.ui.role.javafx.CustomGraphicProvider} (optional) is used to provide the graphics to render for each item.</li>
  220.      * <li>A {@link it.tidalwave.role.ui.Styleable} (optional) is used to provide the rendering style for each item.</li>
  221.      * <li>A {@link it.tidalwave.role.ui.UserActionProvider} (optional) is used to provide the actions for creating a context menu;
  222.      *     the default action is also bound to the double click or SPACE gesture.</li>
  223.      * <li>A {@link it.tidalwave.role.ui.Visible} (optional) is used to decide whether the root node should be visible or not.</li>
  224.      * </ul>
  225.      *
  226.      * The process of populating data is performed in background threads, so this method quickly returns also in case
  227.      * of large amount of data.
  228.      * The initialization callback is called in the JavaFX thread when data population has been completed.
  229.      *
  230.      * @param   treeTableView   the {@code TreeTableView}
  231.      * @param   pm              the {@code PresentationModel}
  232.      * @param   initCallback    the callback
  233.      **********************************************************************************************************************************************************/
  234.     public void bind (@Nonnull TreeTableView<PresentationModel> treeTableView,
  235.                       @Nonnull PresentationModel pm,
  236.                       @Nonnull Optional<Runnable> initCallback);

  237.     /***********************************************************************************************************************************************************
  238.      * Binds a {@link TreeTableView} to a {@link PresentationModel} and a callback.
  239.      * See {@link #bind(javafx.scene.control.TreeTableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  240.      *
  241.      * @since   1.0-ALPHA-13
  242.      * @param   treeTableView   the {@code TreeTableView}
  243.      * @param   pm              the {@code PresentationModel}
  244.      * @param   initCallback    the callback
  245.      **********************************************************************************************************************************************************/
  246.     public default void bind (@Nonnull final TreeTableView<PresentationModel> treeTableView,
  247.                               @Nonnull final PresentationModel pm,
  248.                               @Nonnull final Runnable initCallback)
  249.       {
  250.         bind(treeTableView, pm, Optional.of(initCallback));
  251.       }

  252.     /***********************************************************************************************************************************************************
  253.      * Binds a {@link TreeTableView} to a {@link PresentationModel}.
  254.      * See {@link #bind(javafx.scene.control.TreeTableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  255.      *
  256.      * @since   1.0-ALPHA-13
  257.      * @param   treeTableView   the {@code TreeTableView}
  258.      * @param   pm              the {@code PresentationModel}
  259.      **********************************************************************************************************************************************************/
  260.     public default void bind (@Nonnull final TreeTableView<PresentationModel> treeTableView,
  261.                               @Nonnull final PresentationModel pm)
  262.       {
  263.         bind(treeTableView, pm, Optional.empty());
  264.       }

  265.     /***********************************************************************************************************************************************************
  266.      * Binds a {@link ListView} to a {@link PresentationModel} and an optional callback.
  267.      *
  268.      * The {@code PresentationModel} is used to populate the table. The following roles are used:
  269.      *
  270.      * <ul>
  271.      * <li>A {@link it.tidalwave.role.SimpleComposite} provides children {@code PresentationModel}s for each row.</li>
  272.      * <li>In each row, an {@link it.tidalwave.role.Aggregate<PresentationModel>} is used to provide the {@code PresentationModel}s for
  273.      *     each column.</li>
  274.      * <li>A {@link it.tidalwave.role.ui.Displayable} (optional) is used to provide the text to render for each item.</li>
  275.      * <li>A {@link it.tidalwave.ui.role.javafx.CustomGraphicProvider} (optional) is used to provide the graphics to render for each item.</li>
  276.      * <li>A {@link it.tidalwave.role.ui.Styleable} (optional) is used to provide the rendering style for each item.</li>
  277.      * <li>A {@link it.tidalwave.role.ui.UserActionProvider} (optional) is used to provide the actions for creating a context menu;
  278.      *     the default action is also bound to the double click or SPACE gesture.</li>
  279.      * </ul>
  280.      *
  281.      * The process of populating data is performed in background threads, so this method quickly returns also in case
  282.      * of large amount of data.
  283.      * The initialization callback is called in the JavaFX thread when data population has been completed.
  284.      *
  285.      * @param   listView        the {@code ListView}
  286.      * @param   pm              the {@code PresentationModel}
  287.      * @param   initCallback    the callback
  288.      **********************************************************************************************************************************************************/
  289.     public void bind (@Nonnull ListView<PresentationModel> listView,
  290.                       @Nonnull PresentationModel pm,
  291.                       @Nonnull Optional<Runnable> initCallback);

  292.     /***********************************************************************************************************************************************************
  293.      * Binds a {@link ListView} to a {@link PresentationModel} and a callback.
  294.      * See {@link #bind(javafx.scene.control.ListView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  295.      *
  296.      * @since   1.0-ALPHA-13
  297.      * @param   listView        the {@code ListView}
  298.      * @param   pm              the {@code PresentationModel}
  299.      * @param   initCallback    the callback
  300.      **********************************************************************************************************************************************************/
  301.     public default void bind (@Nonnull final ListView<PresentationModel> listView,
  302.                               @Nonnull final PresentationModel pm,
  303.                               @Nonnull final Runnable initCallback)
  304.       {
  305.         bind(listView, pm, Optional.of(initCallback));
  306.       }

  307.     /***********************************************************************************************************************************************************
  308.      * Binds a {@link ComboBox} to a {@link PresentationModel}.
  309.      * See {@link #bind(javafx.scene.control.ListView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  310.      *
  311.      * @since   1.0-ALPHA-13
  312.      * @param   listView        the {@code ListView}
  313.      * @param   pm              the {@code PresentationModel}
  314.      **********************************************************************************************************************************************************/
  315.     public default void bind (@Nonnull final ListView<PresentationModel> listView,
  316.                               @Nonnull final PresentationModel pm)
  317.       {
  318.         bind(listView, pm, Optional.empty());
  319.       }

  320.     /***********************************************************************************************************************************************************
  321.      * Binds a {@link ComboBox} to a {@link PresentationModel} and an optional callback.
  322.      *
  323.      * The {@code PresentationModel} is used to populate the table. The following roles are used:
  324.      *
  325.      * <ul>
  326.      * <li>A {@link it.tidalwave.role.SimpleComposite} provides children {@code PresentationModel}s for each row.</li>
  327.      * <li>In each row, an {@link it.tidalwave.role.Aggregate<PresentationModel>} is used to provide the {@code PresentationModel}s for
  328.      *     each column.</li>
  329.      * <li>A {@link it.tidalwave.role.ui.Displayable} (optional) is used to provide the text to render for each item.</li>
  330.      * <li>A {@link it.tidalwave.ui.role.javafx.CustomGraphicProvider} (optional) is used to provide the graphics to render for each item.</li>
  331.      * <li>A {@link it.tidalwave.role.ui.Styleable} (optional) is used to provide the rendering style for each item.</li>
  332.      * <li>A {@link it.tidalwave.role.ui.UserActionProvider} (optional) is used to provide the actions for creating a context menu;
  333.      *     the default action is also bound to the double click or SPACE gesture.</li>
  334.      * </ul>
  335.      *
  336.      * The process of populating data is performed in background threads, so this method quickly returns also in case
  337.      * of large amount of data.
  338.      * The initialization callback is called in the JavaFX thread when data population has been completed.
  339.      *
  340.      * @param   comboBox        the {@code ComboBox}
  341.      * @param   pm              the {@code PresentationModel}
  342.      * @param   initCallback    the callback
  343.      **********************************************************************************************************************************************************/
  344.     public void bind (@Nonnull ComboBox<PresentationModel> comboBox,
  345.                       @Nonnull PresentationModel pm,
  346.                       @Nonnull Optional<Runnable> initCallback);

  347.     /***********************************************************************************************************************************************************
  348.      * Binds a {@link ComboBox} to a {@link PresentationModel} and a callback.
  349.      * See {@link #bind(javafx.scene.control.ComboBox, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  350.      *
  351.      * @since   1.0-ALPHA-13
  352.      * @param   comboBox        the {@code ComboBox}
  353.      * @param   pm              the {@code PresentationModel}
  354.      * @param   initCallback    the callback
  355.      **********************************************************************************************************************************************************/
  356.     public default void bind (@Nonnull final ComboBox<PresentationModel> comboBox,
  357.                               @Nonnull final PresentationModel pm,
  358.                               @Nonnull final Runnable initCallback)
  359.       {
  360.         bind(comboBox, pm, Optional.of(initCallback));
  361.       }

  362.     /***********************************************************************************************************************************************************
  363.      * Binds a {@link ComboBox} to a {@link PresentationModel}.
  364.      * See {@link #bind(javafx.scene.control.ComboBox, it.tidalwave.role.ui.PresentationModel, java.util.Optional)}.
  365.      *
  366.      * @since   1.0-ALPHA-13
  367.      * @param   comboBox        the {@code ComboBox}
  368.      * @param   pm              the {@code PresentationModel}
  369.      **********************************************************************************************************************************************************/
  370.     public default void bind (@Nonnull final ComboBox<PresentationModel> comboBox,
  371.                               @Nonnull final PresentationModel pm)
  372.       {
  373.         bind(comboBox, pm, Optional.empty());
  374.       }

  375.     /***********************************************************************************************************************************************************
  376.      * Given a {@link PresentationModel} that contains a {@link it.tidalwave.role.Composite}, populate the pane with
  377.      * {@link ToggleButton}s associated to the elements of the {@link it.tidalwave.role.Composite}. Each element is searched for the
  378.      * following roles:
  379.      *
  380.      * <ul>
  381.      * <li>{@link it.tidalwave.role.ui.UserActionProvider} (mandatory) to provide a callback for the button</li>
  382.      * <li>{@link it.tidalwave.role.ui.Displayable} to provide a text for the button</li>
  383.      * <li>{@link it.tidalwave.role.ui.Styleable} to provide a CSS style for the button</li>
  384.      * </ul>
  385.      *
  386.      * The pane must be pre-populated with at least one button, which will be queried for the CSS style.
  387.      *
  388.      * @param   pane        the {@code Pane}
  389.      * @param   pm          the {@code PresentationModel}
  390.      **********************************************************************************************************************************************************/
  391.     public void bindToggleButtons (@Nonnull Pane pane, @Nonnull PresentationModel pm);

  392.     /***********************************************************************************************************************************************************
  393.      * Deprecated. Merge to bindToggleButtons, passing some arguments for choosing toggle or normal buttons.
  394.      *
  395.      * @deprecated
  396.      **********************************************************************************************************************************************************/
  397.     @Deprecated
  398.     public void bindButtonsInPane (@Nonnull GridPane gridPane, @Nonnull Collection<UserAction> actions);

  399.     /***********************************************************************************************************************************************************
  400.      * Bidirectionally binds two properties.
  401.      *
  402.      * @param   <T>         the property type
  403.      * @param   property1   the former property
  404.      * @param   property2   the latter property
  405.      **********************************************************************************************************************************************************/
  406.     public <T> void bindBidirectionally (@Nonnull Property<T> property1, @Nonnull BoundProperty<T> property2);

  407.     /***********************************************************************************************************************************************************
  408.      *
  409.      **********************************************************************************************************************************************************/
  410.     public <T> void bindBidirectionally (@Nonnull TextField textField,
  411.                                          @Nonnull BoundProperty<String> textProperty,
  412.                                          @Nonnull BoundProperty<Boolean> validProperty);

  413.     /***********************************************************************************************************************************************************
  414.      * Shows a modal dialog with the given content and provides feedback by means of the given notification.
  415.      *
  416.      * @param   notification  the object notifying whether the operation is confirmed or cancelled
  417.      * @since   1.1-ALPHA-6
  418.      **********************************************************************************************************************************************************/
  419.     public default void showInModalDialog (@Nonnull final UserNotification notification)
  420.       {
  421.         showInModalDialog(UserNotificationWithFeedback.notificationWithFeedback()
  422.                                                       .withCaption(notification.getCaption())
  423.                                                       .withText(notification.getText()));
  424.       }

  425.     /***********************************************************************************************************************************************************
  426.      * Shows a modal dialog with the given content and provides feedback by means of the given notification.
  427.      *
  428.      * @param  node          the dialog content
  429.      * @param  notification  the object notifying whether the operation is confirmed or cancelled
  430.      **********************************************************************************************************************************************************/
  431.     public void showInModalDialog (@Nonnull UserNotificationWithFeedback notification,
  432.                                    @Nonnull Optional<Node> node);

  433.     // FIXME: use a Builder, merge with the above
  434.     public default void showInModalDialog (@Nonnull final Node node,
  435.                                            @Nonnull final UserNotificationWithFeedback notification,
  436.                                            @Nonnull final BoundProperty<Boolean> valid)
  437.       {
  438.         showInModalDialog(notification, Optional.of(node));
  439.       }

  440.     @Deprecated
  441.     public default void showInModalDialog (@Nonnull final Node node,
  442.                                            @Nonnull final UserNotificationWithFeedback notification)
  443.       {
  444.         showInModalDialog(notification, Optional.of(node));
  445.       }

  446.     public default void showInModalDialog (@Nonnull final UserNotificationWithFeedback notification)
  447.       {
  448.         showInModalDialog(notification, Optional.empty());
  449.       }

  450.     /***********************************************************************************************************************************************************
  451.      * Opens the FileChooser for selecting a file. The outcome of the operation (confirmed or cancelled) will be
  452.      * notified to the given notification object. The selected file will be set to the given bound property, which can
  453.      * be also used to set the default value rendered on the FileChooser.
  454.      *
  455.      * @param  notification  the object notifying whether the operation is confirmed or cancelled
  456.      * @param  selectedFile  the property containing the selected file
  457.      **********************************************************************************************************************************************************/
  458.     public void openFileChooserFor (@Nonnull UserNotificationWithFeedback notification,
  459.                                     @Nonnull BoundProperty<Path> selectedFile);

  460.     /***********************************************************************************************************************************************************
  461.      * Opens the FileChooser for selecting a folder. The outcome of the operation (confirmed or cancelled) will be
  462.      * notified to the given notification object. The selected folder will be set to the given bound property, which can
  463.      * be also used to set the default value rendered on the FileChooser.
  464.      *
  465.      * @param  notification    the object notifying whether the operation is confirmed or cancelled
  466.      * @param  selectedFolder  the property containing the selected folder
  467.      **********************************************************************************************************************************************************/
  468.     public void openDirectoryChooserFor (@Nonnull UserNotificationWithFeedback notification,
  469.                                          @Nonnull BoundProperty<Path> selectedFolder);
  470.   }