Paints the given {@link WLabel}.

@param component the WLabel to paint.
@param renderContext the RenderContext to paint to.
540712
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WLabel label = (WLabel) component;
		XmlStringBuilder xml = renderContext.getWriter();

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

		WComponent what = label.getForComponent();
		String whatFor = null;
		if (what instanceof MultiInputComponent) {
			whatFor = "group";
		} else if (what instanceof Labelable) {
			whatFor = "input";
		}

		boolean isReadOnly = ((what instanceof Input) && ((Input) what).isReadOnly())
				|| (what instanceof WRadioButton && ((WRadioButton) what).isReadOnly());

		boolean isMandatory = (what instanceof Input) && ((Input) what).isMandatory();

		xml.appendOptionalAttribute("what", whatFor);
		xml.appendOptionalAttribute("readonly", isReadOnly, "true");
		xml.appendOptionalAttribute("required", isMandatory, "true");
		xml.appendOptionalAttribute("hiddencomponent", (what != null && what.isHidden()), "true");
		xml.appendOptionalAttribute("hint", label.getHint());
		xml.appendOptionalAttribute("accessKey", Util.upperCase(label.getAccessKeyAsString()));
		xml.appendOptionalAttribute("hidden", label.isHidden(), "true");
		xml.appendOptionalAttribute("toolTip", label.getToolTip());
		xml.appendOptionalAttribute("accessibleText", label.getAccessibleText());
		xml.appendClose();

		xml.append(label.getText(), label.isEncodeText());

		paintChildren(label, renderContext);

		xml.appendEndTag("ui:label");
	}
