/** Sets the option labels for this selection control to be interpreted * as message keys, rather than as raw Strings. */ public UISelect setMessageKeys() { optionnames.resolver = new ELReference("#{messageLocator}"); return this; }
public UIDeletionBinding(String deletebinding, Object deletetarget, String encoding) { this.deletebinding = ELReference.make(deletebinding); this.deletetarget = deletetarget; this.encoding = encoding; }
/** Determine that this is a selection control of entity ids, as managed via an * EntityNameInferrer (perhaps through an EntityBeanLocator) and should, * on submission, have the effect of assigning the entire managed entities * rather than the selected id itself. */ public UISelect setIDDefunnel() { selection.darreshaper = new ELReference("#{id-defunnel}"); return this; }
public UIDeletionBinding(String deletebinding, Object deletetarget) { this.deletebinding = ELReference.make(deletebinding); this.deletetarget = deletetarget; }
/** Indicate that the "markup" field for this control is to be interpreted * as a message key, to be looked up to a piece of markup in the associated * message bundle. */ public UIVerbatim setMessageKey() { this.resolver = new ELReference("#{messageLocator}"); return this; } }
/** * A "bare" constructor suitable for the selection member of a single * selection control (UIInput); * @param valuebinding An EL reference to which the bound value is to be associated * @return The constructed UIInput control. */ public static UIInput make(String valuebinding) { UIInput togo = new UIInput(); togo.valuebinding = ELReference.make(valuebinding); return togo; }
public Object copy(Object tocopyo) { ELReference tocopy = (ELReference) tocopyo; ELReference togo = new ELReference(); togo.value = tocopy.value; return togo; }
/** * @see #make(String) * @param valuebinding An EL reference to which the bound value is to be associated * @param initvalue An initial value for the control, to take priority over any bound * value during the render cycle. * @return The constructed UIInput control. */ public static UIInput make(String valuebinding, String initvalue) { UIInput togo = new UIInput(); togo.valuebinding = ELReference.make(valuebinding); if (initvalue != null) { togo.setValue(initvalue); } return togo; } }
public static ELReference make(String value) { return value == null? null : new ELReference(value); } }
/** * Creates a command control which accepts a bound string (for example a * UIMessage) as the textual label. * * @see #make(UIContainer, String, String, String) */ public static UICommand make(UIContainer parent, String ID, UIBoundString commandtext, String methodbinding) { UICommand togo = new UICommand(); togo.commandtext = commandtext; togo.ID = ID; togo.methodbinding = ELReference.make(methodbinding); // TODO: do this at fixup // if (parent.getActiveForm() == null) { // throw new UniversalRuntimeException("Component " + parent // + " does not have a form parent"); // } parent.addComponent(togo); return togo; }
/** Create a binding that will assign the Object or EL reference <code>rvalue</code> * to the EL path <code>lvalue</code> in the following request cycle. * @param lvalue the EL reference at which the specified object will be assigned. * @param rvalue Either a literal Object, or an {@link ELReference} from which it * can be read in the following request, which is to be assigned to the lvalue path. * @param virtual <code>true</code> if this is a "virtual binding" - that is one that * will not be automatically applied by the client action, but is for the instruction * of client-side code * @param encoding An encoding form in which the rvalue is to be encoded, either * {@link DataAlterationRequest#JSON_ENCODING} (the default) * or {@link DataAlterationRequest#XML_ENCODING}. */ public UIELBinding(String lvalue, Object rvalue, boolean virtual, String encoding) { valuebinding = new ELReference(lvalue); this.rvalue = rvalue; this.virtual = virtual; this.encoding = encoding; }
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; }
/** A constructor suitable for the value lists appearing in selection controls */ public static UIOutputMany make(String valuebinding, String resolver) { UIOutputMany togo = new UIOutputMany(); togo.valuebinding = new ELReference(valuebinding); togo.resolver = new ELReference(resolver); 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; }
/** * A "bare" constructor suitable for the selection member of a multiple * selection control (UIInput); */ public static UIInputMany make(String valuebinding) { UIInputMany togo = new UIInputMany(); togo.valuebinding = new ELReference(valuebinding); return togo; }
/** * Construct a new UIBoundBoolean component with the specified container as parent. * * @param parent Parent container to which the component is to be added. * @param ID (RSF) ID of this component. * @param binding An EL expression to be used as the value binding for the * contained Boolean value. May be <code>null</code>. * @param initvalue An initial value for the bound value. May be left * <code>null</code>. If neither this field nor * <code>binding</code> is set. the value present in the template * will be used. * @return The constructed UIBoundBoolean component. */ public static UIBoundBoolean make(UIContainer parent, String ID, String binding, Boolean initvalue) { UIBoundBoolean togo = new UIBoundBoolean(); togo.valuebinding = ELReference.make(binding); if (initvalue != null) { togo.setValue(initvalue.booleanValue()); } togo.ID = ID; parent.addComponent(togo); return togo; }
public Object parse(String toparse) { ELReference togo = new ELReference(); togo.value = BeanUtil.stripELNoisy(toparse); 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; }
/** * Adds a binding to the supplied parameter list that will assign the EL * expression <code>source</code> to <code>transit</code> and then * <code>transit</code> to <code>dest</code>, a classic usage of * "whole-object validation through transit". */ public static void addTransitBinding(ParameterList paramlist, String source, String transit, String dest) { paramlist.add(new UIELBinding(transit, new ELReference(source))); paramlist.add(new UIELBinding(dest, new ELReference(transit))); }
/** * 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; }