Update the expandable row renderer.

@param rowRenderer the table row renderer
@param rowContext the row context
@param expandRenderer the renderer for the expandable row.
548178
private void updateBeanValueForRowRenderer(final WTableRowRenderer rowRenderer,
			final UIContext rowContext,
			final Class<? extends WComponent> expandRenderer) {

		Container expandWrapper = (Container) rowRenderer.
				getExpandedTreeNodeRenderer(expandRenderer);
		if (expandWrapper == null) {
			return;
		}

		// The actual component is wrapped in a renderer wrapper, so we have to fetch it from that
		WComponent expandInstance = expandWrapper.getChildAt(0);

		UIContextHolder.pushContext(rowContext);
		try {
			// Will apply updates to the "bean" returned by the model for this expanded renderer (ie
			// getValueAt(rowIndex, -1))
			WebUtilities.updateBeanValue(expandInstance);
		} finally {
			UIContextHolder.popContext();
		}

	}
1148169
@Override
	protected BundleRenderer createRenderer(FacesContext context) {

		ResourceBundlesHandler rsHandler = getResourceBundlesHandler(context);
		String type = (String) getAttributes().get(JawrConstant.TYPE_ATTR);
		boolean async = Boolean.parseBoolean((String) getAttributes().get(JawrConstant.ASYNC_ATTR));
		boolean defer = Boolean.parseBoolean((String) getAttributes().get(JawrConstant.DEFER_ATTR));
		String crossorigin = (String) getAttributes().get(JawrConstant.CROSSORIGIN_ATTR);
		return RendererFactory.getJsBundleRenderer(rsHandler, type, getUseRandomParamFlag(rsHandler.getConfig()), async,
				defer, crossorigin);
	}
772784
public void updateContainer(IndexedContainer data) {

        m_container.removeAllItems();
        m_container = data;
        setContainerDataSource(m_container);
        setItemIconPropertyId(PROP_ICON);
        setRowHeaderMode(RowHeaderMode.ICON_ONLY);

        setVisibleColumns(PROP_CAPTION, PROP_DESCRIPTION, PROP_OU);
        setColumnWidth(null, 40);
        this.refreshRowCache();

    }
951825
@Override
	public void paint(final RenderContext renderContext) {
		// Set headers
		getResponse().setHeader("Cache-Control", type.getSettings());

		// Add extra no cache headers
		if (!type.isCache()) {
			getResponse().setHeader("Pragma", "no-cache");
			getResponse().setHeader("Expires", "-1");
		}

		super.paint(renderContext);
	}
71664
public void setRowsSpanned(final Table table, final TableAppender appender, final int rowIndex,
                               final int colIndex, final int n) throws IOException {
        if (n <= 1) return;

        final TableCell firstCell = this.getRowSecure(table, appender, rowIndex, false)
                .getOrCreateCell(colIndex);
        if (firstCell.isCovered()) return;

        firstCell.markRowsSpanned(n);
        this.coverCellsBelow(table, appender, rowIndex, colIndex, n);
    }
83147
private void paintRowExpansionElement(final WDataTable table, final XmlStringBuilder xml) {
		xml.appendTagOpen("ui:rowexpansion");

		switch (table.getExpandMode()) {
			case CLIENT:
				xml.appendAttribute("mode", "client");
				break;
			case LAZY:
				xml.appendAttribute("mode", "lazy");
				break;
			case SERVER:
			case DYNAMIC:
				xml.appendAttribute("mode", "dynamic");
				break;
			case NONE:
				break;
			default:
				throw new SystemException("Unknown expand mode: " + table.getExpandMode());
		}

		xml.appendOptionalAttribute("expandAll", table.isExpandAll(), "true");

		xml.appendEnd();
	}
