本文整理汇总了Java中javax.faces.component.UIMessage类的典型用法代码示例。如果您正苦于以下问题:Java UIMessage类的具体用法?Java UIMessage怎么用?Java UIMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIMessage类属于javax.faces.component包,在下文中一共展示了UIMessage类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scan
import javax.faces.component.UIMessage; //导入依赖的package包/类
/**
* Walk the component tree branch built by the composite component and locate the input container elements.
*
* @return a composite object of the input container elements
*/
protected InputContainerElements scan(final UIComponent component, InputContainerElements elements,
final FacesContext context) {
if (elements == null) {
elements = new InputContainerElements();
}
// NOTE we need to walk the tree ignoring rendered attribute because it's condition
// could be based on what we discover
if ((elements.getLabel() == null) && (component instanceof HtmlOutputLabel)) {
elements.setLabel((HtmlOutputLabel) component);
} else if (component instanceof EditableValueHolder) {
elements.registerInput((EditableValueHolder) component, getDefaultValidator(context), context);
} else if (component instanceof UIMessage) {
elements.registerMessage((UIMessage) component);
}
// may need to walk smarter to ensure "element of least suprise"
for (UIComponent child : component.getChildren()) {
scan(child, elements, context);
}
return elements;
}
示例2: encodeEnd
import javax.faces.component.UIMessage; //导入依赖的package包/类
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
// Note our complete disregard for class cast and null exceptions....
UIMessage uiMessage = (UIMessage)component;
String clientId = uiMessage.findComponent(uiMessage.getFor()).getClientId(context);
Iterator iter = context.getMessages(clientId);
if (iter.hasNext()) {
// Just do the first one.
FacesMessage message = (FacesMessage)iter.next();
renderMessage(context, component, message);
}
}
示例3: message
import javax.faces.component.UIMessage; //导入依赖的package包/类
/**
* Build a faces message.
*
* @param label
* the label to display.
* @param uiMessage
* the ui message on which displaying message.
*/
public void message(final UIMessage uiMessage, final IMessageLabel label) {
final String msg = this.messageBundle.getMessage(label);
final FacesMessage.Severity severity = getFacesSeverity(label
.getSeverity());
if (!getFacesContext().isValidationFailed()
&& (isSeverityError(severity) || isSeverityFatal(severity))) {
getFacesContext().validationFailed();
}
message(uiMessage, severity, msg);
}
示例4: getMessages
import javax.faces.component.UIMessage; //导入依赖的package包/类
public List<UIMessage> getMessages() {
return messages;
}
示例5: registerMessage
import javax.faces.component.UIMessage; //导入依赖的package包/类
public void registerMessage(final UIMessage message) {
messages.add(message);
}
示例6: getUIMessageShowDetailSkip
import javax.faces.component.UIMessage; //导入依赖的package包/类
/**
* used with {@link BooleanPropertyDefaultTest#getPrimitiveDefaultSkips(FacesSharableRegistry)}
* @return
*/
public static Object[] getUIMessageShowDetailSkip() {
return new Object[]{"showDetail", UIMessage.class, true};
}
示例7: info
import javax.faces.component.UIMessage; //导入依赖的package包/类
/**
* Build an info faces message.
*
* @param uiMessage
* the ui message on which displaying message.
* @param message
* the message to display.
*/
private void info(final UIMessage uiMessage, final String message) {
message(uiMessage, FacesMessage.SEVERITY_INFO, message);
}
示例8: warn
import javax.faces.component.UIMessage; //导入依赖的package包/类
/**
* Build a warn faces message.
*
* @param uiMessage
* the ui message on which displaying message.
* @param message
* the message to display.
*/
private void warn(final UIMessage uiMessage, final String message) {
message(uiMessage, FacesMessage.SEVERITY_WARN, message);
}
示例9: error
import javax.faces.component.UIMessage; //导入依赖的package包/类
/**
* Build an error faces message.
*
* @param uiMessage
* the ui message on which displaying message.
* @param message
* the message to display.
*/
private void error(final UIMessage uiMessage, final String message) {
message(uiMessage, FacesMessage.SEVERITY_ERROR, message);
}