@Override public void addAttribute(String name, Component value) throws PaintException { final String id = value.getConnectorId(); addAttribute(name, id); }
@Override public JsonValue encode(Component value) { return value != null ? Json.create(value.getConnectorId()) : null; }
@Override public void addVariable(VariableOwner owner, String name, Component value) throws PaintException { tag.addVariable( new StringVariable(owner, name, value.getConnectorId())); }
@Override public void endPaintable(Component paintable) throws PaintException { if (getLogger().isLoggable(Level.FINE)) { getLogger().log(Level.FINE, "endPaintable for {0}@{1}", new Object[] { paintable.getClass().getName(), Integer.toHexString(paintable.hashCode()) }); } ClientConnector openPaintable = openPaintables.peek(); if (paintable != openPaintable) { throw new PaintException("Invalid UIDL: closing wrong paintable: '" + paintable.getConnectorId() + "' expected: '" + openPaintable.getConnectorId() + "'."); } // remove paintable from the stack openPaintables.pop(); String openTag = openPaintableTags.pop(); endTag(openTag); }
@Override public void generateData(T item, JsonObject jsonObject) { if (generator == null || !visibleDetails.contains(item)) { return; } if (!components.containsKey(item)) { Component detailsComponent = generator.apply(item); Objects.requireNonNull(detailsComponent, "Details generator can't create null components"); if (detailsComponent.getParent() != null) { throw new IllegalStateException( "Details component was already attached"); } addComponentToGrid(detailsComponent); components.put(item, detailsComponent); } jsonObject.put(GridState.JSONKEY_DETAILS_VISIBLE, components.get(item).getConnectorId()); }
@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; }
@Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); // This could be in internalRemoveComponent and internalSetComponent if // Map<Connector,String> was supported. We cannot get the child // connectorId unless the component is attached to the application so // the String->String map cannot be populated in internal* either. Map<String, String> connectorToPosition = new HashMap<>(); for (Iterator<Component> ci = getComponentIterator(); ci.hasNext();) { Component c = ci.next(); connectorToPosition.put(c.getConnectorId(), getPosition(c).getCSSString()); } getState().connectorToCssPosition = connectorToPosition; }
String paintableId = component.getConnectorId();
+ "@" + Integer.toHexString(c.hashCode())); target.startTag("change"); final String pid = c.getConnectorId(); target.addAttribute("pid", pid); LegacyPaint.paint(c, target);
target.addAttribute( DragAndDropWrapperConstants.DRAG_START_COMPONENT_ATTRIBUTE, dragImageComponent.getConnectorId()); } else { throw new IllegalArgumentException(
columnFields.put(c, component); getState().columnFields.put(getInternalIdForColumn(c), component.getConnectorId()); });
@Override public void generateData(Object itemId, Item item, JsonObject rowData) { // DetailComponentManager should not send anything if details // generator is the default null version. if (openDetails.contains(itemId) && !detailsGenerator.equals(DetailsGenerator.NULL)) { // Double check to be sure details component exists. createDetails(itemId); Component detailsComponent = itemIdToDetailsComponent .get(itemId); rowData.put(GridState.JSONKEY_DETAILS_VISIBLE, (detailsComponent != null ? detailsComponent.getConnectorId() : "")); } }
/** * Opens the menu for the given component.<p> * * @param component the component */ public void open(Component component) { getRpcProxy(I_CmsContextMenuClientRpc.class).showContextMenuRelativeTo(component.getConnectorId()); }
target.addAttribute( DragAndDropWrapperConstants.DRAG_START_COMPONENT_ATTRIBUTE, dragImageComponent.getConnectorId()); } else { throw new IllegalArgumentException(
if(c != null && fieldName != null && !fieldName.isEmpty()) Preconditions.checkArgument(c.isAttached(), "Component " + c.getConnectorId() + " must be attached before it can get an automatic ID."); id = c.getId(); if(id == null)