/** * @see UIJointContainer#UIJointContainer(UIContainer, String, String) * @param localID The localID, used to distinguish repeated replicates of this * joint which occur in the same scope (in just the same way as plain branches) */ public UIJointContainer(UIContainer parent, String ID, String jointID, String localID) { this.ID = ID; this.jointID = jointID; this.localID = localID; parent.addComponent(this); }
/** * Create a new UIJointContainer and add it to the component tree. * * @param parent The container to receive this newly created joint container. * @param ID The "client ID" or "source ID" of this container, that is, the * rsf:id under which the host template and producer refer to the * component. * @param jointID The "joint ID" or "target ID" of this container, that is, * the rsf:id under which the implementing or component template * refer to the component. */ public UIJointContainer(UIContainer parent, String ID, String jointID) { this.ID = ID; this.jointID = jointID; parent.addComponent(this); }
public static UIBasicListMember makeBasic(UIContainer tofill, String ID, String parentFullID, int choiceindex) { UIBasicListMember togo = new UIBasicListMember(); togo.ID = ID; togo.parentFullID = parentFullID; togo.choiceindex = choiceindex; togo.willinput = true; tofill.addComponent(togo); return togo; } }
public static UISelectChoice make(UIContainer tofill, String ID, String parentFullID, int choiceindex) { UISelectChoice togo = new UISelectChoice(); togo.ID = ID; togo.parentFullID = parentFullID; togo.choiceindex = choiceindex; togo.willinput = true; tofill.addComponent(togo); return togo; } }
public static UISelectLabel make(UIContainer tofill, String ID, String parentFullID, int choiceindex) { UISelectLabel togo = new UISelectLabel(); togo.ID = ID; togo.parentFullID = parentFullID; togo.choiceindex = choiceindex; tofill.addComponent(togo); return togo; } }
/** 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
/** Construct a new UIVerbatim control, rendering raw unescaped markup to the client * * @param parent The parent container to which the new control is to be attached. * @param ID The (RSF) ID of this control * @param markup An Object holding the raw markup to be rendered. Either a String, * UIBoundString, InputStream (assumed UTF-8) or Reader, else toString() * will be called to get character data. May also be an ELReference * from which one of the previously mentioned types can be read. */ public static UIVerbatim make(UIContainer parent, String ID, Object markup) { UIVerbatim togo = new UIVerbatim(); togo.ID = ID; togo.markup = markup; parent.addComponent(togo); return togo; }
/** Creates an "action" form that will receive an RSF submission */ public static UIForm make(UIContainer parent, String ID) { if (!(parent instanceof UIBranchContainer)) { throw UniversalRuntimeException.accumulate(new IllegalArgumentException("Immediate parent of UIForm must be a branch container")); } UIForm togo = new UIForm(); togo.ID = ID; togo.noID = true; parent.addComponent(togo); return togo; }
/** A "skeleton" make method to prepare for more complex constructions */ public static UISelect make(UIContainer tofill, String ID) { UISelect togo = new UISelect(); togo.ID = ID; tofill.addComponent(togo); RSFUtil.updateChildIDs(togo); return togo; }
/** * @param parent The parent container to which this link is to be added * @param ID The (RSF) ID to be given to this linke * @param linktext The text which is to be attached to this link (if left <code>null</code>, * the tag peering with this component may contain further markup in the template) * @param viewparams The {@link ViewParameters} specifying the target view for this link. * @return The constructed internal link */ public static UIInternalLink make(UIContainer parent, String ID, UIBoundString linktext, ViewParameters viewparams) { UIInternalLink togo = new UIInternalLink(); togo.ID = ID; togo.linktext = linktext; togo.viewparams = viewparams.copyBase(); parent.addComponent(togo); return togo; }
protected static UISelect make(UIContainer tofill, String ID, String[] options) { UISelect togo = new UISelect(); togo.ID = ID; togo.optionlist = togo.optionnames = UIOutputMany.make(options); tofill.addComponent(togo); RSFUtil.updateChildIDs(togo); return togo; }
public static UIAnchor make(UIContainer parent, String ID, String initvalue, String binding) { UIAnchor togo = new UIAnchor(); if (initvalue != null) { togo.setValue(initvalue); } togo.valuebinding = ELReference.make(binding); togo.ID = ID; parent.addComponent(togo); return togo; }
public static UIOutputMultiline make(UIContainer parent, String ID, String binding, StringList value) { UIOutputMultiline togo = new UIOutputMultiline(); togo.ID = ID; togo.valuebinding = ELReference.make(binding); // note that StringList is not a UIType, and hence can never give rise // to input, and hence has no placeholder type, and hence must always // be set here. if (value != null) { togo.setValue(value); } parent.addComponent(togo); return togo; }
/** * Construct a navigation link with a bound control (e.g. UIMessage) forming * the link text. */ public static UILink make(UIContainer parent, String ID, UIBoundString linktext, String target) { UILink togo = new UILink(); togo.ID = ID; togo.target = new UIOutput(); if (target != null) { togo.target.setValue(target); } togo.linktext = linktext; parent.addComponent(togo); return togo; }
/** A full constructor, specifying a bound String array with an optional * initial value. Note that there is no direct renderer for such a component * in HTML. */ public static UIInputMany make(UIContainer parent, String ID, String binding, String[] initvalue) { UIInputMany togo = new UIInputMany(); togo.valuebinding = ELReference.make(binding); if (initvalue != null) { togo.setValue(initvalue); } togo.ID = ID; parent.addComponent(togo); return togo; }
/** * Constructs a text field which is bound to a particular path in the bean * model. If the initial value is set to <code>null</code> (recommended), it * will be fetched automatically from the bean model during fixup. */ public static UIOutput make(UIContainer parent, String ID, String initvalue, String binding) { UIOutput togo = new UIOutput(); if (initvalue != null) { togo.setValue(initvalue); } togo.valuebinding = ELReference.make(binding); togo.ID = ID; parent.addComponent(togo); return togo; }
/** Create a link which, while internal, does not participate in the * ViewParameters system. This is largely useful for unmanaged environments * such as SpringMVC/Cocoon. Cannot be named "make" to avoid clashing with * UILink through ridiculous Java semantics on static methods. */ public static UIInternalLink makeURL(UIContainer parent, String ID, String target) { UIInternalLink togo = new UIInternalLink(); togo.ID = ID; togo.target = new UIOutput(); if (target != null) { togo.target.setValue(target); } parent.addComponent(togo); return togo; } /** ViewParameters representing the navigation target of this link control */
private void cloneChildren(UIContainer target, UIContainer source, RemapState state) { ComponentList children = source.flattenChildren(); for (int i = 0; i < children.size(); ++i) { UIComponent child = (UIComponent) children.get(i); if (child instanceof UIReplicator) { expandReplicator(target, (UIReplicator) child, state); } else { UIComponent cloned = cloneComponent(child, state); target.addComponent(cloned); } } }
/** Creates a selection control without a value binding, either * non-submitting, or suitable for use in a GET form */ public static UISelect make(UIContainer tofill, String ID, String[] values, String[] labels, String value, boolean willinput) { UISelect togo = new UISelect(); togo.optionlist = new UIOutputMany(); togo.ID = ID; togo.optionlist.setValue(values); togo.optionnames = new UIBoundList(); togo.optionnames.setValue(labels); togo.selection = new UIBoundString(); if (value != null) { ((UIBoundString) togo.selection).setValue(value); } togo.selection.willinput = willinput; tofill.addComponent(togo); RSFUtil.updateChildIDs(togo); return togo; }