Paints the given {@link WValidationErrors} component.

@param component The {@link WValidationErrors} component to paint.
@param renderContext the RenderContext to paint to.
177007
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WValidationErrors errors = (WValidationErrors) component;
		XmlStringBuilder xml = renderContext.getWriter();

		if (errors.hasErrors()) {
			xml.appendTagOpen("ui:validationerrors");
			xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
			xml.appendOptionalAttribute("track", component.isTracking(), "true");
			xml.appendOptionalAttribute("title", errors.getTitleText());
			xml.appendClose();

			for (GroupedDiagnositcs nextGroup : errors.getGroupedErrors()) {
				// Render each diagnostic message in this group.
				for (Diagnostic nextMessage : nextGroup.getDiagnostics()) {
					xml.appendTagOpen("ui:error");
					WComponent forComponent = nextMessage.getComponent();

					if (forComponent != null) {
						UIContextHolder.pushContext(nextMessage.getContext());

						try {
							xml.appendAttribute("for", forComponent.getId());
						} finally {
							UIContextHolder.popContext();
						}
					}

					xml.appendClose();

					// DiagnosticImpl has been extended to support rendering
					// of a WComponent as the message.
					if (nextMessage instanceof DiagnosticImpl) {
						WComponent messageComponent = ((DiagnosticImpl) nextMessage)
								.createDiagnosticErrorComponent();

						// We add the component to a throw-away container so that it renders with the correct ID.
						WContainer container = new WContainer() {
							@Override
							public String getId() {
								return component.getId();
							}
						};

						container.add(messageComponent);
						messageComponent.paint(renderContext);
						container.remove(messageComponent);
						container.reset();
					} else {
						xml.append(nextMessage.getDescription());
					}

					xml.appendEndTag("ui:error");
				}
			}

			xml.appendEndTag("ui:validationerrors");
		}
	}
432461
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WMultiFileWidget widget = (WMultiFileWidget) component;
		XmlStringBuilder xml = renderContext.getWriter();

		// Check if rendering a file upload response
		String uploadId = widget.getFileUploadRequestId();
		if (uploadId != null) {
			handleFileUploadRequest(widget, xml, uploadId);
			return;
		}
		boolean readOnly = widget.isReadOnly();


		xml.appendTagOpen(TAG_NAME);
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", widget.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			long maxFileSize = widget.getMaxFileSize();
			int maxFiles = widget.getMaxFiles();
			WComponent dropzone = widget.getDropzone();
			WImageEditor editor = widget.getEditor();

			xml.appendOptionalAttribute("disabled", widget.isDisabled(), "true");
			xml.appendOptionalAttribute("required", widget.isMandatory(), "true");
			xml.appendOptionalAttribute("toolTip", widget.getToolTip());
			xml.appendOptionalAttribute("accessibleText", widget.getAccessibleText());
			xml.appendOptionalAttribute("acceptedMimeTypes", typesToString(widget.getFileTypes()));
			xml.appendOptionalAttribute("maxFileSize", maxFileSize > 0, maxFileSize);
			xml.appendOptionalAttribute("maxFiles", maxFiles > 0, maxFiles);
			if (dropzone != null) {
				xml.appendAttribute("dropzone", dropzone.getId());
			}
			if (editor != null) {
				xml.appendAttribute("editor", editor.getId());
				if (editor.getUseCamera()) {
					xml.appendAttribute("camera", true);
				}
			}
		}
		if (widget.getColumns() != null) {
			xml.appendAttribute("cols", widget.getColumns());
		}
		if (widget.getFileAjaxAction() != null) {
			xml.appendAttribute("ajax", "true");
		}

		List<Diagnostic> diags = readOnly ? null : widget.getDiagnostics(Diagnostic.ERROR);

		if (widget.getFiles().isEmpty()) {
			if (readOnly || diags == null || diags.isEmpty()) {
				xml.appendEnd();
				return;
			}
			xml.appendClose();
		} else {
			xml.appendClose();
			// Render files
			int i = 0;
			for (FileWidgetUpload file : widget.getFiles()) {
				FileWidgetRendererUtil.renderFileElement(widget, xml, file, i++);
			}
		}
		if (!readOnly && diags != null && !diags.isEmpty()) {
			DiagnosticRenderUtil.renderDiagnostics(widget, renderContext);
		}
		xml.appendEndTag(TAG_NAME);
	}
