Class StreamPiAlert

java.lang.Object
com.stream_pi.util.alert.StreamPiAlert

public class StreamPiAlert extends Object
Custom Alert Dialog for Server and Client
  • Constructor Details

    • StreamPiAlert

      public StreamPiAlert(String contextText)
    • 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 Alert
      streamPiAlertType - Alert Type
      contentPane - The main body of the alert
    • StreamPiAlert

      public StreamPiAlert(String title, String contentText)
      Constructor for very simple alert, with just title and body text Default AlertType will be INFORMATION
      Parameters:
      title - Heading
      contentText - Body Text
    • StreamPiAlert

      public StreamPiAlert(String contentText, StreamPiAlertType alertType)
      Constructor for alert with just "Alert" heading, content text and alert type
      Parameters:
      contentText - Body Text
      alertType - Alert Type
    • StreamPiAlert

      public StreamPiAlert(String title, StreamPiAlertType streamPiAlertType, String... buttons)
      Constructor to create Alert box with title, Alert Type and button choices
      Parameters:
      title - Heading
      streamPiAlertType - Alert Type
      buttons - 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 box
      streamPiAlertType - Alert Type
      contentPane - Alert Body
      buttons - Button choices
    • StreamPiAlert

      public StreamPiAlert(String title, String contentText, StreamPiAlertType streamPiAlertType)
      Constructor to create Alert Box with Heading, content text, Alert Type
      Parameters:
      title - Heading
      contentText - Body Text
      streamPiAlertType - 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

      public void setStreamPiAlertType(StreamPiAlertType streamPiAlertType)
      Sets the Alert type
      Parameters:
      streamPiAlertType - Alert Type
    • setOnClicked

      public void setOnClicked(StreamPiAlertListener streamPiAlertListener)
      Set on click Listener
      Parameters:
      streamPiAlertListener - Alert Listener, triggered when a button is clicked
    • getTitle

      public String getTitle()
      Returns:
      Heading of the Alert Box
    • getButtons

      public String[] getButtons()
      Returns:
      Button Choices
    • setAlertContent

      public void setAlertContent(javafx.scene.layout.Pane contentPane)
      Parameters:
      contentPane - Alert Body Node
    • setButtons

      public void setButtons(String... buttons)
      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()
    • destroy

      public void destroy()
      Removes the alert from the parent pane
    • setIsShowPopup

      public static void setIsShowPopup(boolean isShowPopup)
    • isIsShowPopup

      public static boolean isIsShowPopup()