443944
@Override protected void updateRendererExtraValues(EpisodeViewModel content,
      Renderer<EpisodeViewModel> renderer, int position) {
    super.updateRendererExtraValues(content, renderer, position);
    EpisodeRenderer episodeRenderer = (EpisodeRenderer) renderer;
    episodeRenderer.setPosition(position);
  }
653870
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WMultiSelectPair multiSelectPair = (WMultiSelectPair) component;
		XmlStringBuilder xml = renderContext.getWriter();
		boolean readOnly = multiSelectPair.isReadOnly();

		xml.appendTagOpen("ui:multiselectpair");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", multiSelectPair.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			int rows = multiSelectPair.getRows();
			int min = multiSelectPair.getMinSelect();
			int max = multiSelectPair.getMaxSelect();
			xml.appendAttribute("size", rows < 2 ? WMultiSelectPair.DEFAULT_ROWS : rows);
			xml.appendOptionalAttribute("disabled", multiSelectPair.isDisabled(), "true");
			xml.appendOptionalAttribute("required", multiSelectPair.isMandatory(), "true");
			xml.appendOptionalAttribute("shuffle", multiSelectPair.isShuffle(), "true");
			xml.appendOptionalAttribute("fromListName", multiSelectPair.getAvailableListName());
			xml.appendOptionalAttribute("toListName", multiSelectPair.getSelectedListName());
			xml.appendOptionalAttribute("accessibleText", multiSelectPair.getAccessibleText());
			xml.appendOptionalAttribute("min", min > 0, min);
			xml.appendOptionalAttribute("max", max > 0, max);
		}
		xml.appendClose();

		// Options
		List<?> options = multiSelectPair.getOptions();
		boolean renderSelectionsOnly = readOnly;

		if (options != null) {
			if (multiSelectPair.isShuffle()) {
				// We need to render the selected options in order
				renderOrderedOptions(multiSelectPair, options, 0, xml, renderSelectionsOnly);
			} else {
				renderUnorderedOptions(multiSelectPair, options, 0, xml, renderSelectionsOnly);
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(multiSelectPair, renderContext);
		}
		xml.appendEndTag("ui:multiselectpair");
	}
1328838
@Override
	public void paint(final RenderContext renderContext) {
		boolean enabled = ConfigurationProperties.getWhitespaceFilter();

		if (enabled && renderContext instanceof WebXmlRenderContext) {
			PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter();
			writer = new WhiteSpaceFilterPrintWriter(writer);

			WebXmlRenderContext filteredContext = new WebXmlRenderContext(writer, UIContextHolder.
					getCurrent().getLocale());
			super.paint(filteredContext);
		} else {
			super.paint(renderContext);
		}
	}
538180
public void addRow(Component component) {

        Component actualComponent = component == null ? m_newComponentFactory.get() : component;
        I_CmsEditableGroupRow row = m_rowBuilder.buildRow(this, actualComponent);
        m_container.addComponent(row);
        updatePlaceholder();
        updateButtonBars();
        updateGroupValidation();
    }
1305391
private void updateBeanValueForRenderedRows() {
		WTableRowRenderer rowRenderer = (WTableRowRenderer) repeater.getRepeatedComponent();
		TableModel model = getTableModel();

		int index = 0;

		List<RowIdWrapper> wrappers = repeater.getBeanList();

		int columnCount = getColumnCount();

		for (RowIdWrapper wrapper : wrappers) {
			UIContext rowContext = repeater.getRowContext(wrapper, index++);
			List<Integer> rowIndex = wrapper.getRowIndex();

			Class<? extends WComponent> expandRenderer = model.getRendererClass(rowIndex);
			if (expandRenderer == null) {
				// Process Columns
				for (int col = 0; col < columnCount; col++) {
					// Check if this cell is editable
					if (model.isCellEditable(rowIndex, col)) {
						updateBeanValueForColumnInRow(rowRenderer, rowContext, rowIndex, col, model);
					}
				}
			} else if (model.isCellEditable(rowIndex, -1)) {
				// Check if this expanded row is editable
				updateBeanValueForRowRenderer(rowRenderer, rowContext, expandRenderer);
			}

		}
	}