1280747
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WCollapsibleToggle toggle = (WCollapsibleToggle) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:collapsibletoggle");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendAttribute("groupName", toggle.getGroupName());
		xml.appendEnd();
	}
219044
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WCollapsible collapsible = (WCollapsible) component;
		XmlStringBuilder xml = renderContext.getWriter();
		WComponent content = collapsible.getContent();
		boolean collapsed = collapsible.isCollapsed();

		xml.appendTagOpen("ui:collapsible");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendAttribute("groupName", collapsible.getGroupName());
		xml.appendOptionalAttribute("collapsed", collapsed, "true");
		xml.appendOptionalAttribute("hidden", collapsible.isHidden(), "true");

		switch (collapsible.getMode()) {
			case CLIENT:
				xml.appendAttribute("mode", "client");
				break;
			case LAZY:
				xml.appendAttribute("mode", "lazy");
				break;
			case EAGER:
				xml.appendAttribute("mode", "eager");
				break;
			case DYNAMIC:
				xml.appendAttribute("mode", "dynamic");
				break;
			case SERVER:
				xml.appendAttribute("mode", "server");
				break;
			default:
				throw new SystemException("Unknown collapsible mode: " + collapsible.getMode());
		}

		HeadingLevel level = collapsible.getHeadingLevel();
		if (level != null) {
			xml.appendAttribute("level", level.getLevel());
		}

		xml.appendClose();

		// Render margin
		MarginRendererUtil.renderMargin(collapsible, renderContext);

		// Label
		collapsible.getDecoratedLabel().paint(renderContext);

		// Content
		xml.appendTagOpen("ui:content");
		xml.appendAttribute("id", component.getId() + "-content");
		xml.appendClose();

		// Render content if not EAGER Mode or is EAGER and is the current AJAX trigger
		if (CollapsibleMode.EAGER != collapsible.getMode() || AjaxHelper.isCurrentAjaxTrigger(
				collapsible)) {
			// Visibility of content set in prepare paint
			content.paint(renderContext);
		}

		xml.appendEndTag("ui:content");

		xml.appendEndTag("ui:collapsible");
	}
38657
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WField field = (WField) component;
		XmlStringBuilder xml = renderContext.getWriter();
		int inputWidth = field.getInputWidth();

		xml.appendTagOpen("ui:field");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", field.isHidden(), "true");
		xml.appendOptionalAttribute("inputWidth", inputWidth > 0, inputWidth);
		xml.appendClose();

		// Label
		WLabel label = field.getLabel();

		if (label != null) {
			label.paint(renderContext);
		}

		// Field
		if (field.getField() != null) {
			xml.appendTag("ui:input");
			field.getField().paint(renderContext);

			if (field.getErrorIndicator() != null) {
				field.getErrorIndicator().paint(renderContext);
			}

			if (field.getWarningIndicator() != null) {
				field.getWarningIndicator().paint(renderContext);
			}

			xml.appendEndTag("ui:input");
		}

		xml.appendEndTag("ui:field");
	}
