@Override public void addAttribute(String name, Component value) throws PaintException { final String id = value.getConnectorId(); addAttribute(name, id); }
@Override public PaintStatus startPaintable(Component connector, String tagName) throws PaintException { boolean topLevelPaintable = openPaintables.isEmpty(); if (getLogger().isLoggable(Level.FINE)) { getLogger().log(Level.FINE, "startPaintable for {0}@{1}", new Object[] { connector.getClass().getName(), Integer.toHexString(connector.hashCode()) }); } startTag(tagName, true); openPaintables.push(connector); openPaintableTags.push(tagName); addAttribute("id", connector.getConnectorId()); // Only paint top level paintables. All sub paintables are marked as // queued and painted separately later. if (!topLevelPaintable) { return PaintStatus.CACHED; } if (connector instanceof CustomLayout) { customLayoutArgumentsOpen = true; } return PaintStatus.PAINTING; }
/** * Adds a upload stream type variable. * * TODO not converted for JSON * * @param owner * the Listener for variable changes. * @param name * the Variable name. * * @throws PaintException * if the paint operation failed. */ @Override public void addUploadStreamVariable(VariableOwner owner, String name) throws PaintException { startTag("uploadstream"); addAttribute(UIDL_ARG_NAME, name); endTag("uploadstream"); }
@Override public void addAttribute(String name, Resource value) throws PaintException { if (value == null) { throw new NullPointerException(); } ClientConnector ownerConnector = openPaintables.peek(); ownerConnector.getUI().getSession().getGlobalResourceHandler(true) .register(value, ownerConnector); ResourceReference reference = ResourceReference.create(value, ownerConnector, name); addAttribute(name, reference.getURL()); }
public void printJSONResponse(Writer outWriter) throws IOException { if (isDirty()) { outWriter.write(", \"dd\":"); JsonPaintTarget jsonPaintTarget = new JsonPaintTarget( session.getCommunicationManager(), outWriter, false); jsonPaintTarget.startTag("dd"); jsonPaintTarget.addAttribute("visitId", lastVisitId); if (acceptCriterion != null) { jsonPaintTarget.addAttribute("accepted", lastVisitAccepted); acceptCriterion.paintResponse(jsonPaintTarget); } jsonPaintTarget.endTag("dd"); jsonPaintTarget.close(); lastVisitId = -1; lastVisitAccepted = false; acceptCriterion = null; dragEvent = null; } }
addAttribute("xmlns", namespace);