921788
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WDataTableRowRenderer renderer = (WDataTableRowRenderer) component;
		XmlStringBuilder xml = renderContext.getWriter();
		WDataTable table = renderer.getTable();
		TableDataModel dataModel = table.getDataModel();
		UIContext uic = UIContextHolder.getCurrent();

		final int numCols = table.getColumnCount();
		int[] columnOrder = table.getColumnOrder();
		int rowIndex = getRowIndex(table, (SubUIContext) uic);
		boolean unselectable = table.getSelectMode() != SelectMode.NONE
				&& !dataModel.isSelectable(rowIndex);

		xml.appendTagOpen("ui:tr");
		xml.appendAttribute("rowIndex", rowIndex);
		xml.appendOptionalAttribute("unselectable", unselectable, "true");
		xml.appendOptionalAttribute("selected", table.getSelectedRows().contains(rowIndex), "true");
		xml.appendOptionalAttribute("filterValues", getFilterValues(dataModel, rowIndex));

		if (table.getExpandMode() != WDataTable.ExpandMode.NONE && dataModel instanceof TreeTableDataModel) {
			TableTreeNode node = ((TreeTableDataModel) dataModel).getNodeAtLine(rowIndex);
			boolean expandable = !node.isLeaf() && !node.isExpanded();
			xml.appendOptionalAttribute("expandable", expandable, "true");
		}

		xml.appendClose();

		if (table.isShowRowHeaders()) {
			xml.appendTag("ui:th");
			renderer.getRowHeader().paint(renderContext);
			xml.appendEndTag("ui:th");
		}

		for (int i = 0; i < numCols; i++) {
			int colIndex = columnOrder == null ? i : columnOrder[i];
			WTableColumn col = table.getColumn(colIndex);

			if (col.isVisible()) {
				xml.appendTag("ui:td");
				renderer.getRenderer(colIndex).paint(renderContext);
				xml.appendEndTag("ui:td");
			}
		}

		if (table.getExpandMode() != WDataTable.ExpandMode.NONE && dataModel instanceof TreeTableDataModel) {
			TreeTableDataModel treeModel = (TreeTableDataModel) dataModel;
			TableTreeNode node = treeModel.getNodeAtLine(rowIndex);

			if (!node.isLeaf()) {
				xml.appendTagOpen("ui:subtr");
				xml.appendOptionalAttribute("open", node.isExpanded(), "true");
				xml.appendClose();

				if (node.isExpanded() || table.getExpandMode() == ExpandMode.CLIENT) {
					WRepeater repeater = table.getRepeater();

					// If there a renderer specified by any child, we only paint content that has a specified renderer
					boolean rendererPresent = false;

					for (Iterator<TreeNode> i = node.children(); !rendererPresent && i.hasNext();) {
						TableTreeNode child = (TableTreeNode) i.next();

						if (child.getRendererClass() != null) {
							rendererPresent = true;
						}
					}

					// Paint immediate children only.
					if (rendererPresent) {
						xml.appendTagOpen("ui:content");
						xml.appendOptionalAttribute("spanAllCols", node.isRendererSpansAllCols(),
								"true");
						xml.appendClose();

						for (Iterator<TreeNode> i = node.children(); i.hasNext();) {
							TableTreeNode child = (TableTreeNode) i.next();
							Integer rowId = child.getRowIndex() - 1;
							UIContext nodeContext = repeater.getRowContext(rowId);

							WComponent expandedRenderer = renderer.getExpandedTreeNodeRenderer(
									child.getRendererClass());

							if (expandedRenderer != null) {
								UIContextHolder.pushContext(nodeContext);

								try {
									expandedRenderer.paint(renderContext);
								} finally {
									UIContextHolder.popContext();
								}
							}
						}

						xml.appendEndTag("ui:content");
					} else {
						for (Iterator<TreeNode> i = node.children(); i.hasNext();) {
							TableTreeNode child = (TableTreeNode) i.next();
							Integer rowId = child.getRowIndex() - 1;
							UIContext nodeContext = repeater.getRowContext(rowId);

							UIContextHolder.pushContext(nodeContext);

							try {
								render(component, renderContext);
							} finally {
								UIContextHolder.popContext();
							}
						}
					}
				}

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

		xml.appendEndTag("ui:tr");
	}
417864
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		AbstractWFieldIndicator fieldIndicator = (AbstractWFieldIndicator) component;
		XmlStringBuilder xml = renderContext.getWriter();

		WComponent validationTarget = fieldIndicator.getTargetComponent();

		// no need to render an indicator for nothing.
		// Diagnosables takes care of thieir own  messaging.
		if (validationTarget == null || (validationTarget instanceof Diagnosable && !(validationTarget instanceof Input))) {
			return;
		}

		if (validationTarget instanceof Input && !((Input) validationTarget).isReadOnly()) {
			return;
		}

		List<Diagnostic> diags = fieldIndicator.getDiagnostics();

		if (diags != null && !diags.isEmpty()) {
			xml.appendTagOpen("ui:fieldindicator");
			xml.appendAttribute("id", component.getId());
			xml.appendOptionalAttribute("track", component.isTracking(), "true");

			switch (fieldIndicator.getFieldIndicatorType()) {
				case INFO:
					xml.appendAttribute("type", "info");
					break;

				case WARN:
					xml.appendAttribute("type", "warn");
					break;

				case ERROR:
					xml.appendAttribute("type", "error");
					break;

				default:
					throw new SystemException("Cannot paint field indicator due to an invalid field indicator type: "
							+ fieldIndicator.getFieldIndicatorType());
			}

			xml.appendAttribute("for", fieldIndicator.getRelatedFieldId());
			xml.appendClose();

			for (Diagnostic diag : diags) {
				xml.appendTag("ui:message");
				xml.appendEscaped(diag.getDescription());
				xml.appendEndTag("ui:message");
			}

			xml.appendEndTag("ui:fieldindicator");
		}
	}
1304007
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WSection section = (WSection) component;
		XmlStringBuilder xml = renderContext.getWriter();

		boolean renderChildren = isRenderContent(section);

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

		SectionMode mode = section.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 section mode: " + section.getMode());
			}
		}

		xml.appendClose();

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

		if (renderChildren) {
			// Label
			section.getDecoratedLabel().paint(renderContext);
			// Content
			section.getContent().paint(renderContext);
		}

		xml.appendEndTag("ui:section");
	}
