Class MessageBox

    • Constructor Detail

      • MessageBox

        public MessageBox()
        Creates the container without name with a null value without name.
    • Method Detail

      • getAppSessionMessageBox

        public MessageBox getAppSessionMessageBox()
        Gets the original AppSession instance of the message box when used in a client session.
        Returns:
        The message box, null if not from AppSession.
      • clone

        public MessageBox clone()
        Clones the message box. The new instance has no listeners.
        Overrides:
        clone in class PropCnr
        Returns:
        A new instance of the message box.
      • cloneWithListeners

        public MessageBox cloneWithListeners()
        Clones the message box and keeps all the listeners.
        Returns:
        A new instance of the message box with all the listeners.
      • onDispose

        public void onDispose​(IClientSessionGyro clientGyro)
        Called when the client session is disposed of. This will inform pending message boxes about session closure.
        Specified by:
        onDispose in interface IClientSessionDisposeListener
        Parameters:
        clientGyro - The client session gyro.
      • addReplyListener

        public boolean addReplyListener​(IMessageBoxReply listener)
        Adds a listener for the callback when user chooses an action for the message box.
        Parameters:
        listener - The listener.
        Returns:
        true if added, false if already added.
      • removeReplyListener

        public boolean removeReplyListener​(IMessageBoxReply listener)
        Removes a listener for the callback when user chooses an action for the message box.
        Parameters:
        listener - The listener.
        Returns:
        true if removed, false if not previously added.
      • messageBox

        public void messageBox​(IMessageBoxReply reply,
                               IMessageBox.Icon icon,
                               KString title,
                               KString message,
                               KString... buttons)
        Displays a message box with the specified title and message. The icon can be specified as Informational, Question, Error or None. The buttons can be specified along with the default button (when the Enter key is pressed for keyboard/desktop systems).
        Specified by:
        messageBox in interface IMessageBox
        Parameters:
        reply - The reply callback that is called when the user chooses a button or session is closed, null for none.
        icon - Icon to display, see the ICON_* values, e.g. IMessageBox.ICON_INFORMATION.
        title - The title string, must be non-null.
        message - The message to display, must be non-null.
        buttons - The strings for the buttons to display, if none, just an OK button is displayed. This array of buttons defined the index value returned by this method.
        Throws:
        java.lang.NullPointerException - If icon or message is null, or if any of the elements in buttons array is null.
      • getTitle

        public KString getTitle()
        Gets the title of the message box.
        Returns:
        The title, or null for none.
      • getTitlePlainString

        public java.lang.String getTitlePlainString()
        Gets the title of the message box.
        Returns:
        The title plain string converted from HTML, or null for none.
      • getMessage

        public KString getMessage()
        Gets the message text of the message box.
        Returns:
        The message text, or null for none.
      • getMessagePlainString

        public java.lang.String getMessagePlainString()
        Gets the message text of the message box.
        Returns:
        The message text plain string converted from HTML, or null for none.
      • show

        public void show()
        Called to display the message box on the client.
      • cancel

        public void cancel()
        Called to remove the message box without further processing for user or notifications.