Package it.tidalwave.role.ui.javafx
Interface JavaFXBinder
-
public interface JavaFXBinder- Author:
- Fabrizio Giudici
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidbind(javafx.scene.control.ButtonBase button, it.tidalwave.role.ui.UserAction action)Binds a button to aUserAction.default voidbind(javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, it.tidalwave.role.ui.PresentationModel pm)Binds aComboBoxto aPresentationModel.default voidbind(javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, it.tidalwave.role.ui.PresentationModel pm, java.lang.Runnable initCallback)Binds aComboBoxto aPresentationModeland a callback.voidbind(javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, it.tidalwave.role.ui.PresentationModel pm, java.util.Optional<java.lang.Runnable> initCallback)Binds aComboBoxto aPresentationModeland an optional callback.default voidbind(javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, it.tidalwave.role.ui.PresentationModel pm)Binds aComboBoxto aPresentationModel.default voidbind(javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, it.tidalwave.role.ui.PresentationModel pm, java.lang.Runnable initCallback)Binds aListViewto aPresentationModeland a callback.voidbind(javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, it.tidalwave.role.ui.PresentationModel pm, java.util.Optional<java.lang.Runnable> initCallback)Binds aListViewto aPresentationModeland an optional callback.voidbind(javafx.scene.control.MenuItem menuItem, it.tidalwave.role.ui.UserAction action)Binds a menu item to aUserAction.default voidbind(javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, it.tidalwave.role.ui.PresentationModel pm)Binds aTableViewto aPresentationModel.default voidbind(javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, it.tidalwave.role.ui.PresentationModel pm, java.lang.Runnable initCallback)Binds aTableViewto aPresentationModeland a callback.voidbind(javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, it.tidalwave.role.ui.PresentationModel pm, java.util.Optional<java.lang.Runnable> initCallback)Binds aTableViewto aPresentationModeland an optional callback.default voidbind(javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, it.tidalwave.role.ui.PresentationModel pm)Binds aTreeTableViewto aPresentationModel.default voidbind(javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, it.tidalwave.role.ui.PresentationModel pm, java.lang.Runnable initCallback)Binds aTreeTableViewto aPresentationModeland a callback.voidbind(javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, it.tidalwave.role.ui.PresentationModel pm, java.util.Optional<java.lang.Runnable> initCallback)Binds aTreeTableViewto aPresentationModeland a callback.default voidbind(javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, it.tidalwave.role.ui.PresentationModel pm)Binds aTableViewto aPresentationModel.default voidbind(javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, it.tidalwave.role.ui.PresentationModel pm, java.lang.Runnable initCallback)Binds aTableViewto aPresentationModeland a callback.voidbind(javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, it.tidalwave.role.ui.PresentationModel pm, java.util.Optional<java.lang.Runnable> initCallback)Binds aTableViewto aPresentationModeland a callback.<T> voidbindBidirectionally(javafx.beans.property.Property<T> property1, it.tidalwave.role.ui.BoundProperty<T> property2)Bidirectionally binds two properties.<T> voidbindBidirectionally(javafx.scene.control.TextField textField, it.tidalwave.role.ui.BoundProperty<java.lang.String> textProperty, it.tidalwave.role.ui.BoundProperty<java.lang.Boolean> validProperty)voidbindButtonsInPane(javafx.scene.layout.GridPane gridPane, java.util.Collection<it.tidalwave.role.ui.UserAction> actions)Deprecated.voidbindToggleButtons(javafx.scene.layout.Pane pane, it.tidalwave.role.ui.PresentationModel pm)Given aPresentationModelthat contains aComposite, populate the pane withToggleButtons associated to the elements of theComposite.voidopenDirectoryChooserFor(it.tidalwave.util.ui.UserNotificationWithFeedback notification, it.tidalwave.role.ui.BoundProperty<java.nio.file.Path> selectedFolder)Opens the FileChooser for selecting a folder.voidopenFileChooserFor(it.tidalwave.util.ui.UserNotificationWithFeedback notification, it.tidalwave.role.ui.BoundProperty<java.nio.file.Path> selectedFile)Opens the FileChooser for selecting a file.voidsetMainWindow(javafx.stage.Window window)Sets the main window.default voidshowInModalDialog(it.tidalwave.util.ui.UserNotificationWithFeedback notification)voidshowInModalDialog(it.tidalwave.util.ui.UserNotificationWithFeedback notification, java.util.Optional<javafx.scene.Node> node)Shows a modal dialog with the given content and provides feedback by means of the given notification.default voidshowInModalDialog(javafx.scene.Node node, it.tidalwave.util.ui.UserNotificationWithFeedback notification)Deprecated.default voidshowInModalDialog(javafx.scene.Node node, it.tidalwave.util.ui.UserNotificationWithFeedback notification, it.tidalwave.role.ui.BoundProperty<java.lang.Boolean> valid)
-
-
-
Method Detail
-
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 aUserAction. The following roles o the action are used:- Displayable: to set the label of the button
enabledproperty of theUserActionis bound, negated, to thedisabledproperty of the button.- Parameters:
button- the buttonaction- the action
-
bind
void bind(@Nonnull javafx.scene.control.MenuItem menuItem, @Nonnull it.tidalwave.role.ui.UserAction action)Binds a menu item to aUserAction. The following roles o the action are used:- Displayable: to set the label of the menu item
enabledproperty of theUserActionis bound, negated, to thedisabledproperty of the menu item.- Parameters:
menuItem- the menu itemaction- the action
-
bind
void bind(@Nonnull javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull java.util.Optional<java.lang.Runnable> initCallback)Binds aTableViewto aPresentationModeland an optional callback. ThePresentationModelis used to populate the table. The following roles are used:- A
SimpleCompositeprovides childrenPresentationModels for each row. - In each row, an
Aggregateis used to provide thePresentationModels 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.
- Parameters:
tableView- theTablewViewpm- thePresentationModelinitCallback- the callback- Since:
- 1.0-ALPHA-13
- A
-
bind
default void bind(@Nonnull javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull java.lang.Runnable initCallback)Binds aTableViewto aPresentationModeland a callback. Seebind(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- theTablewViewpm- thePresentationModelinitCallback- the callback
-
bind
default void bind(@Nonnull javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm)Binds aTableViewto aPresentationModel. Seebind(javafx.scene.control.TableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional).- Parameters:
tableView- theTablewViewpm- thePresentationModel- 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 java.util.Optional<java.lang.Runnable> initCallback)Binds aTableViewto aPresentationModeland a callback. ThePresentationModelis used to populate the table. The following roles are used:- A
SimpleCompositeprovides childrenPresentationModels for each row. - In each row, an
Aggregateis used to provide thePresentationModels 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.
- Parameters:
treeView- theTreeViewpm- thePresentationModelinitCallback- the callback
- A
-
bind
default void bind(@Nonnull javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull java.lang.Runnable initCallback)Binds aTableViewto aPresentationModeland a callback. Seebind(javafx.scene.control.TreeView, it.tidalwave.role.ui.PresentationModel, java.util.Optional).- Parameters:
treeView- theTreeViewpm- thePresentationModelinitCallback- 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)Binds aTableViewto aPresentationModel. Seebind(javafx.scene.control.TableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)- Parameters:
treeView- theTreeViewpm- thePresentationModel- 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 java.util.Optional<java.lang.Runnable> initCallback)Binds aTreeTableViewto aPresentationModeland a callback. ThePresentationModelis used to populate the table. The following roles are used:- A
SimpleCompositeprovides childrenPresentationModels for each row. - In each row, an
Aggregateis used to provide thePresentationModels 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.
- Parameters:
treeTableView- theTreeTableViewpm- thePresentationModelinitCallback- the callback
- A
-
bind
default void bind(@Nonnull javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull java.lang.Runnable initCallback)Binds aTreeTableViewto aPresentationModeland a callback. Seebind(javafx.scene.control.TreeTableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional).- Parameters:
treeTableView- theTreeTableViewpm- thePresentationModelinitCallback- 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)Binds aTreeTableViewto aPresentationModel. Seebind(javafx.scene.control.TreeTableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional).- Parameters:
treeTableView- theTreeTableViewpm- thePresentationModel- 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 java.util.Optional<java.lang.Runnable> initCallback)Binds aListViewto aPresentationModeland an optional callback. ThePresentationModelis used to populate the table. The following roles are used:- A
SimpleCompositeprovides childrenPresentationModels for each row. - In each row, an
Aggregateis used to provide thePresentationModels 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.
- Parameters:
listView- theListViewpm- thePresentationModelinitCallback- the callback
- A
-
bind
default void bind(@Nonnull javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull java.lang.Runnable initCallback)Binds aListViewto aPresentationModeland a callback. Seebind(javafx.scene.control.ListView, it.tidalwave.role.ui.PresentationModel, java.util.Optional).- Parameters:
listView- theListViewpm- thePresentationModelinitCallback- 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)Binds aComboBoxto aPresentationModel. Seebind(javafx.scene.control.ListView, it.tidalwave.role.ui.PresentationModel, java.util.Optional).- Parameters:
listView- theListViewpm- thePresentationModel- 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 java.util.Optional<java.lang.Runnable> initCallback)Binds aComboBoxto aPresentationModeland an optional callback. ThePresentationModelis used to populate the table. The following roles are used:- A
SimpleCompositeprovides childrenPresentationModels for each row. - In each row, an
Aggregateis used to provide thePresentationModels 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.
- Parameters:
comboBox- theComboBoxpm- thePresentationModelinitCallback- the callback
- A
-
bind
default void bind(@Nonnull javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, @Nonnull it.tidalwave.role.ui.PresentationModel pm, @Nonnull java.lang.Runnable initCallback)Binds aComboBoxto aPresentationModeland a callback. Seebind(javafx.scene.control.ComboBox, it.tidalwave.role.ui.PresentationModel, java.util.Optional).- Parameters:
comboBox- theComboBoxpm- thePresentationModelinitCallback- 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)Binds aComboBoxto aPresentationModel. Seebind(javafx.scene.control.ComboBox, it.tidalwave.role.ui.PresentationModel, java.util.Optional).- Parameters:
comboBox- theComboBoxpm- thePresentationModel- Since:
- 1.0-ALPHA-13
-
bindToggleButtons
void bindToggleButtons(@Nonnull javafx.scene.layout.Pane pane, @Nonnull it.tidalwave.role.ui.PresentationModel pm)Given aPresentationModelthat contains aComposite, populate the pane withToggleButtons associated to the elements of theComposite. Each element is searched for the following roles:UserActionProvider(mandatory) to provide a callback for the buttonDisplayableto provide a text for the buttonStyleableto provide a CSS style for the button
- Parameters:
pane- thePanepm- thePresentationModel
-
bindButtonsInPane
@Deprecated void bindButtonsInPane(@Nonnull javafx.scene.layout.GridPane gridPane, @Nonnull java.util.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 propertyproperty2- the latter property
-
bindBidirectionally
<T> void bindBidirectionally(@Nonnull javafx.scene.control.TextField textField, @Nonnull it.tidalwave.role.ui.BoundProperty<java.lang.String> textProperty, @Nonnull it.tidalwave.role.ui.BoundProperty<java.lang.Boolean> validProperty)
-
showInModalDialog
void showInModalDialog(@Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification, @Nonnull java.util.Optional<javafx.scene.Node> node)Shows a modal dialog with the given content and provides feedback by means of the given notification.- Parameters:
node- the dialog contentnotification- the object notifying whether the operation is confirmed or cancelled
-
showInModalDialog
default void showInModalDialog(@Nonnull javafx.scene.Node node, @Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification, @Nonnull it.tidalwave.role.ui.BoundProperty<java.lang.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<java.nio.file.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 cancelledselectedFile- the property containing the selected file
-
openDirectoryChooserFor
void openDirectoryChooserFor(@Nonnull it.tidalwave.util.ui.UserNotificationWithFeedback notification, @Nonnull it.tidalwave.role.ui.BoundProperty<java.nio.file.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 cancelledselectedFolder- the property containing the selected folder
-
-