556030
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WAbbrText abbrText = (WAbbrText) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("abbr");
		xml.appendOptionalAttribute("title", abbrText.getToolTip());
		xml.appendOptionalAttribute("class", abbrText.getHtmlClass());
		xml.appendClose();
		xml.append(abbrText.getText(), abbrText.isEncodeText());
		xml.appendEndTag("abbr");
	}
644282
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WTimeoutWarning warning = (WTimeoutWarning) component;

		XmlStringBuilder xml = renderContext.getWriter();
		final int timoutPeriod = warning.getTimeoutPeriod();
		if (timoutPeriod > 0) {
			xml.appendTagOpen("ui:session");
			xml.appendAttribute("timeout", String.valueOf(timoutPeriod));
			int warningPeriod = warning.getWarningPeriod();
			xml.appendOptionalAttribute("warn", warningPeriod > 0, warningPeriod);
			xml.appendEnd();
		}

	}
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);
		}
	}
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");
	}
1245304
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WToggleButton toggle = (WToggleButton) component;
		XmlStringBuilder xml = renderContext.getWriter();
		boolean readOnly = toggle.isReadOnly();


		xml.appendTagOpen("ui:togglebutton");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", toggle.isHidden(), "true");
		xml.appendOptionalAttribute("selected", toggle.isSelected(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			WComponentGroup<WCheckBox> group = toggle.getGroup();
			String groupName = group == null ? null : group.getId();
			xml.appendOptionalAttribute("groupName", groupName);
			xml.appendOptionalAttribute("disabled", toggle.isDisabled(), "true");
			xml.appendOptionalAttribute("submitOnChange", toggle.isSubmitOnChange(), "true");
			xml.appendOptionalAttribute("toolTip", toggle.getToolTip());
			xml.appendOptionalAttribute("accessibleText", toggle.getAccessibleText());
		}
		xml.appendClose();
		String text = toggle.getText();
		if (text != null) {
			xml.appendEscaped(text);
		}
		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(toggle, renderContext);
		}
		xml.appendEndTag("ui:togglebutton");
	}
195629
@Override
	public void paint(final RenderContext renderContext) {
		boolean enabled = ConfigurationProperties.getDeveloperDumpUIContext();

		super.paint(renderContext);

		if (enabled) {
			UIContext uic = UIContextHolder.getCurrent();

			// We want to dump the shared WComponent tree (UIC) first, so that all the
			// references from the UI context are shown as such
			Object[] treeAndSession
					= new Object[]{
						uic.getUI(),
						uic
					};

			try {
				ObjectGraphNode root = ObjectGraphDump.dump(treeAndSession);

				// We only want to dump the tree once
				boolean treeDumped = "true".equalsIgnoreCase((String) uic.getFwkAttribute(
						UICONTEXT_TREE_DUMPED_KEY));

				if (!treeDumped) {
					uic.setFwkAttribute(UICONTEXT_TREE_DUMPED_KEY, "true");

					// The UI will be the 1st child
					LOG.info("UI dump follows:");
					LOG.info(((ObjectGraphNode) root.getChildAt(0)).toXml());
				}

				// The UI context will be the 2nd child
				LOG.info("UI Context dump follows:");
				LOG.info(((ObjectGraphNode) root.getChildAt(1)).toXml());
			} catch (Exception e) {
				LOG.error("Failed to dump context", e);
			}
		}
	}
