public MessageFlyweight(UIContainer parent) { rsfMessages = UIBranchContainer.make(parent, RSF_MESSAGES); errorMessages = UIBranchContainer.make(rsfMessages, "error-messages:"); infoMessages = UIBranchContainer.make(rsfMessages, "info-messages:"); confirmMessages = UIBranchContainer.make(rsfMessages, "confirm-messages:"); }
public void detachAll() { rsfMessages.updateFullID(null); rsfMessages.remove(errorMessages); rsfMessages.remove(infoMessages); rsfMessages.remove(confirmMessages); errorMessages.updateFullID(null); infoMessages.updateFullID(null); confirmMessages.updateFullID(null); } }
/** * Constructs a "repeating" BranchContainer, uniquely identified by the * "localID" passed as the 3rd argument. Suitable, for example, for creating a * table row. * * @param parent The parent container to which the returned branch should be * added. * @param ID The RSF ID for the branch (must contain a colon character) * @param localID The local ID identifying this branch instance (must be * unique for each branch with the same ID in this branch) */ public static UIBranchContainer make(UIContainer parent, String ID, String localID) { if (ID.indexOf(':') == -1) { throw new IllegalArgumentException( "Branch container ID must contain a colon character :"); } UIBranchContainer togo = new UIBranchContainer(); togo.ID = ID; togo.localID = localID; parent.addComponent(togo); return togo; }
public void renderMessages(MessageFlyweight flyweight, UIBranchContainer member, List messagelist) { if (messagelist == null || messagelist.size() == 0) return; flyweight.rsfMessages.addComponent(member); for (int i = 0; i < messagelist.size(); ++i) { TargettedMessage message = (TargettedMessage) messagelist.get(i); String resolved = message.resolve(messagelocator); if (resolved == null) { resolved = MessageUtil.renderDefaultMessage(message.messagecodes[0]); } UIOutput.make(member, "message:", resolved); } } }
/** * Constructs a simple BranchContainer, used to group components or to cause a * rendering switch. Suitable where there will be just one branch with this ID * within its container. Where BranchContainers are created in a loop, they will * have the <code>localID</code> automatically assigned in an integer sequence. * * @see #make(UIContainer, String, String) */ public static UIBranchContainer make(UIContainer parent, String ID) { return make(parent, ID, ""); }
UIBranchContainer core = UIBranchContainer.make(togo, CORE_ID); int limit = Math.max(minlength, value.length); for (int i = 0; i < limit; ++i) { UIBranchContainer row = UIBranchContainer.make(core, "dynamic-list-input-row:", Integer.toString(i)); UIBasicListMember.makeBasic(row, "input", toevolve.getFullID(), i);
UIBranchContainer core = UIBranchContainer.make(togo, CORE_ID); int limit = Math.max(minlength, value.length); for (int i = 0; i < limit; ++i) { UIBranchContainer row = UIBranchContainer.make(core, "dynamic-list-input-row:", Integer.toString(i)); UIBasicListMember.makeBasic(row, "input", toevolve.getFullID(), i);
UIBranchContainer replicated = UIBranchContainer.make(target, replicator.component.ID, localid); expandtarget = replicated;