Renders a single component without master
548291
public function renderComponent($component, &$hasDynamicParts = false)
    {
        if (Kwf_Component_Data_Root::getShowInvisible()) {
            $hasDynamicParts = true;
        }

        $helper = new Kwf_Component_View_Helper_Component();
        $helper->setRenderer($this);
        $content = $helper->component($component);

        $content = $this->_renderPass2($content, $hasDynamicParts);
        Kwf_Component_Cache::getInstance()->writeBuffer();

        foreach (Kwf_Component_Data_Root::getInstance()->getPlugins('Kwf_Component_PluginRoot_Interface_PostRender') as $plugin) {
            $content = $plugin->processOutput($content, $component);
        }

        return $content;
    }
787911
@Override
	public void render(GuiRenderer renderer)
	{
		if (!isVisible())
			return;

		//		if (getGui().isOverlay())
		//		{
		//			GlStateManager.blendFunc(GL11.GL_CONSTANT_ALPHA, GL11.GL_ONE_MINUS_CONSTANT_ALPHA);
		//			GL14.glBlendColor(1, 1, 1, (float) getAlpha() / 255);
		//		}

		//store last drawn component so that it can be set back after drawing.
		//makes sure components overriding rendering and calling super still have correct
		//relative position in case super renders other components.
		UIComponent oldComponent = renderer.currentComponent;

		//draw background
		IGuiRenderer gr = backgroundRenderer.get();
		if (gr != null)
		{
			renderer.currentComponent = this;
			gr.render(renderer);
			renderer.next();
		}

		//draw foreground
		gr = foregroundRenderer.get();
		if (gr != null)
		{
			ClipArea area = IClipable.intersected(this);
			if (!area.fullClip())
			{
				if (!(this instanceof IControlComponent))
					renderer.startClipping(area);
				renderer.currentComponent = this;
				gr.render(renderer);
				if (!(this instanceof IControlComponent))
					renderer.endClipping(area);
			}
		}

		for (IControlComponent c : controlComponents)
			c.render(renderer);

		renderer.currentComponent = oldComponent;
	}
680053
function renderComponent() {
    var svg = d3.select('svg');
    svg.select('.horizontal')
      .datum([0.15, 0.85])
      .call(horizontalSvgLine);
    svg.select('.vertical')
      .datum([0.2, 0.4, 0.6, 0.8])
      .call(verticalSvgLine);

    var canvas = d3.select('canvas').node();
    var ctx = canvas.getContext('2d');
    horizontalCanvasLine.context(ctx)([0.15, 0.85]);
    verticalCanvasLine.context(ctx)([0.2, 0.4, 0.6, 0.8]);
}
1239359
def render(content)
      content = content.symbolize_keys
      self.class.renderers.keys.each do |renderer_name|
        if content.key?(renderer_name)
          renderer = self.class.renderers[renderer_name]
          to_render = content.delete(renderer_name)
          rendered = renderer[:proc].call(to_render)

          # Unwrap a promise if we got one back
          if rendered.is_a?(Promise)
            rendered = rendered.sync
          end

          return [rendered, content.merge(content_type: renderer[:content_type])]
        end
      end

      # If we couldn't find a renderer - just render an empty string
      ["Error: render only supports #{self.class.renderers.keys.join(', ')}", content_type: 'text/plain']
    end
901909
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WTab tab = (WTab) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:tab");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("open", tab.isOpen(), "true");
		xml.appendOptionalAttribute("disabled", tab.isDisabled(), "true");
		xml.appendOptionalAttribute("hidden", tab.isHidden(), "true");
		xml.appendOptionalAttribute("toolTip", tab.getToolTip());

		switch (tab.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 tab mode: " + tab.getMode());
		}

		if (tab.getAccessKey() != 0) {
			xml.appendAttribute("accessKey", String.valueOf(Character.
					toUpperCase(tab.getAccessKey())));
		}

		xml.appendClose();

		// Paint label
		tab.getTabLabel().paint(renderContext);

		// Paint content
		WComponent content = tab.getContent();

		xml.appendTagOpen("ui:tabcontent");
		xml.appendAttribute("id", tab.getId() + "-content");
		xml.appendClose();

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

		xml.appendEndTag("ui:tabcontent");

		xml.appendEndTag("ui:tab");
	}
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");
	}
