Interface JavaFXBinder


public interface JavaFXBinder
Author:
Fabrizio Giudici
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(javafx.scene.control.ButtonBase button, it.tidalwave.role.ui.UserAction action)
    Binds a button to a UserAction.
    default void
    bind(javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, it.tidalwave.role.ui.PresentationModel pm)
    Binds a ComboBox to a PresentationModel.
    default void
    bind(javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback)
    Binds a ComboBox to a PresentationModel and a callback.
    void
    bind(javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, it.tidalwave.role.ui.PresentationModel pm, Optional<Runnable> initCallback)
    Binds a ComboBox to a PresentationModel and an optional callback.
    default void
    bind(javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, it.tidalwave.role.ui.PresentationModel pm)
    Binds a ComboBox to a PresentationModel.
    default void
    bind(javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback)
    Binds a ListView to a PresentationModel and a callback.
    void
    bind(javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, it.tidalwave.role.ui.PresentationModel pm, Optional<Runnable> initCallback)
    Binds a ListView to a PresentationModel and an optional callback.
    void
    bind(javafx.scene.control.MenuItem menuItem, it.tidalwave.role.ui.UserAction action)
    Binds a menu item to a UserAction.
    default void
    bind(javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, it.tidalwave.role.ui.PresentationModel pm)
    Binds a TableView to a PresentationModel.
    default void
    bind(javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback)
    Binds a TableView to a PresentationModel and a callback.
    void
    bind(javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, it.tidalwave.role.ui.PresentationModel pm, Optional<Runnable> initCallback)
    Binds a TableView to a PresentationModel and an optional callback.
    default void
    bind(javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, it.tidalwave.role.ui.PresentationModel pm)
    Binds a TreeTableView to a PresentationModel.
    default void
    bind(javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback)
    Binds a TreeTableView to a PresentationModel and a callback.
    void
    bind(javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, it.tidalwave.role.ui.PresentationModel pm, Optional<Runnable> initCallback)
    Binds a TreeTableView to a PresentationModel and a callback.
    default void
    bind(javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, it.tidalwave.role.ui.PresentationModel pm)
    Binds a TableView to a PresentationModel.
    default void
    bind(javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback)
    Binds a TableView to a PresentationModel and a callback.
    void
    bind(javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, it.tidalwave.role.ui.PresentationModel pm, Optional<Runnable> initCallback)
    Binds a TreeView to a PresentationModel and a callback.
    <T> void
    bindBidirectionally(javafx.beans.property.Property<T> property1, it.tidalwave.role.ui.BoundProperty<T> property2)
    Bidirectionally binds two properties.
    <T> void
    bindBidirectionally(javafx.scene.control.TextField textField, it.tidalwave.role.ui.BoundProperty<String> textProperty, it.tidalwave.role.ui.BoundProperty<Boolean> validProperty)
     
    void
    bindButtonsInPane(javafx.scene.layout.GridPane gridPane, Collection<it.tidalwave.role.ui.UserAction> actions)
    Deprecated. 
    void
    bindToggleButtons(javafx.scene.layout.Pane pane, it.tidalwave.role.ui.PresentationModel pm)
    Given a PresentationModel that contains a Composite, populate the pane with ToggleButtons associated to the elements of the Composite.
    void
    openDirectoryChooserFor(it.tidalwave.util.ui.UserNotificationWithFeedback notification, it.tidalwave.role.ui.BoundProperty<Path> selectedFolder)
    Opens the FileChooser for selecting a folder.
    void
    openFileChooserFor(it.tidalwave.util.ui.UserNotificationWithFeedback notification, it.tidalwave.role.ui.BoundProperty<Path> selectedFile)
    Opens the FileChooser for selecting a file.
    void
    setMainWindow(javafx.stage.Window window)
    Sets the main window.
    default void
    showInModalDialog(it.tidalwave.util.ui.UserNotificationWithFeedback notification)
     
    void
    showInModalDialog(it.tidalwave.util.ui.UserNotificationWithFeedback notification, Optional<javafx.scene.Node> node)
    Shows a modal dialog with the given content and provides feedback by means of the given notification.
    default void
    showInModalDialog(javafx.scene.Node node, it.tidalwave.util.ui.UserNotificationWithFeedback notification)
    Deprecated.
    default void
    showInModalDialog(javafx.scene.Node node, it.tidalwave.util.ui.UserNotificationWithFeedback notification, it.tidalwave.role.ui.BoundProperty<Boolean> valid)
     
  • Method Details

    • setMainWindow

      void setMainWindow(@Nonnull javafx.stage.Window window)
      Sets the main window. This operation must be performed before any other method is called. This operation is automatically performed by the SteelBlue runtime.
      Parameters:
      window - the main window
    • bind

      void bind(@Nonnull javafx.scene.control.ButtonBase button, @Nonnull it.tidalwave.role.ui.UserAction action)
      Binds a button to a UserAction. The following roles o the action are used:
      • Displayable: to set the label of the button
      The action is used as a callback when the button is pressed; invoked in a thread provided by the binder executor. The enabled property of the UserAction is bound, negated, to the disabled property of the button.
      Parameters:
      button - the button
      action - the action
    • bind

      void bind(@Nonnull javafx.scene.control.MenuItem menuItem, @Nonnull it.tidalwave.role.ui.UserAction action)
      Binds a menu item to a UserAction. The following roles o the action are used:
      • Displayable: to set the label of the menu item
      The action is used as a callback when the button is pressed; invoked in a thread provided by the binder executor. The enabled property of the UserAction is bound, negated, to the disabled property of the menu item.
      Parameters:
      menuItem - the menu item
      action - the action
    • bind

      void bind(@Nonnull javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Optional<Runnable> initCallback)
      Binds a TableView to a PresentationModel and an optional callback. The PresentationModel is used to populate the table. The following roles are used:
      • A SimpleComposite provides children PresentationModels for each row.
      • In each row, an it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel> is used to provide the PresentationModels for each column.
      • A Displayable (optional) is used to provide the text to render for each item.
      • A CustomGraphicProvider (optional) is used to provide the graphics to render for each item.
      • A Styleable (optional) is used to provide the rendering style for each item.
      • A UserActionProvider (optional) is used to provide the actions for creating a context menu; the default action is also bound to the double click or SPACE gesture.
      The process of populating data is performed in background threads, so this method quickly returns also in case of large amount of data. The initialization callback is called in the JavaFX thread when data population has been completed.
      Parameters:
      tableView - the TablewView
      pm - the PresentationModel
      initCallback - the callback
      Since:
      1.0-ALPHA-13
    • bind

      default void bind(@Nonnull javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Runnable initCallback)
      Binds a TableView to a PresentationModel and a callback. See bind(javafx.scene.control.TableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional). The process of populating data is performed in background threads, so this method quickly returns also in case of large amount of data. The initialization callback is called in the JavaFX thread when data population has been completed.
      Parameters:
      tableView - the TablewView
      pm - the PresentationModel
      initCallback - the callback
    • bind

      default void bind(@Nonnull javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm)
      Parameters:
      tableView - the TablewView
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bind

      void bind(@Nonnull javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Optional<Runnable> initCallback)
      Binds a TreeView to a PresentationModel and a callback. The PresentationModel is used to populate the table. The following roles are used:
      • A SimpleComposite provides children PresentationModels for each row.
      • In each row, an it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel> is used to provide the PresentationModels for each column.
      • A Displayable (optional) is used to provide the text to render for each item.
      • A CustomGraphicProvider (optional) is used to provide the graphics to render for each item.
      • A Styleable (optional) is used to provide the rendering style for each item.
      • A UserActionProvider (optional) is used to provide the actions for creating a context menu; the default action is also bound to the double click or SPACE gesture.
      • A Visible (optional) is used to decide whether the root node should be visible or not.
      The process of populating data is performed in background threads, so this method quickly returns also in case of large amount of data. The initialization callback is called in the JavaFX thread when data population has been completed.
      Parameters:
      treeView - the TreeView
      pm - the PresentationModel
      initCallback - the callback
    • bind

      default void bind(@Nonnull javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Runnable initCallback)
      Parameters:
      treeView - the TreeView
      pm - the PresentationModel
      initCallback - the callback
      Since:
      1.0-ALPHA-13
    • bind

      default void bind(@Nonnull javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, @Nonnull it.tidalwave.role.ui.PresentationModel pm)
      Parameters:
      treeView - the TreeView
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bind

      void bind(@Nonnull javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Optional<Runnable> initCallback)
      Binds a TreeTableView to a PresentationModel and a callback. The PresentationModel is used to populate the table. The following roles are used:
      • A SimpleComposite provides children PresentationModels for each row.
      • In each row, an it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel> is used to provide the PresentationModels for each column.
      • A Displayable (optional) is used to provide the text to render for each item.
      • A CustomGraphicProvider (optional) is used to provide the graphics to render for each item.
      • A Styleable (optional) is used to provide the rendering style for each item.
      • A UserActionProvider (optional) is used to provide the actions for creating a context menu; the default action is also bound to the double click or SPACE gesture.
      • A Visible (optional) is used to decide whether the root node should be visible or not.
      The process of populating data is performed in background threads, so this method quickly returns also in case of large amount of data. The initialization callback is called in the JavaFX thread when data population has been completed.
      Parameters:
      treeTableView - the TreeTableView
      pm - the PresentationModel
      initCallback - the callback
    • bind

      default void bind(@Nonnull javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Runnable initCallback)
      Parameters:
      treeTableView - the TreeTableView
      pm - the PresentationModel
      initCallback - the callback
      Since:
      1.0-ALPHA-13
    • bind

      default void bind(@Nonnull javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm)
      Parameters:
      treeTableView - the TreeTableView
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bind

      void bind(@Nonnull javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Optional<Runnable> initCallback)
      Binds a ListView to a PresentationModel and an optional callback. The PresentationModel is used to populate the table. The following roles are used:
      • A SimpleComposite provides children PresentationModels for each row.
      • In each row, an it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel> is used to provide the PresentationModels for each column.
      • A Displayable (optional) is used to provide the text to render for each item.
      • A CustomGraphicProvider (optional) is used to provide the graphics to render for each item.
      • A Styleable (optional) is used to provide the rendering style for each item.
      • A UserActionProvider (optional) is used to provide the actions for creating a context menu; the default action is also bound to the double click or SPACE gesture.
      The process of populating data is performed in background threads, so this method quickly returns also in case of large amount of data. The initialization callback is called in the JavaFX thread when data population has been completed.
      Parameters:
      listView - the ListView
      pm - the PresentationModel
      initCallback - the callback
    • bind

      default void bind(@Nonnull javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Runnable initCallback)
      Parameters:
      listView - the ListView
      pm - the PresentationModel
      initCallback - the callback
      Since:
      1.0-ALPHA-13
    • bind

      default void bind(@Nonnull javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, @Nonnull it.tidalwave.role.ui.PresentationModel pm)
      Parameters:
      listView - the ListView
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bind

      void bind(@Nonnull javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Optional<Runnable> initCallback)
      Binds a ComboBox to a PresentationModel and an optional callback. The PresentationModel is used to populate the table. The following roles are used:
      • A SimpleComposite provides children PresentationModels for each row.
      • In each row, an it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel> is used to provide the PresentationModels for each column.
      • A Displayable (optional) is used to provide the text to render for each item.
      • A CustomGraphicProvider (optional) is used to provide the graphics to render for each item.
      • A Styleable (optional) is used to provide the rendering style for each item.
      • A UserActionProvider (optional) is used to provide the actions for creating a context menu; the default action is also bound to the double click or SPACE gesture.
      The process of populating data is performed in background threads, so this method quickly returns also in case of large amount of data. The initialization callback is called in the JavaFX thread when data population has been completed.
      Parameters:
      comboBox - the ComboBox
      pm - the PresentationModel
      initCallback - the callback
    • bind

      default void bind(@Nonnull javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull Runnable initCallback)
      Parameters:
      comboBox - the ComboBox
      pm - the PresentationModel
      initCallback - the callback
      Since:
      1.0-ALPHA-13
    • bind

      default void bind(@Nonnull javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, @Nonnull it.tidalwave.role.ui.PresentationModel pm)
      Parameters:
      comboBox - the ComboBox
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bindToggleButtons

      void bindToggleButtons(@Nonnull javafx.scene.layout.Pane pane, @Nonnull it.tidalwave.role.ui.PresentationModel pm)
      Given a PresentationModel that contains a Composite, populate the pane with ToggleButtons associated to the elements of the Composite. Each element is searched for the following roles:
      • UserActionProvider (mandatory) to provide a callback for the button
      • Displayable to provide a text for the button
      • Styleable to provide a CSS style for the button
      The pane must be pre-populated with at least one button, which will be queried for the CSS style.
      Parameters:
      pane - the Pane
      pm - the PresentationModel
    • bindButtonsInPane

      @Deprecated void bindButtonsInPane(@Nonnull javafx.scene.layout.GridPane gridPane, @Nonnull Collection<it.tidalwave.role.ui.UserAction> actions)
      Deprecated.
      Deprecated. Merge to bindToggleButtons, passing some arguments for choosing toggle or normal buttons.
    • bindBidirectionally

      <T> void bindBidirectionally(@Nonnull javafx.beans.property.Property<T> property1, @Nonnull it.tidalwave.role.ui.BoundProperty<T> property2)
      Bidirectionally binds two properties.
      Type Parameters:
      T - the property type
      Parameters:
      property1 - the former property
      property2 - the latter property
    • bindBidirectionally

      <T> void bindBidirectionally(@Nonnull javafx.scene.control.TextField textField, @Nonnull it.tidalwave.role.ui.BoundProperty<String> textProperty, @Nonnull it.tidalwave.role.ui.BoundProperty<Boolean> validProperty)
    • showInModalDialog

      void showInModalDialog(@Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification, @Nonnull Optional<javafx.scene.Node> node)
      Shows a modal dialog with the given content and provides feedback by means of the given notification.
      Parameters:
      notification - the object notifying whether the operation is confirmed or cancelled
      node - the dialog content
    • showInModalDialog

      default void showInModalDialog(@Nonnull javafx.scene.Node node, @Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification, @Nonnull it.tidalwave.role.ui.BoundProperty<Boolean> valid)
    • showInModalDialog

      @Deprecated default void showInModalDialog(@Nonnull javafx.scene.Node node, @Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification)
      Deprecated.
    • showInModalDialog

      default void showInModalDialog(@Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification)
    • openFileChooserFor

      void openFileChooserFor(@Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification, @Nonnull it.tidalwave.role.ui.BoundProperty<Path> selectedFile)
      Opens the FileChooser for selecting a file. The outcome of the operation (confirmed or cancelled) will be notified to the given notification object. The selected file will be set to the given bound property, which can be also used to set the default value rendered on the FileChooser.
      Parameters:
      notification - the object notifying whether the operation is confirmed or cancelled
      selectedFile - the property containing the selected file
    • openDirectoryChooserFor

      void openDirectoryChooserFor(@Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification, @Nonnull it.tidalwave.role.ui.BoundProperty<Path> selectedFolder)
      Opens the FileChooser for selecting a folder. The outcome of the operation (confirmed or cancelled) will be notified to the given notification object. The selected folder will be set to the given bound property, which can be also used to set the default value rendered on the FileChooser.
      Parameters:
      notification - the object notifying whether the operation is confirmed or cancelled
      selectedFolder - the property containing the selected folder