1119597
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WStyledText text = (WStyledText) component;
		XmlStringBuilder xml = renderContext.getWriter();
		String textString = text.getText();

		if (textString != null && textString.length() > 0) {
			xml.appendTagOpen("ui:text");

			xml.appendOptionalAttribute("class", component.getHtmlClass());
			switch (text.getType()) {
				case EMPHASISED:
					xml.appendAttribute("type", "emphasised");
					break;

				case HIGH_PRIORITY:
					xml.appendAttribute("type", "highPriority");
					break;

				case LOW_PRIORITY:
					xml.appendAttribute("type", "lowPriority");
					break;

				case MEDIUM_PRIORITY:
					xml.appendAttribute("type", "mediumPriority");
					break;

				case ACTIVE_INDICATOR:
					xml.appendAttribute("type", "activeIndicator");
					break;

				case MATCH_INDICATOR:
					xml.appendAttribute("type", "matchIndicator");
					break;

				case INSERT:
					xml.appendAttribute("type", "insert");
					break;

				case DELETE:
					xml.appendAttribute("type", "delete");
					break;

				case MANDATORY_INDICATOR:
					xml.appendAttribute("type", "mandatoryIndicator");
					break;

				case PLAIN:
				default:
					xml.appendAttribute("type", "plain");
					break;
			}

			switch (text.getWhitespaceMode()) {
				case PARAGRAPHS:
					xml.appendAttribute("space", "paragraphs");
					break;

				case PRESERVE:
					xml.appendAttribute("space", "preserve");
					break;

				case DEFAULT:
					break;

				default:
					throw new IllegalArgumentException("Unknown white space mode: " + text.
							getWhitespaceMode());
			}

			xml.appendClose();

			if (WStyledText.WhitespaceMode.PARAGRAPHS.equals(text.getWhitespaceMode())) {
				textString = text.isEncodeText() ? WebUtilities.encode(textString) : HtmlToXMLUtil.unescapeToXML(textString);
				writeParagraphs(textString, xml);
			} else {
				xml.append(textString, text.isEncodeText());
			}

			xml.appendEndTag("ui:text");
		}
	}
967514
function(item, tableRow) {
			mExplorer.SelectionRenderer.prototype.renderRow.call(this, item, tableRow);
			if (item.type !== "file") { //$NON-NLS-0$
				tableRow.classList.add("searchDetailRow"); //$NON-NLS-0$
			}
		}
425836
public function addRenderer(SwatCellRenderer $renderer)
    {
        $this->renderers->addRenderer($renderer);
        $renderer->parent = $this;
    }
