java.lang.Object
com.dlsc.gemsfx.infocenter.NotificationAction<T>
- Type Parameters:
T- the type of the user object of the notification
Actions can be attached to notifications via
Notification.getActions(). The UI
will create a control (button or menu item) for each action so that the user can trigger
the action. This allows for a quick response on incoming notifications, e.g. "open the
mail".-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.StringPropertyThe text that will be used in the UI when creating controls that will trigger the action. -
Constructor Summary
ConstructorsConstructorDescriptionNotificationAction(String text) Constructs a new action with the given text.NotificationAction(String text, javafx.util.Callback<Notification<T>, Notification.OnClickBehaviour> onAction) Constructs a new action with the given text. -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.util.Callback<Notification<T>,Notification.OnClickBehaviour> Returns the callback that will be invoked when the user selects the action in the UI.final StringgetText()Gets the value of thetextproperty.final voidsetOnAction(javafx.util.Callback<Notification<T>, Notification.OnClickBehaviour> onAction) Sets the callback that will be invoked when the user selects the action in the UI.final voidSets the value of thetextproperty.final javafx.beans.property.StringPropertyThe text that will be used in the UI when creating controls that will trigger the action.
-
Property Details
-
text
public final javafx.beans.property.StringProperty textPropertyThe text that will be used in the UI when creating controls that will trigger the action.- See Also:
-
-
Constructor Details
-
NotificationAction
Constructs a new action with the given text. The default action behaviour will be to remove the notification from its group. No additional application logic will be executed.- Parameters:
text- the text of the action as shown in the UI
-
NotificationAction
public NotificationAction(String text, javafx.util.Callback<Notification<T>, Notification.OnClickBehaviour> onAction) Constructs a new action with the given text.- Parameters:
text- the text of the action as shown in the UIonAction- the application logic to perform when the user selects the action
-
-
Method Details
-
getText
Gets the value of thetextproperty.- Property description:
- The text that will be used in the UI when creating controls that will trigger the action.
- Returns:
- the value of the
textproperty - See Also:
-
textProperty
public final javafx.beans.property.StringProperty textProperty()The text that will be used in the UI when creating controls that will trigger the action.- Returns:
- the text for the action
- See Also:
-
setText
Sets the value of thetextproperty.- Property description:
- The text that will be used in the UI when creating controls that will trigger the action.
- Parameters:
text- the value for thetextproperty- See Also:
-
getOnAction
Returns the callback that will be invoked when the user selects the action in the UI.- Returns:
- the callback to invoke when the user triggers the action
-
setOnAction
public final void setOnAction(javafx.util.Callback<Notification<T>, Notification.OnClickBehaviour> onAction) Sets the callback that will be invoked when the user selects the action in the UI.- Parameters:
onAction- the callback to invoke when the user triggers the action
-