Package com.jalios.jcms.context
Class JcmsToastr
- java.lang.Object
-
- com.jalios.jcms.context.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 extendingJcmsContext
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 Summary
Constructors Constructor Description JcmsToastr(MessageLevel level, java.lang.String message, java.util.Map<java.lang.String,java.lang.String> optionMap)
Create a newJcmsToastr
with the specifiedJcmsMessage.Level
, message, url and optionMapJcmsToastr(java.lang.String message)
Create a new JcmsToastr with the specified message
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
MessageLevel
getLevel()
java.lang.String
getMessage()
java.util.Map<java.lang.String,? extends java.lang.Object>
getOptionMap()
int
hashCode()
JcmsToastr
setLevel(MessageLevel level)
JcmsToastr
setMessage(java.lang.String message)
JcmsToastr
setOptionMap(java.util.Map<java.lang.String,? extends java.lang.Object> optionMap)
-
-
-
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 newJcmsToastr
with the specifiedJcmsMessage.Level
, message, url and optionMap- Parameters:
level
-MessageLevel
of the messagemessage
- The messageoptionMap
-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
-
getLevel
public MessageLevel getLevel()
-
setLevel
public JcmsToastr setLevel(MessageLevel level)
-
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 classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-