Generate the clickable entity of the tab.

@param writer
the response writer
@param tab
the tab to be rendered.
@throws IOException
only thrown if something's wrong with the response writer
16724
private static void encodeTabAnchorTag(FacesContext context, ResponseWriter writer, Tab tab,
			String hiddenInputFieldID, int tabindex, boolean disabled) throws IOException {
		writer.startElement("a", tab);
		writer.writeAttribute("id", tab.getClientId().replace(":", "_") + "_tab", "id");
		writer.writeAttribute("role", "tab", "role");
		if (tab.isDisabled() || disabled) {
			writer.writeAttribute("onclick", "event.preventDefault(); return false;", null);
		} else {
			writer.writeAttribute("data-toggle", "tab", "data-toggle");
			writer.writeAttribute("href", "#" + tab.getClientId().replace(":", "_") + "_pane", "href");
			String onclick = "document.getElementById('" + hiddenInputFieldID + "').value='" + String.valueOf(tabindex)
					+ "';";
			AJAXRenderer.generateBootsFacesAJAXAndJavaScript(context, tab, writer, "click", onclick, false, true);
		}
		R.encodeHTML4DHTMLAttrs(writer, tab.getAttributes(), new String[] { "style", "tabindex" });

		UIComponent iconFacet = tab.getFacet("anchor");
		if (null != iconFacet) {
			iconFacet.encodeAll(FacesContext.getCurrentInstance());
			if (null != tab.getTitle()) {
				writer.writeText(" " + tab.getTitle(), null);
			}
		} else {
			writer.writeText(tab.getTitle(), null);
		}
		writer.endElement("a");
	}
119886
private static void encodeTabLinks(FacesContext context, ResponseWriter writer, TabView tabView,
			int currentlyActiveIndex, List<UIComponent> tabs, String clientId, String hiddenInputFieldID)
			throws IOException {
		writer.startElement("ul", tabView);
		writer.writeAttribute("id", clientId, "id");
		Tooltip.generateTooltip(context, tabView, writer);
		String classes = "nav ";
		if ("left".equalsIgnoreCase(tabView.getTabPosition()) || "right".equalsIgnoreCase(tabView.getTabPosition())) {
			classes += " nav-pills nav-stacked";
		} else {
			classes = classes + (tabView.isPills() ? " nav-pills" : " nav-tabs");
		}

		if (tabView.getStyleClass() != null) {
			classes += " ";
			classes += tabView.getStyleClass();
		}

		writer.writeAttribute("class", classes, "class");

		String role = "tablist";
		AJAXRenderer.generateBootsFacesAJAXAndJavaScript(context, tabView, writer, false);
		R.encodeHTML4DHTMLAttrs(writer, tabView.getAttributes(), new String[] { "style" });
		if (tabView.getRole() != null) {
			role = tabView.getRole();
		}

		writer.writeAttribute("role", role, "role");

		encodeTabs(context, writer, tabs, currentlyActiveIndex, hiddenInputFieldID, tabView.isDisabled());
		writer.endElement("ul");
	}
1000053
public void setWriter (Writer writer) {
		if (!(writer instanceof JsonWriter)) writer = new JsonWriter(writer);
		this.writer = (JsonWriter)writer;
		this.writer.setOutputType(outputType);
		this.writer.setQuoteLongValues(quoteLongValues);
	}
1131018
public void writeTo(Writer writer) throws IOException {
        JsonSerializer.write(Json.jObject("template", asJson()), writer);
        writer.flush();
    }
995511
public void write(Writer writer) throws IOException {
        BufferedWriter bw = new BufferedWriter(writer);
        if (vtzlines != null) {
            for (String line : vtzlines) {
                if (line.startsWith(ICAL_TZURL + COLON)) {
                    if (tzurl != null) {
                        bw.write(ICAL_TZURL);
                        bw.write(COLON);
                        bw.write(tzurl);
                        bw.write(NEWLINE);
                    }
                } else if (line.startsWith(ICAL_LASTMOD + COLON)) {
                    if (lastmod != null) {
                        bw.write(ICAL_LASTMOD);
                        bw.write(COLON);
                        bw.write(getUTCDateTimeString(lastmod.getTime()));
                        bw.write(NEWLINE);
                    }
                } else {
                    bw.write(line);
                    bw.write(NEWLINE);
                }
            }
            bw.flush();
        } else {
            String[] customProperties = null;
            if (olsonzid != null && ICU_TZVERSION != null) {
                customProperties = new String[1];
                customProperties[0] = ICU_TZINFO_PROP + COLON + olsonzid + "[" + ICU_TZVERSION + "]";
            }
            writeZone(writer, tz, customProperties);
        }
    }
1019573
public void writeRequestLine(Writer writer) throws IOException
    {
        writer.write(_method);
        writer.write(' ');
        writer.write(_uri != null ? _uri.toString() : "null");
        writer.write(' ');
        writer.write(_version);
    }
169704
public void save(Writer writer) throws IOException {
        BufferedWriter bufferWriter = new BufferedWriter(writer);
        writePrefixDeclaration(bufferWriter);
        writeMappingDeclaration(bufferWriter);
        bufferWriter.flush();
        bufferWriter.close();
    }
12174
@Override
    public void write(Writer out, boolean escapeXML) throws IOException {
        final String url = this.toURL();
        if (escapeXML) {
            StringEscapeUtils.escapeXml(out, url);
        } else {
            out.write(url);
        }
    }
32914
void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException {
		while(argumentsType.hasNext()) {
			String type = argumentsType.next();
			String name = argumentsName.next();
			writer.append(TAB2).append(" * @param ").append(OPENBRACE).append(type).append(CLOSEBRACE).append(SPACE).append(name).append(CR);
		}
	}