275750
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WLink link = (WLink) component;
		XmlStringBuilder xml = renderContext.getWriter();
		String text = link.getText();
		String targetWindowName = link.getOpenNewWindow() ? link.getTargetWindowName() : null;
		String imageUrl = link.getImageUrl();

		xml.appendTagOpen("ui:link");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("disabled", link.isDisabled(), "true");
		xml.appendOptionalAttribute("hidden", component.isHidden(), "true");
		xml.appendOptionalAttribute("toolTip", link.getToolTip());
		xml.appendOptionalAttribute("accessibleText", link.getAccessibleText());
		xml.appendUrlAttribute("url", link.getUrl());
		xml.appendOptionalAttribute("rel", link.getRel());
		xml.appendOptionalAttribute("accessKey", Util.upperCase(link.getAccessKeyAsString()));

		if (imageUrl != null) {
			xml.appendUrlAttribute("imageUrl", imageUrl);
			ImagePosition imagePosition = link.getImagePosition();

			if (imagePosition != null) {
				switch (imagePosition) {
					case NORTH:
						xml.appendAttribute("imagePosition", "n");
						break;
					case EAST:
						xml.appendAttribute("imagePosition", "e");
						break;
					case SOUTH:
						xml.appendAttribute("imagePosition", "s");
						break;
					case WEST:
						xml.appendAttribute("imagePosition", "w");
						break;
					default:
						throw new SystemException("Unknown image position: " + imagePosition);
				}
			}
			// we have an image. We must have a text equivalent
			if (Util.empty(text) && Util.empty(link.getToolTip()) && Util.empty(link.getAccessibleText())) {
				// If the link has an umageUrl but no text equivalent get the text equivalent off of the image
				WImage linkImage = link.getImageHolder();
				if (null != linkImage) {
					xml.appendOptionalAttribute("toolTip", linkImage.getAlternativeText());
				}
			}
		}

		if (link.isRenderAsButton()) {
			xml.appendAttribute("type", "button");
		}

		xml.appendClose();

		if (targetWindowName != null) {
			xml.appendTagOpen("ui:windowAttributes");
			xml.appendAttribute("name", targetWindowName);

			WLink.WindowAttributes attributes = link.getWindowAttrs();

			if (attributes != null) {
				xml.appendOptionalAttribute("top", attributes.getTop() >= 0, attributes.getTop());
				xml.appendOptionalAttribute("left", attributes.getLeft() >= 0, attributes.getLeft());
				xml.appendOptionalAttribute("width", attributes.getWidth() > 0, attributes.
						getWidth());
				xml.appendOptionalAttribute("height", attributes.getHeight() > 0, attributes.
						getHeight());
				xml.appendOptionalAttribute("resizable", attributes.isResizable(), "true");
				xml.appendOptionalAttribute("showMenubar", attributes.isMenubar(), "true");
				xml.appendOptionalAttribute("showToolbar", attributes.isToolbars(), "true");
				xml.appendOptionalAttribute("showLocation", attributes.isLocation(), "true");
				xml.appendOptionalAttribute("showStatus", attributes.isStatus(), "true");
				xml.appendOptionalAttribute("showScrollbars", attributes.isScrollbars(), "true");
				xml.appendOptionalAttribute("showDirectories", attributes.isDirectories(), "true");
			}

			xml.appendEnd();
		}

		if (text != null) {
			xml.appendEscaped(text);
		}

		xml.appendEndTag("ui:link");

		// Paint the AJAX trigger if the link has an action
		if (link.getAction() != null) {
			paintAjaxTrigger(link, xml);
		}

	}
628667
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WRadioButtonSelect rbSelect = (WRadioButtonSelect) component;
		XmlStringBuilder xml = renderContext.getWriter();
		int cols = rbSelect.getButtonColumns();
		boolean readOnly = rbSelect.isReadOnly();

		xml.appendTagOpen("ui:radiobuttonselect");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", rbSelect.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			xml.appendOptionalAttribute("disabled", rbSelect.isDisabled(), "true");
			xml.appendOptionalAttribute("required", rbSelect.isMandatory(), "true");
			xml.appendOptionalAttribute("submitOnChange", rbSelect.isSubmitOnChange(), "true");
			xml.appendOptionalAttribute("toolTip", component.getToolTip());
			xml.appendOptionalAttribute("accessibleText", component.getAccessibleText());
		}
		xml.appendOptionalAttribute("frameless", rbSelect.isFrameless(), "true");

		switch (rbSelect.getButtonLayout()) {
			case COLUMNS:
				xml.appendAttribute("layout", "column");
				xml.appendOptionalAttribute("layoutColumnCount", cols > 0, String.valueOf(cols));
				break;
			case FLAT:
				xml.appendAttribute("layout", "flat");
				break;
			case STACKED:
				xml.appendAttribute("layout", "stacked");
				break;
			default:
				throw new SystemException("Unknown radio button layout: " + rbSelect.getButtonLayout());
		}

		xml.appendClose();

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

		if (options != null) {
			int optionIndex = 0;
			Object selectedOption = rbSelect.getSelected();

			for (Object option : options) {
				if (option instanceof OptionGroup) {
					throw new SystemException("Option groups not supported in WRadioButtonSelect.");
				} else {
					renderOption(rbSelect, option, optionIndex++, xml, selectedOption, renderSelectionsOnly);
				}
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(rbSelect, renderContext);
		}
		xml.appendEndTag("ui:radiobuttonselect");

		if (rbSelect.isAjax()) {
			paintAjax(rbSelect, xml);
		}
	}