544510
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPanel panel = (WPanel) component;
		XmlStringBuilder xml = renderContext.getWriter();
		GridLayout layout = (GridLayout) panel.getLayout();
		Size hgap = layout.getHorizontalGap();
		String hgapString = hgap == null ? null : hgap.toString();
		Size vgap = layout.getVerticalGap();
		String vgapString = vgap == null ? null : vgap.toString();
		int rows = layout.getRows();
		int cols = layout.getCols();

		xml.appendTagOpen("ui:gridlayout");

		xml.appendAttribute("rows", rows > 0 ? String.valueOf(rows) : "0");
		xml.appendAttribute("cols", cols > 0 ? String.valueOf(cols) : "0");
		xml.appendOptionalAttribute("hgap", hgapString);
		xml.appendOptionalAttribute("vgap", vgapString);

		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:gridlayout");
	}
894867
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WVideo videoComponent = (WVideo) component;
		XmlStringBuilder xml = renderContext.getWriter();
		Video[] video = videoComponent.getVideo();

		if (video == null || video.length == 0) {
			return;
		}

		Track[] tracks = videoComponent.getTracks();
		WVideo.Controls controls = videoComponent.getControls();
		int width = videoComponent.getWidth();
		int height = videoComponent.getHeight();
		int duration = video[0].getDuration();

		// Check for alternative text
		String alternativeText = videoComponent.getAltText();

		if (alternativeText == null) {
			LOG.warn("Video should have a description.");
			alternativeText = null;
		} else {
			alternativeText = I18nUtilities.format(null, alternativeText);
		}

		xml.appendTagOpen("ui:video");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalUrlAttribute("poster", videoComponent.getPosterUrl());
		xml.appendOptionalAttribute("alt", alternativeText);
		xml.appendOptionalAttribute("autoplay", videoComponent.isAutoplay(), "true");
		xml.appendOptionalAttribute("mediagroup", videoComponent.getMediaGroup());
		xml.appendOptionalAttribute("loop", videoComponent.isLoop(), "true");
		xml.appendOptionalAttribute("muted", videoComponent.isMuted(), "true");
		xml.appendOptionalAttribute("hidden", videoComponent.isHidden(), "true");
		xml.appendOptionalAttribute("disabled", videoComponent.isDisabled(), "true");
		xml.appendOptionalAttribute("toolTip", videoComponent.getToolTip());
		xml.appendOptionalAttribute("width", width > 0, width);
		xml.appendOptionalAttribute("height", height > 0, height);
		xml.appendOptionalAttribute("duration", duration > 0, duration);

		switch (videoComponent.getPreload()) {
			case NONE:
				xml.appendAttribute("preload", "none");
				break;

			case META_DATA:
				xml.appendAttribute("preload", "metadata");
				break;

			case AUTO:
			default:
				break;
		}

		if (controls != null && !WVideo.Controls.NATIVE.equals(controls)) {
			switch (controls) {
				case NONE:
					xml.appendAttribute("controls", "none");
					break;

				case ALL:
					xml.appendAttribute("controls", "all");
					break;

				case PLAY_PAUSE:
					xml.appendAttribute("controls", "play");
					break;

				case DEFAULT:
					xml.appendAttribute("controls", "default");
					break;

				default:
					LOG.error("Unknown control type: " + controls);
			}
		}

		xml.appendClose();

		String[] urls = videoComponent.getVideoUrls();

		for (int i = 0; i < urls.length; i++) {
			xml.appendTagOpen("ui:src");
			xml.appendUrlAttribute("uri", urls[i]);
			xml.appendOptionalAttribute("type", video[i].getMimeType());

			if (video[i].getSize() != null) {
				xml.appendOptionalAttribute("width", video[i].getSize().width > 0, video[i].
						getSize().width);
				xml.appendOptionalAttribute("height", video[i].getSize().height > 0, video[i].
						getSize().height);
			}

			xml.appendEnd();
		}

		if (tracks != null && tracks.length > 0) {
			String[] trackUrls = videoComponent.getTrackUrls();

			for (int i = 0; i < tracks.length; i++) {
				xml.appendTagOpen("ui:track");
				xml.appendUrlAttribute("src", trackUrls[i]);
				xml.appendOptionalAttribute("lang", tracks[i].getLanguage());
				xml.appendOptionalAttribute("desc", tracks[i].getDescription());
				xml.appendOptionalAttribute("kind", trackKindToString(tracks[i].getKind()));
				xml.appendEnd();
			}
		}

		xml.appendEndTag("ui:video");
	}
