Interface JavaFXBinder


public interface JavaFXBinder
Author:
Fabrizio Giudici
  • 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 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 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<PresentationModel> tableView, @Nonnull 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<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<PresentationModel> tableView, @Nonnull PresentationModel pm, @Nonnull Runnable initCallback)
      Binds a TableView to a PresentationModel and a callback. See bind(javafx.scene.control.TableView, it.tidalwave.ui.core.role.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<PresentationModel> tableView, @Nonnull PresentationModel pm)
      Parameters:
      tableView - the TablewView
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bind

      void bind(@Nonnull javafx.scene.control.TreeView<PresentationModel> treeView, @Nonnull 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<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 Visibility (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<PresentationModel> treeView, @Nonnull 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<PresentationModel> treeView, @Nonnull PresentationModel pm)
      Parameters:
      treeView - the TreeView
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bind

      void bind(@Nonnull javafx.scene.control.TreeTableView<PresentationModel> treeTableView, @Nonnull 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<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 Visibility (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<PresentationModel> treeTableView, @Nonnull 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<PresentationModel> treeTableView, @Nonnull PresentationModel pm)
      Parameters:
      treeTableView - the TreeTableView
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bind

      void bind(@Nonnull javafx.scene.control.ListView<PresentationModel> listView, @Nonnull 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<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<PresentationModel> listView, @Nonnull 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<PresentationModel> listView, @Nonnull PresentationModel pm)
      Parameters:
      listView - the ListView
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bind

      void bind(@Nonnull javafx.scene.control.ComboBox<PresentationModel> comboBox, @Nonnull 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<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<PresentationModel> comboBox, @Nonnull 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<PresentationModel> comboBox, @Nonnull PresentationModel pm)
      Parameters:
      comboBox - the ComboBox
      pm - the PresentationModel
      Since:
      1.0-ALPHA-13
    • bindToggleButtons

      void bindToggleButtons(@Nonnull javafx.scene.layout.Pane pane, @Nonnull 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: 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<UserAction> actions)
      Deprecated.
      Deprecated. Merge to bindToggleButtons, passing some arguments for choosing toggle or normal buttons.
    • bind

      <T, S> void bind(@Nonnull BoundProperty<? super T> target, @Nonnull javafx.beans.property.Property<? extends S> source, @Nonnull Function<S,T> adapter)
      Binds two properties of different types.
      Type Parameters:
      T - the target property type
      S - the source property type
      Parameters:
      target - the target property
      source - the source property
      adapter - an adapter from one source to the target
      Since:
      2.0-ALPHA-1
    • bind

      default <T> void bind(@Nonnull BoundProperty<? super T> target, @Nonnull javafx.beans.property.Property<T> source)
      Binds two properties of the same type.
      Type Parameters:
      T - the property type
      Parameters:
      target - the target property
      source - the source property
      Since:
      2.0-ALPHA-1
    • bindBidirectionally

      <T, S> void bindBidirectionally(@Nonnull BoundProperty<? super T> property1, @Nonnull javafx.beans.property.Property<S> property2, @Nonnull Function<? super S,T> adapter, @Nonnull Function<? super T,? extends S> reverseAdapter)
      Bidirectionally binds two properties of different types.
      Type Parameters:
      T - the former property type
      S - the latter property type
      Parameters:
      property1 - the former property
      property2 - the latter property
      adapter - an adapter from one type to the other
      reverseAdapter - the reverse adapter
      Since:
      2.0-ALPHA-1
    • bindBidirectionally

      default <T> void bindBidirectionally(@Nonnull BoundProperty<? super T> property1, @Nonnull javafx.beans.property.Property<T> property2)
    • bindBidirectionally

      default void bindBidirectionally(@Nonnull BoundProperty<? super Boolean> property1, @Nonnull javafx.beans.property.BooleanProperty property2)
      Bidirectionally binds two properties.
      Parameters:
      property1 - the former property
      property2 - the latter property
    • bindBidirectionally

      default void bindBidirectionally(@Nonnull BoundProperty<? super Integer> property1, @Nonnull javafx.beans.property.IntegerProperty property2)
      Bidirectionally binds two properties.
      Parameters:
      property1 - the former property
      property2 - the latter property
    • bindBidirectionally

      default void bindBidirectionally(@Nonnull BoundProperty<? super Long> property1, @Nonnull javafx.beans.property.LongProperty property2)
      Bidirectionally binds two properties.
      Parameters:
      property1 - the former property
      property2 - the latter property
    • bindBidirectionally

      default void bindBidirectionally(@Nonnull BoundProperty<? super Double> property1, @Nonnull javafx.beans.property.DoubleProperty property2)
      Bidirectionally binds two properties.
      Parameters:
      property1 - the former property
      property2 - the latter property
    • bindBidirectionally

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

      default void showInModalDialog(@Nonnull it.tidalwave.util.ui.UserNotification notification)
      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
      Since:
      1.1-ALPHA-6
    • 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 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 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 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