1310837
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPanel panel = (WPanel) component;
		XmlStringBuilder xml = renderContext.getWriter();
		FlowLayout layout = (FlowLayout) panel.getLayout();
		Size gap = layout.getSpace();
		String gapString = gap != null ? gap.toString() : null;
		FlowLayout.Alignment align = layout.getAlignment();

		xml.appendTagOpen("ui:flowlayout");

		switch (align) {
			case RIGHT: {
				xml.appendAttribute("align", "right");
				break;
			}
			case CENTER: {
				xml.appendAttribute("align", "center");
				break;
			}
			case LEFT: {
				xml.appendAttribute("align", "left");
				break;
			}

			case VERTICAL:
				xml.appendAttribute("align", "vertical");
				break;

			default:
				throw new IllegalStateException("Unknown layout type: " + layout.getAlignment());
		}

		if (layout.getContentAlignment() != null) {
			switch (layout.getContentAlignment()) {
				case TOP: {
					xml.appendAttribute("valign", "top");
					break;
				}
				case MIDDLE: {
					xml.appendAttribute("valign", "middle");
					break;
				}
				case BASELINE: {
					xml.appendAttribute("valign", "baseline");
					break;
				}

				case BOTTOM:
					xml.appendAttribute("valign", "bottom");
					break;

				default:
					throw new IllegalStateException("Unknown content alignment type: " + layout.
							getContentAlignment());
			}
		}
		xml.appendOptionalAttribute("gap", gapString);

		xml.appendClose();

		int size = panel.getChildCount();

		for (int i = 0; i < size; i++) {
			xml.appendTag("ui:cell");
			WComponent child = panel.getChildAt(i);
			child.paint(renderContext);
			xml.appendEndTag("ui:cell");
		}

		xml.appendEndTag("ui:flowlayout");
	}
150721
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WFieldSet fieldSet = (WFieldSet) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:fieldset");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", fieldSet.isHidden(), "true");

		switch (fieldSet.getFrameType()) {
			case NO_BORDER:
				xml.appendOptionalAttribute("frame", "noborder");
				break;

			case NO_TEXT:
				xml.appendOptionalAttribute("frame", "notext");
				break;

			case NONE:
				xml.appendOptionalAttribute("frame", "none");
				break;

			case NORMAL:
			default:
				break;
		}

		xml.appendOptionalAttribute("required", fieldSet.isMandatory(), "true");
		xml.appendClose();

		// Render margin
		MarginRendererUtil.renderMargin(fieldSet, renderContext);

		// Label
		WDecoratedLabel label = fieldSet.getTitle();
		label.paint(renderContext);

		// Children
		xml.appendTag("ui:content");
		int size = fieldSet.getChildCount();

		for (int i = 0; i < size; i++) {
			WComponent child = fieldSet.getChildAt(i);

			// Skip label, as it has already been painted
			if (child != label) {
				child.paint(renderContext);
			}
		}

		xml.appendEndTag("ui:content");
		DiagnosticRenderUtil.renderDiagnostics(fieldSet, renderContext);
		xml.appendEndTag("ui:fieldset");
	}
120442
@Override
	protected void afterPaint(final RenderContext renderContext) {
		if (renderContext instanceof WebXmlRenderContext) {
			PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter();
			writer.println(WebUtilities.encode(message));

			if (error != null) {
				writer.println("\n<br/>\n<pre>\n");

				StringWriter buf = new StringWriter();
				error.printStackTrace(new PrintWriter(buf));
				writer.println(WebUtilities.encode(buf.toString()));

				writer.println("\n</pre>");
			}
		}
	}