963043
function render(element) {
    // Is the given element valid?
    invariant(
        ReactElement.isValidElement(element),
        'render(): You must pass a valid ReactElement.'
    );

    const id = ReactInstanceHandles.createReactRootID(); // Creating a root id & creating the screen
    const component = instantiateReactComponent(element); // Mounting the app
    const transaction = ReactUpdates.ReactReconcileTransaction.getPooled();

    ReactWWIDOperations.setRoot(new WorkerDomNodeStub('0', 'div', {}));

    // The initial render is synchronous but any updates that happen during
    // rendering, in componentWillMount or componentDidMount, will be batched
    // according to the current batching strategy.
    ReactUpdates.batchedUpdates(() => {
        transaction.perform(() => {
            component.mountComponent(id, transaction, {});
        });
        ReactUpdates.ReactReconcileTransaction.release(transaction);
    });

    return component._instance;
}
1079298
function component(container, data, context) {
    const selection = container.nodeName ? select(container) : container;
    const instances = selection
      .selectAll(mine)
      .data(dataArray(data, context), key);
    instances
      .exit()
      .each(destroyInstance);
    return instances
      .enter().append(tagName)
      .attr('class', className)
      .each(createInstance)
      .merge(instances)
      .each(renderInstance);
  }
383761
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WShuffler shuffler = (WShuffler) component;
		XmlStringBuilder xml = renderContext.getWriter();
		boolean readOnly = shuffler.isReadOnly();

		// Start tag
		xml.appendTagOpen("ui:shuffler");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", shuffler.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			xml.appendOptionalAttribute("disabled", shuffler.isDisabled(), "true");
			xml.appendOptionalAttribute("toolTip", shuffler.getToolTip());
			xml.appendOptionalAttribute("accessibleText", shuffler.getAccessibleText());
			int rows = shuffler.getRows();
			xml.appendOptionalAttribute("rows", rows > 0, rows);
		}
		xml.appendClose();

		// Options
		List<?> options = shuffler.getOptions();

		if (options != null && !options.isEmpty()) {
			for (int i = 0; i < options.size(); i++) {
				String stringOption = String.valueOf(options.get(i));
				xml.appendTagOpen("ui:option");
				xml.appendAttribute("value", stringOption);
				xml.appendClose();
				xml.appendEscaped(stringOption);
				xml.appendEndTag("ui:option");
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(shuffler, renderContext);
		}
		// End tag
		xml.appendEndTag("ui:shuffler");
	}
792053
function render(template, locals, layoutTemplates, cb) {
    if (!layoutTemplates) layoutTemplates = [];

    // We'll render templates from bottom to top of the stack, each template
    // being passed the rendered string of the previous ones as `body`
    var i = layoutTemplates.length - 1;

    var _stackRenderer = function(err, htmlStr) {
      if (err) return cb(err);

      if (i >= 0) {
        locals.body = htmlStr;
        renderTemplate(layoutTemplates[i--], locals, _stackRenderer);
      } else {
        cb(null, htmlStr);
      }
    };

    // Start the rendering with the innermost page template
    renderTemplate(template, locals, _stackRenderer);
  }
191938
protected static String render(final WebComponent component) {
		StringWriter stringWriter = new StringWriter();
		PrintWriter printWriter = new PrintWriter(stringWriter);
		component.paint(new WebXmlRenderContext(printWriter));
		printWriter.flush();
		String content = stringWriter.toString();
		return content;
	}
