java.lang.Object
com.stream_pi.util.alert.StreamPiAlert
Custom Alert Dialog for Server and Client
-
Constructor Summary
ConstructorsConstructorDescriptionStreamPiAlert(String contextText)
StreamPiAlert(String contentText, StreamPiAlertType alertType)
Constructor for alert with just "Alert" heading, content text and alert typeStreamPiAlert(String title, StreamPiAlertType streamPiAlertType, String... buttons)
Constructor to create Alert box with title, Alert Type and button choicesStreamPiAlert(String title, StreamPiAlertType streamPiAlertType, javafx.scene.layout.Pane contentPane)
Public constructor to make an alert with just title, pre-made content pane (mainly for forms, complex dialogs)StreamPiAlert(String title, StreamPiAlertType streamPiAlertType, javafx.scene.layout.Pane contentPane, String... buttons)
Constructor to create Alert Box with title, Alert Type, Body and button choicesStreamPiAlert(String title, String contentText)
Constructor for very simple alert, with just title and body text Default AlertType will be INFORMATIONStreamPiAlert(String title, String contentText, StreamPiAlertType streamPiAlertType)
Constructor to create Alert Box with Heading, content text, Alert Type -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Removes the alert from the parent paneString[]
javafx.scene.layout.Pane
static javafx.scene.layout.StackPane
Returns the parent nodegetTitle()
static boolean
void
setAlertContent(javafx.scene.layout.Pane contentPane)
void
setButtons(String... buttons)
Set all the button choicesstatic void
setIsShowPopup(boolean isShowPopup)
Sets whether Alert will act as a popup when shown.void
setOnClicked(StreamPiAlertListener streamPiAlertListener)
Set on click Listenerstatic void
setParent(javafx.scene.layout.StackPane parent)
Sets the parent where the alert will be shownvoid
setStreamPiAlertType(StreamPiAlertType streamPiAlertType)
Sets the Alert typevoid
show()
Shows the alert
-
Constructor Details
-
StreamPiAlert
-
StreamPiAlert
public StreamPiAlert(String title, StreamPiAlertType streamPiAlertType, javafx.scene.layout.Pane contentPane)Public constructor to make an alert with just title, pre-made content pane (mainly for forms, complex dialogs)- Parameters:
title
- Heading of the AlertstreamPiAlertType
- Alert TypecontentPane
- The main body of the alert
-
StreamPiAlert
Constructor for very simple alert, with just title and body text Default AlertType will be INFORMATION- Parameters:
title
- HeadingcontentText
- Body Text
-
StreamPiAlert
Constructor for alert with just "Alert" heading, content text and alert type- Parameters:
contentText
- Body TextalertType
- Alert Type
-
StreamPiAlert
Constructor to create Alert box with title, Alert Type and button choices- Parameters:
title
- HeadingstreamPiAlertType
- Alert Typebuttons
- Button choices
-
StreamPiAlert
public StreamPiAlert(String title, StreamPiAlertType streamPiAlertType, javafx.scene.layout.Pane contentPane, String... buttons)Constructor to create Alert Box with title, Alert Type, Body and button choices- Parameters:
title
- Heading of the alert boxstreamPiAlertType
- Alert TypecontentPane
- Alert Bodybuttons
- Button choices
-
StreamPiAlert
Constructor to create Alert Box with Heading, content text, Alert Type- Parameters:
title
- HeadingcontentText
- Body TextstreamPiAlertType
- Alert Type
-
-
Method Details
-
setParent
public static void setParent(javafx.scene.layout.StackPane parent)Sets the parent where the alert will be shown- Parameters:
parent
- StackPane where the alert dialog will be shown
-
getParent
public static javafx.scene.layout.StackPane getParent()Returns the parent node- Returns:
- StackPane parent where the alert boxes will be shown
-
setStreamPiAlertType
Sets the Alert type- Parameters:
streamPiAlertType
- Alert Type
-
setOnClicked
Set on click Listener- Parameters:
streamPiAlertListener
- Alert Listener, triggered when a button is clicked
-
getTitle
- Returns:
- Heading of the Alert Box
-
getButtons
- Returns:
- Button Choices
-
setAlertContent
public void setAlertContent(javafx.scene.layout.Pane contentPane)- Parameters:
contentPane
- Alert Body Node
-
setButtons
Set all the button choices- Parameters:
buttons
- Array of button choices
-
getContentPane
public javafx.scene.layout.Pane getContentPane()- Returns:
- The body node of the Alert Box
-
show
public void show()Shows the alert -
destroy
public void destroy()Removes the alert from the parent pane -
setIsShowPopup
public static void setIsShowPopup(boolean isShowPopup)Sets whether Alert will act as a popup when shown. In other words, the parent window (Server/Client) will act as a popup and appear on top of all windows, if this is set true -
isIsShowPopup
public static boolean isIsShowPopup()- Returns:
- Returns if alert system acts as a popup or not
-