1317634
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WFigure figure = (WFigure) component;
		XmlStringBuilder xml = renderContext.getWriter();

		boolean renderChildren = isRenderContent(figure);

		xml.appendTagOpen("ui:figure");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		if (FigureMode.LAZY.equals(figure.getMode())) {
			xml.appendOptionalAttribute("hidden", !renderChildren, "true");
		} else {
			xml.appendOptionalAttribute("hidden", component.isHidden(), "true");
		}

		FigureMode mode = figure.getMode();
		if (mode != null) {
			switch (mode) {
				case LAZY:
					xml.appendAttribute("mode", "lazy");
					break;
				case EAGER:
					xml.appendAttribute("mode", "eager");
					break;
				default:
					throw new SystemException("Unknown figure mode: " + figure.getMode());
			}
		}

		xml.appendClose();

		// Render margin
		MarginRendererUtil.renderMargin(figure, renderContext);

		if (renderChildren) {
			// Label
			figure.getDecoratedLabel().paint(renderContext);

			// Content
			xml.appendTagOpen("ui:content");
			xml.appendAttribute("id", component.getId() + "-content");
			xml.appendClose();
			figure.getContent().paint(renderContext);
			xml.appendEndTag("ui:content");
		}

		xml.appendEndTag("ui:figure");
	}
527115
@Override
	protected void paintComponent(final RenderContext renderContext) {
		if (renderContext instanceof WebXmlRenderContext) {
			PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter();
			writer.println(getMessage());

			if (developerFriendly) {
				writer.println("<pre style=\"background: lightgrey\">");
				writer.println("Additional details for the developer:");
				writer.println();
				error.printStackTrace(writer);
				writer.println("</pre>");
			}
		}
	}
185669
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WDefinitionList list = (WDefinitionList) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:definitionlist");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");

		switch (list.getType()) {
			case FLAT:
				xml.appendAttribute("type", "flat");
				break;

			case COLUMN:
				xml.appendAttribute("type", "column");
				break;

			case STACKED:
				xml.appendAttribute("type", "stacked");
				break;

			case NORMAL:
				break;

			default:
				throw new SystemException("Unknown layout type: " + list.getType());
		}

		xml.appendClose();

		// Render margin
		MarginRendererUtil.renderMargin(list, renderContext);

		for (Duplet<String, ArrayList<WComponent>> term : list.getTerms()) {
			xml.appendTagOpen("ui:term");
			xml.appendAttribute("text", I18nUtilities.format(null, term.getFirst()));
			xml.appendClose();

			for (WComponent data : term.getSecond()) {
				xml.appendTag("ui:data");
				data.paint(renderContext);
				xml.appendEndTag("ui:data");
			}

			xml.appendEndTag("ui:term");
		}

		xml.appendEndTag("ui:definitionlist");
	}
346604
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WMultiTextField textField = (WMultiTextField) component;
		XmlStringBuilder xml = renderContext.getWriter();

		boolean readOnly = textField.isReadOnly();

		String[] values = textField.getTextInputs();

		xml.appendTagOpen("ui:multitextfield");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", textField.isHidden(), "true");

		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			int cols = textField.getColumns();
			int minLength = textField.getMinLength();
			int maxLength = textField.getMaxLength();
			int maxInputs = textField.getMaxInputs();
			String pattern = textField.getPattern();
			xml.appendOptionalAttribute("disabled", textField.isDisabled(), "true");
			xml.appendOptionalAttribute("required", textField.isMandatory(), "true");
			xml.appendOptionalAttribute("toolTip", textField.getToolTip());
			xml.appendOptionalAttribute("accessibleText", textField.getAccessibleText());
			xml.appendOptionalAttribute("size", cols > 0, cols);
			xml.appendOptionalAttribute("minLength", minLength > 0, minLength);
			xml.appendOptionalAttribute("maxLength", maxLength > 0, maxLength);
			xml.appendOptionalAttribute("max", maxInputs > 0, maxInputs);
			xml.appendOptionalAttribute("pattern", !Util.empty(pattern), pattern);
			// NOTE: do not use HtmlRenderUtil.getEffectivePlaceholder for placeholder - we do not want to echo "required" in every field.
			String placeholder = textField.getPlaceholder();
			xml.appendOptionalAttribute("placeholder", !Util.empty(placeholder), placeholder);
			xml.appendOptionalAttribute("title", I18nUtilities.format(null, InternalMessages.DEFAULT_MULTITEXTFIELD_TIP));
		}
		xml.appendClose();

		if (values != null) {
			for (String value : values) {
				xml.appendTag("ui:value");
				xml.appendEscaped(value);
				xml.appendEndTag("ui:value");
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(textField, renderContext);
		}
		xml.appendEndTag("ui:multitextfield");
	}