870125
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {

		WTree tree = (WTree) component;
		XmlStringBuilder xml = renderContext.getWriter();

		// Check if rendering an open item request
		String openId = tree.getOpenRequestItemId();
		if (openId != null) {
			handleOpenItemRequest(tree, xml, openId);
			return;
		}

		// Check the tree has tree items (WCAG requirement)
		TreeItemModel model = tree.getTreeModel();
		if (model == null || model.getRowCount() <= 0) {
			LOG.warn("Tree not rendered as it has no items.");
			return;
		}

		xml.appendTagOpen("ui:tree");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("htree", WTree.Type.HORIZONTAL == tree.getType(), "true");
		xml.appendOptionalAttribute("multiple", WTree.SelectMode.MULTIPLE == tree.getSelectMode(), "true");
		xml.appendOptionalAttribute("disabled", tree.isDisabled(), "true");
		xml.appendOptionalAttribute("hidden", tree.isHidden(), "true");
		xml.appendOptionalAttribute("required", tree.isMandatory(), "true");

		switch (tree.getExpandMode()) {
			case CLIENT:
				xml.appendAttribute("mode", "client");
				break;

			case DYNAMIC:
				xml.appendAttribute("mode", "dynamic");
				break;

			case LAZY:
				xml.appendAttribute("mode", "lazy");
				break;

			default:
				throw new IllegalStateException("Invalid expand mode: " + tree.getType());
		}
		xml.appendClose();

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

		if (tree.getCustomTree() == null) {
			handlePaintItems(tree, xml);
		} else {
			handlePaintCustom(tree, xml);
		}

		DiagnosticRenderUtil.renderDiagnostics(tree, renderContext);
		xml.appendEndTag("ui:tree");
	}
1317373
function Renderer(options) {
  options = options || {};
  this.MD   = new MDRenderer(options);
  this.CGMD = new CGMDRenderer(new MDRenderer(options));

  return this;
}
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");
		}
	}
63093
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WSelectToggle toggle = (WSelectToggle) component;
		XmlStringBuilder xml = renderContext.getWriter();

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

		State state = toggle.getState();

		if (State.ALL.equals(state)) {
			xml.appendAttribute("selected", "all");
		} else if (State.NONE.equals(state)) {
			xml.appendAttribute("selected", "none");
		} else {
			xml.appendAttribute("selected", "some");
		}

		xml.appendOptionalAttribute("disabled", toggle.isDisabled(), "true");
		xml.appendAttribute("target", toggle.getTarget().getId());
		xml.appendAttribute("renderAs", toggle.isRenderAsText() ? "text" : "control");
		xml.appendOptionalAttribute("roundTrip", !toggle.isClientSide(), "true");
		xml.appendEnd();
	}
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");
	}
191000
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WDataTable table = (WDataTable) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:table");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", table.isHidden(), "true");
		xml.appendOptionalAttribute("caption", table.getCaption());

		switch (table.getType()) {
			case TABLE:
				xml.appendAttribute("type", "table");
				break;
			case HIERARCHIC:
				xml.appendAttribute("type", "hierarchic");
				break;
			default:
				throw new SystemException("Unknown table type: " + table.getType());
		}

		switch (table.getStripingType()) {
			case ROWS:
				xml.appendAttribute("striping", "rows");
				break;
			case COLUMNS:
				xml.appendAttribute("striping", "cols");
				break;
			case NONE:
				break;
			default:
				throw new SystemException("Unknown striping type: " + table.getStripingType());
		}

		switch (table.getSeparatorType()) {
			case HORIZONTAL:
				xml.appendAttribute("separators", "horizontal");
				break;
			case VERTICAL:
				xml.appendAttribute("separators", "vertical");
				break;
			case BOTH:
				xml.appendAttribute("separators", "both");
				break;
			case NONE:
				break;
			default:
				throw new SystemException("Unknown separator type: " + table.getSeparatorType());
		}

		xml.appendClose();

		if (table.getPaginationMode() != PaginationMode.NONE) {
			paintPaginationElement(table, xml);
		}

		if (table.getSelectMode() != SelectMode.NONE) {
			paintRowSelectionElement(table, xml);
		}

		if (table.getExpandMode() != ExpandMode.NONE) {
			paintRowExpansionElement(table, xml);
		}

		if (table.isSortable()) {
			paintSortElement(table, xml);
		}

		paintColumnHeadings(table, renderContext);
		paintRows(table, renderContext);
		paintTableActions(table, renderContext);

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