Package it.tidalwave.role.ui.javafx
Interface JavaFXBinder
public interface JavaFXBinder
- Author:
- Fabrizio Giudici
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(javafx.scene.control.ButtonBase button, it.tidalwave.role.ui.UserAction action) Binds a button to aUserAction
.default void
bind
(javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, it.tidalwave.role.ui.PresentationModel pm) Binds aComboBox
to aPresentationModel
.default void
bind
(javafx.scene.control.ComboBox<it.tidalwave.role.ui.PresentationModel> comboBox, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback) Binds aComboBox
to aPresentationModel
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 aComboBox
to aPresentationModel
and an optional callback.default void
bind
(javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, it.tidalwave.role.ui.PresentationModel pm) Binds aComboBox
to aPresentationModel
.default void
bind
(javafx.scene.control.ListView<it.tidalwave.role.ui.PresentationModel> listView, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback) Binds aListView
to aPresentationModel
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 aListView
to aPresentationModel
and an optional callback.void
bind
(javafx.scene.control.MenuItem menuItem, it.tidalwave.role.ui.UserAction action) Binds a menu item to aUserAction
.default void
bind
(javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, it.tidalwave.role.ui.PresentationModel pm) Binds aTableView
to aPresentationModel
.default void
bind
(javafx.scene.control.TableView<it.tidalwave.role.ui.PresentationModel> tableView, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback) Binds aTableView
to aPresentationModel
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 aTableView
to aPresentationModel
and an optional callback.default void
bind
(javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, it.tidalwave.role.ui.PresentationModel pm) Binds aTreeTableView
to aPresentationModel
.default void
bind
(javafx.scene.control.TreeTableView<it.tidalwave.role.ui.PresentationModel> treeTableView, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback) Binds aTreeTableView
to aPresentationModel
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 aTreeTableView
to aPresentationModel
and a callback.default void
bind
(javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, it.tidalwave.role.ui.PresentationModel pm) Binds aTableView
to aPresentationModel
.default void
bind
(javafx.scene.control.TreeView<it.tidalwave.role.ui.PresentationModel> treeView, it.tidalwave.role.ui.PresentationModel pm, Runnable initCallback) Binds aTableView
to aPresentationModel
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 aTreeView
to aPresentationModel
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 aPresentationModel
that contains aComposite
, populate the pane withToggleButton
s associated to the elements of theComposite
.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 aUserAction
. The following roles o the action are used:- Displayable: to set the label of the button
enabled
property of theUserAction
is bound, negated, to thedisabled
property 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
enabled
property of theUserAction
is bound, negated, to thedisabled
property 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 Optional<Runnable> initCallback) Binds aTableView
to aPresentationModel
and an optional callback. ThePresentationModel
is used to populate the table. The following roles are used:- A
SimpleComposite
provides childrenPresentationModel
s for each row. - In each row, an
it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel>
is used to provide thePresentationModel
s 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
- theTablewView
pm
- thePresentationModel
initCallback
- 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 Runnable initCallback) Binds aTableView
to aPresentationModel
and 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
- theTablewView
pm
- thePresentationModel
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) Binds aTableView
to aPresentationModel
. Seebind(javafx.scene.control.TableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
.- Parameters:
tableView
- theTablewView
pm
- 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 Optional<Runnable> initCallback) Binds aTreeView
to aPresentationModel
and a callback. ThePresentationModel
is used to populate the table. The following roles are used:- A
SimpleComposite
provides childrenPresentationModel
s for each row. - In each row, an
it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel>
is used to provide thePresentationModel
s 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.
- Parameters:
treeView
- theTreeView
pm
- thePresentationModel
initCallback
- 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 Runnable initCallback) Binds aTableView
to aPresentationModel
and a callback. Seebind(javafx.scene.control.TreeView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
.- Parameters:
treeView
- theTreeView
pm
- thePresentationModel
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) Binds aTableView
to aPresentationModel
. Seebind(javafx.scene.control.TableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
- Parameters:
treeView
- theTreeView
pm
- 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 Optional<Runnable> initCallback) Binds aTreeTableView
to aPresentationModel
and a callback. ThePresentationModel
is used to populate the table. The following roles are used:- A
SimpleComposite
provides childrenPresentationModel
s for each row. - In each row, an
it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel>
is used to provide thePresentationModel
s 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.
- Parameters:
treeTableView
- theTreeTableView
pm
- thePresentationModel
initCallback
- 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 Runnable initCallback) Binds aTreeTableView
to aPresentationModel
and a callback. Seebind(javafx.scene.control.TreeTableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
.- Parameters:
treeTableView
- theTreeTableView
pm
- thePresentationModel
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) Binds aTreeTableView
to aPresentationModel
. Seebind(javafx.scene.control.TreeTableView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
.- Parameters:
treeTableView
- theTreeTableView
pm
- 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 Optional<Runnable> initCallback) Binds aListView
to aPresentationModel
and an optional callback. ThePresentationModel
is used to populate the table. The following roles are used:- A
SimpleComposite
provides childrenPresentationModel
s for each row. - In each row, an
it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel>
is used to provide thePresentationModel
s 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
- theListView
pm
- thePresentationModel
initCallback
- 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 Runnable initCallback) Binds aListView
to aPresentationModel
and a callback. Seebind(javafx.scene.control.ListView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
.- Parameters:
listView
- theListView
pm
- thePresentationModel
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) Binds aComboBox
to aPresentationModel
. Seebind(javafx.scene.control.ListView, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
.- Parameters:
listView
- theListView
pm
- 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 Optional<Runnable> initCallback) Binds aComboBox
to aPresentationModel
and an optional callback. ThePresentationModel
is used to populate the table. The following roles are used:- A
SimpleComposite
provides childrenPresentationModel
s for each row. - In each row, an
it.tidalwave.role.Aggregate<it.tidalwave.role.ui.PresentationModel>
is used to provide thePresentationModel
s 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
- theComboBox
pm
- thePresentationModel
initCallback
- 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 Runnable initCallback) Binds aComboBox
to aPresentationModel
and a callback. Seebind(javafx.scene.control.ComboBox, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
.- Parameters:
comboBox
- theComboBox
pm
- thePresentationModel
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) Binds aComboBox
to aPresentationModel
. Seebind(javafx.scene.control.ComboBox, it.tidalwave.role.ui.PresentationModel, java.util.Optional)
.- Parameters:
comboBox
- theComboBox
pm
- thePresentationModel
- Since:
- 1.0-ALPHA-13
-
bindToggleButtons
void bindToggleButtons(@Nonnull javafx.scene.layout.Pane pane, @Nonnull it.tidalwave.role.ui.PresentationModel pm) Given aPresentationModel
that contains aComposite
, populate the pane withToggleButton
s associated to the elements of theComposite
. Each element is searched for the following roles:UserActionProvider
(mandatory) to provide a callback for the buttonDisplayable
to provide a text for the buttonStyleable
to provide a CSS style for the button
- Parameters:
pane
- thePane
pm
- thePresentationModel
-
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 propertyproperty2
- the latter property
-
bindBidirectionally
-
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 cancellednode
- 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 cancelledselectedFile
- 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 cancelledselectedFolder
- the property containing the selected folder
-