public interface JavaFXBinder
- Author:
- Fabrizio Giudici
-
Method Summary
Modifier and TypeMethodDescription<T,S> void bind(BoundProperty<? super T> target, javafx.beans.property.Property<? extends S> source, Function<S, T> adapter) Binds two properties of different types.default <T> voidbind(BoundProperty<? super T> target, javafx.beans.property.Property<T> source) Binds two properties of the same type.voidbind(javafx.scene.control.ButtonBase button, UserAction action) Binds a button to aUserAction.default voidbind(javafx.scene.control.ComboBox<PresentationModel> comboBox, PresentationModel pm) Binds aComboBoxto aPresentationModel.default voidbind(javafx.scene.control.ComboBox<PresentationModel> comboBox, PresentationModel pm, Runnable initCallback) Binds aComboBoxto aPresentationModeland a callback.voidbind(javafx.scene.control.ComboBox<PresentationModel> comboBox, PresentationModel pm, Optional<Runnable> initCallback) Binds aComboBoxto aPresentationModeland an optional callback.default voidbind(javafx.scene.control.ListView<PresentationModel> listView, PresentationModel pm) Binds aComboBoxto aPresentationModel.default voidbind(javafx.scene.control.ListView<PresentationModel> listView, PresentationModel pm, Runnable initCallback) Binds aListViewto aPresentationModeland a callback.voidbind(javafx.scene.control.ListView<PresentationModel> listView, PresentationModel pm, Optional<Runnable> initCallback) Binds aListViewto aPresentationModeland an optional callback.voidbind(javafx.scene.control.MenuItem menuItem, UserAction action) Binds a menu item to aUserAction.default voidbind(javafx.scene.control.TableView<PresentationModel> tableView, PresentationModel pm) Binds aTableViewto aPresentationModel.default voidbind(javafx.scene.control.TableView<PresentationModel> tableView, PresentationModel pm, Runnable initCallback) Binds aTableViewto aPresentationModeland a callback.voidbind(javafx.scene.control.TableView<PresentationModel> tableView, PresentationModel pm, Optional<Runnable> initCallback) Binds aTableViewto aPresentationModeland an optional callback.default voidbind(javafx.scene.control.TreeTableView<PresentationModel> treeTableView, PresentationModel pm) Binds aTreeTableViewto aPresentationModel.default voidbind(javafx.scene.control.TreeTableView<PresentationModel> treeTableView, PresentationModel pm, Runnable initCallback) Binds aTreeTableViewto aPresentationModeland a callback.voidbind(javafx.scene.control.TreeTableView<PresentationModel> treeTableView, PresentationModel pm, Optional<Runnable> initCallback) Binds aTreeTableViewto aPresentationModeland a callback.default voidbind(javafx.scene.control.TreeView<PresentationModel> treeView, PresentationModel pm) Binds aTableViewto aPresentationModel.default voidbind(javafx.scene.control.TreeView<PresentationModel> treeView, PresentationModel pm, Runnable initCallback) Binds aTableViewto aPresentationModeland a callback.voidbind(javafx.scene.control.TreeView<PresentationModel> treeView, PresentationModel pm, Optional<Runnable> initCallback) Binds aTreeViewto aPresentationModeland a callback.default voidbindBidirectionally(BoundProperty<? super Boolean> property1, javafx.beans.property.BooleanProperty property2) Bidirectionally binds two properties.default voidbindBidirectionally(BoundProperty<? super Double> property1, javafx.beans.property.DoubleProperty property2) Bidirectionally binds two properties.default voidbindBidirectionally(BoundProperty<? super Integer> property1, javafx.beans.property.IntegerProperty property2) Bidirectionally binds two properties.default voidbindBidirectionally(BoundProperty<? super Long> property1, javafx.beans.property.LongProperty property2) Bidirectionally binds two properties.<T,S> void bindBidirectionally(BoundProperty<? super T> property1, javafx.beans.property.Property<S> property2, Function<? super S, T> adapter, Function<? super T, ? extends S> reverseAdapter) Bidirectionally binds two properties of different types.default <T> voidbindBidirectionally(BoundProperty<? super T> property1, javafx.beans.property.Property<T> property2) voidbindBidirectionally(javafx.scene.control.TextField textField, BoundProperty<String> textProperty, BoundProperty<Boolean> validProperty) voidbindButtonsInPane(javafx.scene.layout.GridPane gridPane, Collection<UserAction> actions) Deprecated.voidbindToggleButtons(javafx.scene.layout.Pane pane, PresentationModel pm) Given aPresentationModelthat contains aComposite, populate the pane withToggleButtons associated to the elements of theComposite.voidopenDirectoryChooserFor(UserNotificationWithFeedback notification, BoundProperty<Path> selectedFolder) Opens the FileChooser for selecting a folder.voidopenFileChooserFor(UserNotificationWithFeedback notification, BoundProperty<Path> selectedFile) Opens the FileChooser for selecting a file.default voidshowInModalDialog(UserNotification notification) Shows a modal dialog with the given content and provides feedback by means of the given notification.default voidshowInModalDialog(UserNotificationWithFeedback notification) voidshowInModalDialog(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 voidshowInModalDialog(javafx.scene.Node node, UserNotificationWithFeedback notification) Deprecated.default voidshowInModalDialog(javafx.scene.Node node, UserNotificationWithFeedback notification, BoundProperty<Boolean> valid)
-
Method Details
-
bind
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
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<PresentationModel> tableView, @Nonnull PresentationModel pm, @Nonnull Optional<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
it.tidalwave.role.Aggregate<PresentationModel>is 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<PresentationModel> tableView, @Nonnull PresentationModel pm, @Nonnull Runnable initCallback) Binds aTableViewto aPresentationModeland a callback. Seebind(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- theTablewViewpm- thePresentationModelinitCallback- the callback
-
bind
default void bind(@Nonnull javafx.scene.control.TableView<PresentationModel> tableView, @Nonnull PresentationModel pm) Binds aTableViewto aPresentationModel. Seebind(javafx.scene.control.TableView, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional).- Parameters:
tableView- theTablewViewpm- thePresentationModel- Since:
- 1.0-ALPHA-13
-
bind
void bind(@Nonnull javafx.scene.control.TreeView<PresentationModel> treeView, @Nonnull PresentationModel pm, @Nonnull Optional<Runnable> initCallback) Binds aTreeViewto aPresentationModeland a callback. ThePresentationModelis used to populate the table. The following roles are used:- A
SimpleCompositeprovides childrenPresentationModels for each row. - In each row, an
it.tidalwave.role.Aggregate<PresentationModel>is 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. - A
Visibility(optional) is used to decide whether the root node should be visible or not.
- Parameters:
treeView- theTreeViewpm- thePresentationModelinitCallback- the callback
- A
-
bind
default void bind(@Nonnull javafx.scene.control.TreeView<PresentationModel> treeView, @Nonnull PresentationModel pm, @Nonnull Runnable initCallback) Binds aTableViewto aPresentationModeland a callback. Seebind(javafx.scene.control.TreeView, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional).- Parameters:
treeView- theTreeViewpm- thePresentationModelinitCallback- the callback- Since:
- 1.0-ALPHA-13
-
bind
default void bind(@Nonnull javafx.scene.control.TreeView<PresentationModel> treeView, @Nonnull PresentationModel pm) Binds aTableViewto aPresentationModel. Seebind(javafx.scene.control.TableView, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional)- Parameters:
treeView- theTreeViewpm- thePresentationModel- Since:
- 1.0-ALPHA-13
-
bind
void bind(@Nonnull javafx.scene.control.TreeTableView<PresentationModel> treeTableView, @Nonnull PresentationModel pm, @Nonnull Optional<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
it.tidalwave.role.Aggregate<PresentationModel>is 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. - A
Visibility(optional) is used to decide whether the root node should be visible or not.
- Parameters:
treeTableView- theTreeTableViewpm- thePresentationModelinitCallback- the callback
- A
-
bind
default void bind(@Nonnull javafx.scene.control.TreeTableView<PresentationModel> treeTableView, @Nonnull PresentationModel pm, @Nonnull Runnable initCallback) Binds aTreeTableViewto aPresentationModeland a callback. Seebind(javafx.scene.control.TreeTableView, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional).- Parameters:
treeTableView- theTreeTableViewpm- thePresentationModelinitCallback- the callback- Since:
- 1.0-ALPHA-13
-
bind
default void bind(@Nonnull javafx.scene.control.TreeTableView<PresentationModel> treeTableView, @Nonnull PresentationModel pm) Binds aTreeTableViewto aPresentationModel. Seebind(javafx.scene.control.TreeTableView, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional).- Parameters:
treeTableView- theTreeTableViewpm- thePresentationModel- Since:
- 1.0-ALPHA-13
-
bind
void bind(@Nonnull javafx.scene.control.ListView<PresentationModel> listView, @Nonnull PresentationModel pm, @Nonnull Optional<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
it.tidalwave.role.Aggregate<PresentationModel>is 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<PresentationModel> listView, @Nonnull PresentationModel pm, @Nonnull Runnable initCallback) Binds aListViewto aPresentationModeland a callback. Seebind(javafx.scene.control.ListView, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional).- Parameters:
listView- theListViewpm- thePresentationModelinitCallback- the callback- Since:
- 1.0-ALPHA-13
-
bind
default void bind(@Nonnull javafx.scene.control.ListView<PresentationModel> listView, @Nonnull PresentationModel pm) Binds aComboBoxto aPresentationModel. Seebind(javafx.scene.control.ListView, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional).- Parameters:
listView- theListViewpm- thePresentationModel- Since:
- 1.0-ALPHA-13
-
bind
void bind(@Nonnull javafx.scene.control.ComboBox<PresentationModel> comboBox, @Nonnull PresentationModel pm, @Nonnull Optional<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
it.tidalwave.role.Aggregate<PresentationModel>is 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<PresentationModel> comboBox, @Nonnull PresentationModel pm, @Nonnull Runnable initCallback) Binds aComboBoxto aPresentationModeland a callback. Seebind(javafx.scene.control.ComboBox, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional).- Parameters:
comboBox- theComboBoxpm- thePresentationModelinitCallback- the callback- Since:
- 1.0-ALPHA-13
-
bind
default void bind(@Nonnull javafx.scene.control.ComboBox<PresentationModel> comboBox, @Nonnull PresentationModel pm) Binds aComboBoxto aPresentationModel. Seebind(javafx.scene.control.ComboBox, it.tidalwave.ui.core.role.PresentationModel, java.util.Optional).- Parameters:
comboBox- theComboBoxpm- thePresentationModel- Since:
- 1.0-ALPHA-13
-
bindToggleButtons
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 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 typeS- the source property type- Parameters:
target- the target propertysource- the source propertyadapter- 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 propertysource- 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 typeS- the latter property type- Parameters:
property1- the former propertyproperty2- the latter propertyadapter- an adapter from one type to the otherreverseAdapter- 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 propertyproperty2- 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 propertyproperty2- 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 propertyproperty2- 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 propertyproperty2- the latter property
-
bindBidirectionally
void bindBidirectionally(@Nonnull javafx.scene.control.TextField textField, @Nonnull BoundProperty<String> textProperty, @Nonnull BoundProperty<Boolean> validProperty) -
showInModalDialog
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 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 UserNotificationWithFeedback notification, @Nonnull BoundProperty<Boolean> valid) -
showInModalDialog
@Deprecated default void showInModalDialog(@Nonnull javafx.scene.Node node, @Nonnull UserNotificationWithFeedback notification) Deprecated. -
showInModalDialog
-
openFileChooserFor
void openFileChooserFor(@Nonnull 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 cancelledselectedFile- the property containing the selected file
-
openDirectoryChooserFor
void openDirectoryChooserFor(@Nonnull 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 cancelledselectedFolder- the property containing the selected folder
-