javaee.module.webapp.utilities.FacesMessageUtility Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-javaee-module Show documentation
Show all versions of common-javaee-module Show documentation
This Module contains common JavaEE Helper Classes.
The newest version!
package javaee.module.webapp.utilities;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
public abstract class FacesMessageUtility {
public static void createInfoMessage( String summary ) {
FacesContext.getCurrentInstance( ).addMessage( null, new FacesMessage( FacesMessage.SEVERITY_INFO, summary, null ) );
}
public static void createWarnMessage( String summary ) {
FacesContext.getCurrentInstance( ).addMessage( null, new FacesMessage( FacesMessage.SEVERITY_WARN, summary, null ) );
}
public static void createErrorMessage( String summary ) {
FacesContext.getCurrentInstance( ).addMessage( null, new FacesMessage( FacesMessage.SEVERITY_ERROR, summary, null ) );
}
public static void createFatalMessage( String summary ) {
FacesContext.getCurrentInstance( ).addMessage( null, new FacesMessage( FacesMessage.SEVERITY_FATAL, summary, null ) );
}
public static void createInfoMessage( String summary, String detail ) {
FacesContext.getCurrentInstance( ).addMessage( null, new FacesMessage( FacesMessage.SEVERITY_INFO, summary, detail ) );
}
public static void createWarnMessage( String summary, String detail ) {
FacesContext.getCurrentInstance( ).addMessage( null, new FacesMessage( FacesMessage.SEVERITY_WARN, summary, detail ) );
}
public static void createErrorMessage( String summary, String detail ) {
FacesContext.getCurrentInstance( ).addMessage( null, new FacesMessage( FacesMessage.SEVERITY_ERROR, summary, detail ) );
}
public static void createFatalMessage( String summary, String detail ) {
FacesContext.getCurrentInstance( ).addMessage( null, new FacesMessage( FacesMessage.SEVERITY_FATAL, summary, detail ) );
}
public static void createInfoMessage( String componentId, String summary, String detail ) {
FacesContext.getCurrentInstance( ).addMessage( componentId, new FacesMessage( FacesMessage.SEVERITY_INFO, summary, detail ) );
}
public static void createWarnMessage( String componentId, String summary, String detail ) {
FacesContext.getCurrentInstance( ).addMessage( componentId, new FacesMessage( FacesMessage.SEVERITY_WARN, summary, detail ) );
}
public static void createErrorMessage( String componentId, String summary, String detail ) {
FacesContext.getCurrentInstance( ).addMessage( componentId, new FacesMessage( FacesMessage.SEVERITY_ERROR, summary, detail ) );
}
public static void createFatalMessage( String componentId, String summary, String detail ) {
FacesContext.getCurrentInstance( ).addMessage( componentId, new FacesMessage( FacesMessage.SEVERITY_FATAL, summary, detail ) );
}
}