1285790
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WRow row = (WRow) component;
		XmlStringBuilder xml = renderContext.getWriter();
		int cols = row.getChildCount();
		Size gap = row.getSpace();
		String gapString = gap != null ? gap.toString() : null;

		if (cols > 0) {
			xml.appendTagOpen("ui:row");
			xml.appendAttribute("id", component.getId());
			xml.appendOptionalAttribute("class", component.getHtmlClass());
			xml.appendOptionalAttribute("track", component.isTracking(), "true");
			xml.appendOptionalAttribute("gap", gapString);
			xml.appendClose();

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

			paintChildren(row, renderContext);

			xml.appendEndTag("ui:row");
		}
	}
977725
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WMessageBox messageBox = (WMessageBox) component;
		XmlStringBuilder xml = renderContext.getWriter();

		if (messageBox.hasMessages()) {
			xml.appendTagOpen("ui:messagebox");
			xml.appendAttribute("id", component.getId());
			xml.appendOptionalAttribute("class", component.getHtmlClass());
			xml.appendOptionalAttribute("track", component.isTracking(), "true");

			switch (messageBox.getType()) {
				case SUCCESS:
					xml.appendOptionalAttribute("type", "success");
					break;

				case INFO:
					xml.appendOptionalAttribute("type", "info");
					break;

				case WARN:
					xml.appendOptionalAttribute("type", "warn");
					break;

				case ERROR:
				default:
					xml.appendOptionalAttribute("type", "error");
					break;
			}

			xml.appendOptionalAttribute("title", messageBox.getTitleText());

			xml.appendClose();

			for (String message : messageBox.getMessages()) {
				xml.appendTag("ui:message");
				xml.print(message);
				xml.appendEndTag("ui:message");
			}

			xml.appendEndTag("ui:messagebox");
		}
	}
700989
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WFileWidget fileWidget = (WFileWidget) component;
		XmlStringBuilder xml = renderContext.getWriter();
		boolean readOnly = fileWidget.isReadOnly();

		xml.appendTagOpen(TAG_NAME);
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", component.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
			xml.appendEnd();
			return;
		}
		xml.appendOptionalAttribute("disabled", fileWidget.isDisabled(), "true");
		xml.appendOptionalAttribute("required", fileWidget.isMandatory(), "true");
		xml.appendOptionalAttribute("toolTip", fileWidget.getToolTip());
		xml.appendOptionalAttribute("accessibleText", fileWidget.getAccessibleText());
		xml.appendOptionalAttribute("acceptedMimeTypes", typesToString(fileWidget.getFileTypes()));
		long maxFileSize = fileWidget.getMaxFileSize();
		xml.appendOptionalAttribute("maxFileSize", maxFileSize > 0, maxFileSize);

		List<Diagnostic> diags = fileWidget.getDiagnostics(Diagnostic.ERROR);
		if (diags == null || diags.isEmpty()) {
			xml.appendEnd();
			return;
		}
		xml.appendClose();
		DiagnosticRenderUtil.renderDiagnostics(fileWidget, renderContext);
		xml.appendEndTag(TAG_NAME);
	}
769881
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WImage imageComponent = (WImage) component;
		XmlStringBuilder xml = renderContext.getWriter();

		// No image set
		if (imageComponent.getImage() == null && imageComponent.getImageUrl() == null) {
			return;
		}

		renderTagOpen(imageComponent, xml);
		xml.appendEnd();
	}
413593
@Override
	protected void paintComponent(final RenderContext renderContext) {
		super.paintComponent(renderContext);

		WComponent visibleDialog = getVisible();

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