本文整理匯總了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));
}