350048
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WImageEditor editorComponent = (WImageEditor) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("wc-imageedit");
		xml.appendAttribute("id", editorComponent.getId());
		xml.appendOptionalAttribute("class", editorComponent.getHtmlClass());
		xml.appendOptionalUrlAttribute("overlay", editorComponent.getOverlayUrl());
		xml.appendOptionalAttribute("camera", editorComponent.getUseCamera());
		xml.appendOptionalAttribute("face", editorComponent.getIsFace());
		xml.appendOptionalAttribute("inline", editorComponent.getRenderInline());

		// Check for size information on the image
		Dimension size = editorComponent.getSize();
		if (size != null) {
			if (size.getHeight() >= 0) {
				xml.appendAttribute("height", size.height);
			}

			if (size.getWidth() >= 0) {
				xml.appendAttribute("width", size.width);
			}
		}

		xml.appendEnd();
	}
101725
@Override
	protected void paintComponent(final RenderContext renderContext) {
		if (getState() == DISPLAY_STATE) {
			setState(ACTIVE_STATE);
			showWindow(renderContext);
		} else if (getState() == ACTIVE_STATE && isTargeted()) {
			getComponentModel().wrappedContent.paint(renderContext);
		}
	}
1372796
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WCheckBoxSelect select = (WCheckBoxSelect) component;
		XmlStringBuilder xml = renderContext.getWriter();
		int cols = select.getButtonColumns();
		boolean readOnly = select.isReadOnly();

		xml.appendTagOpen("ui:checkboxselect");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", select.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			int min = select.getMinSelect();
			int max = select.getMaxSelect();
			xml.appendOptionalAttribute("disabled", select.isDisabled(), "true");
			xml.appendOptionalAttribute("required", select.isMandatory(), "true");
			xml.appendOptionalAttribute("submitOnChange", select.isSubmitOnChange(), "true");
			xml.appendOptionalAttribute("toolTip", component.getToolTip());
			xml.appendOptionalAttribute("accessibleText", component.getAccessibleText());
			xml.appendOptionalAttribute("min", min > 0, min);
			xml.appendOptionalAttribute("max", max > 0, max);
		}
		xml.appendOptionalAttribute("frameless", select.isFrameless(), "true");

		switch (select.getButtonLayout()) {
			case COLUMNS:
				xml.appendAttribute("layout", "column");
				xml.appendOptionalAttribute("layoutColumnCount", cols > 0, cols);
				break;
			case FLAT:
				xml.appendAttribute("layout", "flat");
				break;
			case STACKED:
				xml.appendAttribute("layout", "stacked");
				break;
			default:
				throw new SystemException("Unknown layout type: " + select.getButtonLayout());
		}


		xml.appendClose();

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

		if (options != null) {
			int optionIndex = 0;
			List<?> selections = select.getSelected();

			for (Object option : options) {
				if (option instanceof OptionGroup) {
					throw new SystemException("Option groups not supported in WCheckBoxSelect.");
				} else {
					renderOption(select, option, optionIndex++, xml, selections,
							renderSelectionsOnly);
				}
			}
		}
		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(select, renderContext);
		}
		xml.appendEndTag("ui:checkboxselect");
	}