/** Construct a "clustered" message component, suitable for being the label * of a UILink or UICommand, etc. */ public static UIMessage make(String messagekey) { return make(messagekey, null); }
/** Construct a "standalone" message component suitable for appearing as * a top-level label component in the component tree. */ public static UIMessage make(UIContainer parent, String ID, String messagekey) { return make(parent, ID, messagekey, null); } /** Constructs a message component suitable for appearing as a top-level
/** Constructs a top-level message component, supporting defaultible * message fallback as in the Spring * <a href="http://www.springframework.org/docs/api/org/springframework/context/MessageSourceResolvable.html"> * MessageSourceResolvable</a> interface. * See {@link #make(UIContainer, String, String, Object[])} */ public static UIMessage make(UIContainer parent, String ID, String messagekeys[], Object[] arguments) { UIMessage togo = make(messagekeys, arguments); togo.ID = ID; parent.addComponent(togo); return togo; }
/** Constructs a message component suitable for appearing as a top-level * label component in the component tree, making use of more complex * formatting. The arguments array is supplied as if to a standard * Java * <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html">MessageFormat</a>. */ public static UIMessage make(UIContainer parent, String ID, String messagekey, Object[] arguments) { UIMessage togo = make(messagekey, arguments); togo.ID = ID; parent.addComponent(togo); return togo; } /** Constructs a top-level message component, supporting defaultible
/** Render a template message into an "ad hoc" UIMessage component * */ public UIMessage renderMessage(UIContainer basecontainer, String id, String key) { // attach to base container so that full ID can be computed by default algorithm - // RSF-71 String addId = id == null? "" : id; UIComponent existing = basecontainer.getComponent(addId); if (existing != null) { basecontainer.remove(existing); } UIMessage togo = UIMessage.make(basecontainer, addId, key); String message = messagelocator.getMessage(togo.messagekeys, togo.arguments); if (message == null) { message = MessageUtil.renderDefaultMessage(key); } togo.setValue(message); return togo; }