1280640
public void render(final Writer writer) throws GitChangelogRepositoryException {
    final MustacheFactory mf = new DefaultMustacheFactory();
    final String templateContent = checkNotNull(getTemplateContent(), "No template!");
    final StringReader reader = new StringReader(templateContent);
    final Mustache mustache = mf.compile(reader, this.settings.getTemplatePath());
    try {
      final boolean useIntegrationIfConfigured = shouldUseIntegrationIfConfigured(templateContent);
      final Changelog changelog = this.getChangelog(useIntegrationIfConfigured);
      mustache
          .execute(
              writer, //
              new Object[] {changelog, this.settings.getExtendedVariables()} //
              )
          .flush();
    } catch (final IOException e) {
      // Should be impossible!
      throw new GitChangelogRepositoryException("", e);
    }
  }
1143859
void writeFeedLink(Object entity, NavigationProperty property) throws XMLStreamException, ODataEdmException {

        xmlWriter.writeStartElement(ATOM_LINK);
        xmlWriter.writeAttribute(REL, SELF);

        if (entity == null) {
            if (ODataUriUtil.isActionCallUri(oDataUri) || ODataUriUtil.isFunctionCallUri(oDataUri)) {
                Option<TargetType> targetTypeOption = ODataUriUtil.resolveTargetType(oDataUri, entityDataModel);
                if (targetTypeOption.isDefined()) {
                    TargetType targetType = targetTypeOption.get();
                    String entitySetName = EntityDataModelUtil.getEntitySetByEntityTypeName(entityDataModel,
                            targetType.typeName()).getName();
                    xmlWriter.writeAttribute(TITLE, entitySetName);
                    xmlWriter.writeAttribute(HREF, entitySetName);
                } else {
                    throw new ODataEdmException("Failed to resolve entity target type");
                }

            } else {
                xmlWriter.writeAttribute(TITLE, getEntitySetName(oDataUri).get());
                xmlWriter.writeAttribute(HREF, getEntitySetName(oDataUri).get());
            }
        } else {
            xmlWriter.writeAttribute(TITLE, property.getName());
            xmlWriter.writeAttribute(HREF, String.format("%s/%s", getEntityWithKey(entity), property.getName()));
        }

        xmlWriter.writeEndElement();
    }
585283
public void writeEndPage() throws IOException {
		writer.openElement("document");
		writer.textElement("id", Integer.toString(_page.Id));
		writer.textElement("group", "0");
		writer.textElement("timestamp", formatTimestamp(_rev.Timestamp));
		writer.textElement("title", _page.Title.toString());
		writer.textElement("body", _rev.Text);
		writer.closeElement();
		_rev = null;
		_page = null;
	}
1145789
void writeJavadocComment(String methodComment, Writer writer) throws IOException {
		// From javadoc
		if (methodComment != null) {
			methodComment = methodComment.split("@")[0];
			int lastIndexOf = methodComment.lastIndexOf("\n");
			if (lastIndexOf >= 0) {
				methodComment = methodComment.substring(0, lastIndexOf);
			}
			String comment = methodComment.replaceAll("\n", CR+TAB2+" *");
			writer.append(TAB2).append(" *").append(comment).append(CR);
		}
	}
1133320
public void xmlWriteOn(FormattedWriter writer) throws IOException {
        writer.newLine();
        writer.startTag(XML_ITEM_MAP);
        writer.indent();
        for (int i = 0; i < _entry.length; i++) {
            Entry entry =  _entry[i];
            while (null != entry) {
                AbstractItemLink ail = entry.link;
                writer.newLine();
                ail.xmlShortWriteOn(writer);
                entry = entry.next;
            }
        }
        writer.outdent();
        writer.newLine();
        writer.endTag(XML_ITEM_MAP);
    }
691636
@GwtIncompatible("Writer")
  static CharOutput asCharOutput(final Writer writer) {
    checkNotNull(writer);
    return new CharOutput() {
      @Override
      public void write(char c) throws IOException {
        writer.append(c);
      }

      @Override
      public void flush() throws IOException {
        writer.flush();
      }

      @Override
      public void close() throws IOException {
        writer.close();
      }
    };
  }
857779
public void writeTagsToJavaScript(Writer writer) throws IOException
    {
        writer.append("function fillTagService(tagService) {\n");
        writer.append("\t// (name, isPrime, isPseudo, color), [parent tags]\n");
        for (Tag tag : definedTags.values())
        {
            writer.append("\ttagService.registerTag(new Tag(");
            escapeOrNull(tag.getName(), writer);
            writer.append(", ");
            escapeOrNull(tag.getTitle(), writer);
            writer.append(", ").append("" + tag.isPrime())
                        .append(", ").append("" + tag.isPseudo())
                        .append(", ");
            escapeOrNull(tag.getColor(), writer);
            writer.append(")").append(", [");

            // We only have strings, not references, so we're letting registerTag() getOrCreate() the tag.
            for (Tag parentTag : tag.getParentTags())
            {
                writer.append("'").append(StringEscapeUtils.escapeEcmaScript(parentTag.getName())).append("',");
            }
            writer.append("]);\n");
        }
        writer.append("}\n");
    }
732595
public void writeContent(final OutputStream result) throws IOException
    {
    	switch(this.type) {
    		case TAB_CENTER_ALIGN: result.write(DocWriter.getISOBytes("\\tqc")); break;
    		case TAB_RIGHT_ALIGN: result.write(DocWriter.getISOBytes("\\tqr")); break;
    		case TAB_DECIMAL_ALIGN: result.write(DocWriter.getISOBytes("\\tqdec")); break;
        }
        result.write(DocWriter.getISOBytes("\\tx"));
        result.write(intToByteArray(this.position));    	
    }