721508
private void setRowIndexRowStatePreserved(int rowIndex) {
        if (rowIndex < -1) {
            throw new IllegalArgumentException("rowIndex is less than -1");
        }

        if (getRowIndex() == rowIndex) {
            return;
        }

        FacesContext facesContext = getFacesContext();

        if (_initialDescendantFullComponentState != null) {
            //Just save the row
            Map<String, Object> sm = saveFullDescendantComponentStates(facesContext, null, getChildren().iterator(), false);
            if (sm != null && !sm.isEmpty()) {
                _rowDeltaStates.put(getContainerClientId(facesContext), sm);
            }

            if (getRowIndex() != -1) {
                _rowTransientStates.put(getContainerClientId(facesContext),
                               saveTransientDescendantComponentStates(facesContext, null, getChildren().iterator(), false));
            }
        }

        // Update to the new row index
        //this.rowIndex = rowIndex;
        getStateHelper().put(PropertyKeys.rowIndex, rowIndex);
        DataModel localModel = getDataModel();
        localModel.setRowIndex(rowIndex);

        // if rowIndex is -1, clear the cache
        if (rowIndex == -1) {
            setDataModel(null);
        }

        // Clear or expose the current row data as a request scope attribute
        String var = getVar();
        if (var != null) {
            Map<String, Object> requestMap
                    = getFacesContext().getExternalContext().getRequestMap();
            if (rowIndex == -1) {
                oldVar = requestMap.remove(var);
            }
            else if (isRowAvailable()) {
                requestMap.put(var, getRowData());
            }
            else {
                requestMap.remove(var);
                if (null != oldVar) {
                    requestMap.put(var, oldVar);
                    oldVar = null;
                }
            }
        }

        if (_initialDescendantFullComponentState != null) {
            Object rowState = _rowDeltaStates.get(getContainerClientId(facesContext));
            if (rowState == null) {
                //Restore as original
                restoreFullDescendantComponentStates(facesContext, getChildren().iterator(), _initialDescendantFullComponentState, false);
            }
            else {
                //Restore first original and then delta
                restoreFullDescendantComponentDeltaStates(facesContext, getChildren().iterator(), rowState, _initialDescendantFullComponentState, false);
            }
            if (getRowIndex() == -1) {
                restoreTransientDescendantComponentStates(facesContext, getChildren().iterator(), null, false);
            }
            else {
                rowState = _rowTransientStates.get(getContainerClientId(facesContext));
                if (rowState == null) {
                    restoreTransientDescendantComponentStates(facesContext, getChildren().iterator(), null, false);
                }
                else {
                    restoreTransientDescendantComponentStates(facesContext, getChildren().iterator(), (Map<String, Object>) rowState, false);
                }
            }
        }
    }
1048333
public UIContext getRowContext(final Object rowBean, final int rowIndex) {
		RepeaterModel model = getOrCreateComponentModel();
		Object rowId = getRowId(rowBean);

		if (model.rowContextMap == null) {
			model.rowContextMap = new HashMap<>();
		}

		SubUIContext rowContext = model.rowContextMap.get(rowId);

		if (rowContext == null) {
			int seq = model.rowContextIdSequence++;

			// Just for the first row, check rowId has implemented equals/hashcode. Assumes each row will use the same
			// row id class.
			if (seq == 0) {
				try {
					if (rowId.getClass() != rowId.getClass().getMethod("equals", Object.class).
							getDeclaringClass()
							|| rowId.getClass() != rowId.getClass().getMethod("hashCode").
							getDeclaringClass()) {
						LOG.warn("Row id class ["
								+ rowId.getClass().getName()
								+ "] has not implemented equals or hashcode. This can cause errors when matching a row context. "
								+ "Implement equals/hashcode on the row bean or refer to setRowIdBeanProperty method on WRepeater.");
					}
				} catch (Exception e) {
					LOG.info(
							"Error checking equals and hashcode implementation on the row id. " + e.
							getMessage(), e);
				}
			}

			// Get the row render id name (used in naming context for each row)
			String renderId = getRowIdName(rowBean, rowId);
			if (renderId == null) {
				// Just use the context id as the row naming context
				rowContext = new SubUIContext(this, seq);
			} else {
				// Check ID is properly formed
				// Must only contain letters, digits and or underscores
				Matcher matcher = ROW_ID_CONTEXT_NAME_PATTERN.matcher(renderId);
				if (!matcher.matches()) {
					throw new IllegalArgumentException(
							"Row idName ["
							+ renderId
							+ "] must start with a letter and followed by letters, digits and or underscores.");
				}
				rowContext = new SubUIContext(this, seq, renderId);
			}
			rowContext.setRowId(rowId);
			model.rowContextMap.put(rowId, rowContext);
		}

		rowContext.setRowIndex(rowIndex); // just incase it has changed
		return rowContext;
	}
886782
public function addRenderer(RendererAbstract $renderer)
    {
        $extension = $renderer->getExtension();

        if (isset($this->renderer[$extension])) {
            return false;
        }
        
        $this->renderer[$extension] = $renderer;
        return true;
    }