Class JcmsToastr


  • public class JcmsToastr
    extends java.lang.Object
    Wrapper class for toastr(s) to be displayed to the user in the GUI. Example, when used inside any Java Bean or FormHandler extending JcmsContext or any of its subclass ( JcmsJspContext, JcmsFormHandler...) :
     addMsg( new JcmsToastr("jcmsplugin.myplugin.msg") );
     
    Example when used in any other class :
     JcmsContext.addToastr(request, new JcmsToastr(JcmsUtil.glp(userLang, "jcmsplugin.myplugin.msg")) );
     
    Since:
    jcms-10.0.0
    • Constructor Detail

      • JcmsToastr

        public JcmsToastr​(java.lang.String message)
        Create a new JcmsToastr with the specified message
        Parameters:
        message - the message, must already be I18Ned
      • JcmsToastr

        public JcmsToastr​(MessageLevel level,
                          java.lang.String message,
                          java.util.Map<java.lang.String,​java.lang.String> optionMap)
        Create a new JcmsToastr with the specified JcmsMessage.Level, message, url and optionMap
        Parameters:
        level - MessageLevel of the message
        message - The message
        optionMap - Map of options :
                  "closeButton": "false",
                  "debug": "false",
                  "newestOnTop": "false",
                  "progressBar": "false",
                  "positionClass": "toast-top-right",
                  (toast-bottom-right, toast-bottom-left, toast-top-left, toast-top-full-width,
                  toast-bottom-full-width, toast-top-center, toast-bottom-center)
                  "preventDuplicates": "false",
                  "url": "www.google.fr", 
                  "showDuration": "300",
                  "hideDuration": "1000",
                  "timeOut": "5000",
                  "extendedTimeOut": "1000",
                  "showEasing": "swing",
                  "hideEasing": "linear",
                  "showMethod": "fadeIn",
                  "hideMethod": "fadeOut"
                  
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
      • setMessage

        public JcmsToastr setMessage​(java.lang.String message)
      • getOptionMap

        public java.util.Map<java.lang.String,​? extends java.lang.Object> getOptionMap()
      • setOptionMap

        public JcmsToastr setOptionMap​(java.util.Map<java.lang.String,​? extends java.lang.Object> optionMap)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object