All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javaee.module.webapp.utilities.FacesMessageUtility Maven / Gradle / Ivy

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 ) );
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy