Class PlaceChangeRequestEvent

    • Constructor Detail

      • PlaceChangeRequestEvent

        public PlaceChangeRequestEvent​(Place newPlace)
        Constructs a PlaceChangeRequestEvent for the given Place.
        Parameters:
        newPlace - a Place instance
    • Method Detail

      • getNewPlace

        public Place getNewPlace()
        Returns the place we may navigate to, or null on window close.
        Returns:
        a Place instance
      • getWarning

        public java.lang.String getWarning()
        Returns the warning message to show the user before allowing the place change, or null if none has been set.
        Returns:
        the warning message as a String
        See Also:
        setWarning(String)
      • setWarning

        public void setWarning​(java.lang.String warning)
        Set a message to warn the user that it might be unwise to navigate away from the current place, e.g. due to unsaved changes. If the user clicks okay to that message, navigation will be canceled.

        Calling with a null warning is the same as not calling the method at all -- the user will not be prompted.

        Only the first non-null call to setWarning has any effect. That is, once the warning message has been set it cannot be cleared.

        Parameters:
        warning - the warning message as a String
        See Also:
        getWarning()