本文整理汇总了Java中javax.faces.application.FacesMessage.Severity方法的典型用法代码示例。如果您正苦于以下问题:Java FacesMessage.Severity方法的具体用法?Java FacesMessage.Severity怎么用?Java FacesMessage.Severity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.application.FacesMessage
的用法示例。
在下文中一共展示了FacesMessage.Severity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMessageType
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
@Override
protected String getMessageType(
UIComponent component,
FacesBean bean)
{
String messageType = null;
FacesMessage.Severity maxSeverity =
FacesContext.getCurrentInstance().getMaximumSeverity();
// Map FacesMessage severity to levels expected by panelHeaderRenderer
if (maxSeverity == null)
messageType = XhtmlConstants.MESSAGE_TYPE_ERROR;
else if (FacesMessage.SEVERITY_FATAL.equals(maxSeverity))
messageType = XhtmlConstants.MESSAGE_TYPE_ERROR;
else if (FacesMessage.SEVERITY_ERROR.equals(maxSeverity))
messageType = XhtmlConstants.MESSAGE_TYPE_ERROR;
else if (FacesMessage.SEVERITY_WARN.equals(maxSeverity))
messageType = XhtmlConstants.MESSAGE_TYPE_WARNING;
else if (FacesMessage.SEVERITY_INFO.equals(maxSeverity))
messageType = XhtmlConstants.MESSAGE_TYPE_INFO;
return messageType;
}
示例2: _createFacesMessage
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
private static FacesMessage _createFacesMessage(
FacesMessage.Severity severity,
ErrorMessages messageStrings,
Object label
)
{
if (messageStrings instanceof BindingErrorMessages)
{
return new BindingFacesMessage(severity, messageStrings, label);
}
String summary = messageStrings.getMessage();
String detail = messageStrings.getDetailMessage();
return new LabeledFacesMessage(severity, summary, detail, label);
}
示例3: LabeledFacesMessage
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
/**
* Creates a LabeledFacesMessage without a pre-set label.
* @param severity the severity of the message
* @param summary the message summary
* @param detail the message detail
*/
public LabeledFacesMessage(
FacesMessage.Severity severity,
String summary,
String detail)
{
super(severity, summary, detail);
}
示例4: prepareOrganizationBean
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
private OrganizationBean prepareOrganizationBean() {
return organizationBean = new OrganizationBean() {
/**
*
*/
private static final long serialVersionUID = 8837356005032690342L;
@Override
public void addMessage(final String clientId,
final FacesMessage.Severity severity, final String key) {
messageKey = key;
}
};
}
示例5: BusinessException
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
/**
* @param summary exception summary
* @param detail exception detail
* @param severity Faces message severity
*/
public BusinessException(String summary, String detail, FacesMessage.Severity severity) {
super(summary);
this.detail = detail;
this.summary = summary;
this.severity = severity;
}
示例6: addFieldInputMessages
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
public static void addFieldInputMessages(String index, FacesMessage.Severity severity, String message) {
if (index != null && index.length() > 0) {
Iterator<String> it = INPUT_FIELD_COMPONENT_CLIENT_ID_PREFIXES.iterator();
while (it.hasNext()) {
Messages.addMessageId(it.next() + index, severity, message);
}
} else {
Messages.addMessage(severity, message);
}
}
示例7: addLocalizedMessageId
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
public static void addLocalizedMessageId(String id, FacesMessage.Severity severity, String l10nKey, Object... args) {
FacesContext context = FacesContext.getCurrentInstance();
addMessageId(context, id, severity, CommonUtil.getMessage(l10nKey, args, getMessageResourceBundle(context), DEFAULT_FACES_MESSAGE));
}
示例8: addMessage
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
public void addMessage(FacesMessage.Severity severity, String msgKey,
Object... params) {
JSFUtils.addMessage(null, severity, msgKey, params);
}
示例9: addMessage
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
public void addMessage(FacesMessage.Severity severityError, String msgKey) {
JSFUtils.addMessage(null, severityError, msgKey, null);
}
示例10: addLocalizedMessageClientId
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
public static void addLocalizedMessageClientId(String clientId, FacesMessage.Severity severity, String l10nKey, Object... args) {
FacesContext context = FacesContext.getCurrentInstance();
addMessageClientId(context, clientId, severity, CommonUtil.getMessage(l10nKey, args, getMessageResourceBundle(context), DEFAULT_FACES_MESSAGE));
}
示例11: addMessage
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
@Override
public void addMessage(final String clientId,
final FacesMessage.Severity severity, final String key) {
super.addMessage(clientId, severity, key, (Object[]) null);
}
示例12: addMessageClientId
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
private static void addMessageClientId(FacesContext context, String clientId, FacesMessage.Severity severity, String message) {
if (context != null) {
FacesMessage facesMessage = new FacesMessage(severity, message, null);
context.addMessage(clientId, facesMessage);
}
}
示例13: setSeverity
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
@Override
public void setSeverity(FacesMessage.Severity severity)
{
_wrapped.setSeverity(severity);
}
示例14: getMaximumSeverity
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
@Override
public FacesMessage.Severity getMaximumSeverity()
{
return null;
}
示例15: addLocalizedMessage
import javax.faces.application.FacesMessage; //导入方法依赖的package包/类
public static void addLocalizedMessage(FacesMessage.Severity severity, String l10nKey, Object... args) {
FacesContext context = FacesContext.getCurrentInstance();
addMessage(context, severity, CommonUtil.getMessage(l10nKey, args, getMessageResourceBundle(context), DEFAULT_FACES_MESSAGE));
}