This method will append to the pdf a legend explaining the visual feedback in the pdf, an overview of the styles
used and an overview of the properties used.

@throws DocumentException
552838
public static void appendDebugInfo(PdfWriter writer, Document document, EnhancedMap settings, StylerFactory stylerFactory) throws DocumentException, VectorPrintException {

      PdfContentByte canvas = writer.getDirectContent();
      canvas.setFontAndSize(FontFactory.getFont(FontFactory.COURIER).getBaseFont(), 8);
      canvas.setColorFill(itextHelper.fromColor(settings.getColorProperty(Color.MAGENTA, ReportConstants.DEBUGCOLOR)));
      canvas.setColorStroke(itextHelper.fromColor(settings.getColorProperty(Color.MAGENTA, ReportConstants.DEBUGCOLOR)));

      Font f = FontFactory.getFont(FontFactory.COURIER, 8);

      f.setColor(itextHelper.fromColor(settings.getColorProperty(Color.MAGENTA, ReportConstants.DEBUGCOLOR)));

      float top = document.getPageSize().getTop();

      document.add(new Phrase(new Chunk("table: ", f).setLocalDestination(DEBUGPAGE)));
      document.add(Chunk.NEWLINE);
      document.add(new Phrase("cell: ", f));
      document.add(Chunk.NEWLINE);
      document.add(new Phrase("image: ", f));
      document.add(Chunk.NEWLINE);
      document.add(new Phrase("text: ", f));
      document.add(Chunk.NEWLINE);
      document.add(new Phrase("background color is shown in a small rectangle", f));
      document.add(Chunk.NEWLINE);
      canvas.setLineWidth(2);
      canvas.setLineDash(new float[]{0.3f, 5}, 0);
      float left = document.leftMargin();
      canvas.rectangle(left + 80, top - 25, left + 80, 8);
      canvas.closePathStroke();
      canvas.setLineWidth(0.3f);
      canvas.setLineDash(new float[]{2, 2}, 0);
      canvas.rectangle(left + 80, top - 37, left + 80, 8);
      canvas.closePathStroke();
      canvas.setLineDash(new float[]{1, 0}, 0);
      canvas.rectangle(left + 80, top - 50, left + 80, 8);
      canvas.closePathStroke();
      canvas.setLineDash(new float[]{0.3f, 5}, 0);
      canvas.rectangle(left + 80, top - 63, left + 80, 8);
      canvas.closePathStroke();
      document.add(Chunk.NEWLINE);

      document.add(new Phrase("fonts available: " + FontFactory.getRegisteredFonts(), f));

      document.add(Chunk.NEWLINE);

      if (settings.getBooleanProperty(false, DEBUG)) {
         document.add(new Phrase("OVERVIEW OF STYLES FOR THIS REPORT", f));
         document.add(Chunk.NEWLINE);
         document.add(Chunk.NEWLINE);
      }

      Font b = new Font(f);
      b.setStyle("bold");
      Set<Map.Entry<String, String>> entrySet = stylerFactory.getStylerSetup().entrySet();
      for (Map.Entry<String, String> styleInfo : entrySet) {
         String key = styleInfo.getKey();
         document.add(new Chunk(key, b).setLocalDestination(key));
         document.add(new Chunk(": " + styleInfo.getValue(), f));
         document.add(Chunk.NEWLINE);
         document.add(new Phrase("   styling configured by " + key + ": ", f));
         for (BaseStyler st : (Collection<BaseStyler>) stylerFactory.getBaseStylersFromCache((key))) {
            document.add(Chunk.NEWLINE);
            document.add(new Chunk("      ", f));
            document.add(new Chunk(st.getClass().getSimpleName(), DebugHelper.debugFontLink(canvas, settings)).setLocalGoto(st.getClass().getSimpleName()));
            document.add(new Chunk(":", f));
            document.add(Chunk.NEWLINE);
            document.add(new Phrase("         non default parameters for " + st.getClass().getSimpleName() + ": " + getParamInfo(st), f));
            document.add(Chunk.NEWLINE);
            if (!st.getConditions().isEmpty()) {
               document.add(new Phrase("      conditions for this styler: ", f));
            }
            for (StylingCondition sc : (Collection<StylingCondition>) st.getConditions()) {
               document.add(Chunk.NEWLINE);
               document.add(new Chunk("         ", f));
               document.add(new Chunk(sc.getClass().getSimpleName(), DebugHelper.debugFontLink(canvas, settings)).setLocalGoto(sc.getClass().getSimpleName()));
               document.add(Chunk.NEWLINE);
               document.add(new Phrase("            non default parameters for " + sc.getClass().getSimpleName() + ": " + getParamInfo(sc), f));
            }
         }
         document.add(Chunk.NEWLINE);
         document.add(Chunk.NEWLINE);
      }

      document.newPage();

      document.add(new Phrase("Properties used for the report", f));
      document.add(Chunk.NEWLINE);

      ByteArrayOutputStream bo = new ByteArrayOutputStream();
      PrintStream ps = new PrintStream(bo);

      settings.listProperties(ps);
      ps.close();
      document.add(new Paragraph(bo.toString(), f));

      document.newPage();

      try {
         bo = new ByteArrayOutputStream();
         ps = new PrintStream(bo);
         Help.printHelpHeader(ps);
         ps.close();
         document.add(new Paragraph(bo.toString(), f));

         Help.printStylerHelp(document, f);

         Help.printConditionrHelp(document, f);

      } catch (IOException | ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ex) {
         log.log(Level.SEVERE, null, ex);
      }
   }
397249
public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(List<StyledSegment<SEG, S>> styledSegments) {
        return addParagraph(styledSegments, null);
    }
358944
protected void initPage() throws DocumentException {
        // the pagenumber is incremented
        pageN++;

        // initialization of some page objects
        annotationsImp.resetAnnotations();
        pageResources = new PageResources();

        writer.resetContent();
        graphics = new PdfContentByte(writer);
        text = new PdfContentByte(writer);
        text.reset();
        text.beginText();
        textEmptySize = text.size();

    	markPoint = 0;
        setNewPageSizeAndMargins();
        imageEnd = -1;
        indentation.imageIndentRight = 0;
        indentation.imageIndentLeft = 0;
        indentation.indentBottom = 0;
        indentation.indentTop = 0;
        currentHeight = 0;

        // backgroundcolors, etc...
        thisBoxSize = new HashMap(boxSize);
        if (pageSize.getBackgroundColor() != null
        || pageSize.hasBorders()
        || pageSize.getBorderColor() != null) {
            add(pageSize);
        }

        float oldleading = leading;
        int oldAlignment = alignment;
        // if there is a footer, the footer is added
        doFooter();
        // we move to the left/top position of the page
        text.moveText(left(), top());
        doHeader();
        pageEmpty = true;
        // if there is an image waiting to be drawn, draw it
        try {
            if (imageWait != null) {
                add(imageWait);
                imageWait = null;
            }
        }
        catch(Exception e) {
            throw new ExceptionConverter(e);
        }
        leading = oldleading;
        alignment = oldAlignment;
        carriageReturn();

        PdfPageEvent pageEvent = writer.getPageEvent();
        if (pageEvent != null) {
            if (firstPageEvent) {
                pageEvent.onOpenDocument(writer, this);
            }
            pageEvent.onStartPage(writer, this);
        }
        firstPageEvent = false;
    }
199830
def add_doc(self, doc):
        
        if isinstance(doc, HelloDoc) and doc.validate():
            self.docs.append(doc)
        else:
            if not doc.validate():
                raise Exception("HelloDoc Errors %s" % (doc.errors,))
            else:
                raise Exception("add_doc doc must be an instance of class HelloDoc")
922980
void generateIndexFile() throws DocFileIOException {
        Content htmlDocType = configuration.isOutputHtml5()
                ? DocType.HTML5
                : DocType.TRANSITIONAL;
        Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
        Content head = new HtmlTree(HtmlTag.HEAD);
        head.addContent(getGeneratedBy(!configuration.notimestamp));

        String title = (configuration.windowtitle.length() > 0)
                ? configuration.windowtitle
                : configuration.getText("doclet.Generated_Docs_Untitled");

        Content windowTitle = HtmlTree.TITLE(new StringContent(title));
        head.addContent(windowTitle);
        Content metaContentType = HtmlTree.META("Content", CONTENT_TYPE,
                (configuration.charset.length() > 0) ?
                        configuration.charset : HtmlConstants.HTML_DEFAULT_CHARSET);
        head.addContent(metaContentType);

        String topFilePath = configuration.topFile.getPath();
        String javaScriptRefresh = "window.location.replace('" + topFilePath + "')";
        HtmlTree scriptTree = HtmlTree.SCRIPT();
        scriptTree.addContent(javaScriptRefresh);
        head.addContent(scriptTree);
        HtmlTree metaRefresh = new HtmlTree(HtmlTag.META);
        metaRefresh.addAttr(HtmlAttr.HTTP_EQUIV, "Refresh");
        metaRefresh.addAttr(HtmlAttr.CONTENT, "0;" + topFilePath);
        if (configuration.isOutputHtml5()) {
            head.addContent(HtmlTree.NOSCRIPT(metaRefresh));
        } else {
            head.addContent(metaRefresh);
        }

        head.addContent(getStyleSheetProperties(configuration));

        ContentBuilder bodyContent = new ContentBuilder();
        bodyContent.addContent(HtmlTree.NOSCRIPT(
                HtmlTree.P(configuration.getContent("doclet.No_Script_Message"))));

        bodyContent.addContent(HtmlTree.P(HtmlTree.A(topFilePath, new StringContent(topFilePath))));

        Content body = new HtmlTree(HtmlTag.BODY);
        if (configuration.allowTag(HtmlTag.MAIN)) {
            HtmlTree main = HtmlTree.MAIN(bodyContent);
            body.addContent(main);
        } else {
            body.addContent(bodyContent);
        }

        Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
                head, body);
        Content htmlDocument = new HtmlDocument(htmlDocType,
                htmlComment, htmlTree);
        write(htmlDocument);

    }
853742
public void addDocument(Document doc, int order) throws HelloSignException {
        if (doc == null) {
            throw new HelloSignException("Document cannot be null");
        }
        try {
            documents.add(order, doc);
        } catch (Exception ex) {
            throw new HelloSignException(ex);
        }
    }
172340
void add_document(Document doc)
    {
        doc.feature().normalize();
        documents_.add(doc);
        composite_.add_vector(doc.feature());
    }
17484
@SuppressWarnings("checkstyle:all")
	protected void generateDocumentationFormatterImpl() {
		final TypeReference formatter = getDocumentationFormatterImpl();
		StringConcatenationClient content = new StringConcatenationClient() {
			@SuppressWarnings("synthetic-access")
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Formatter a documentation string."); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("public class DocumentationFormatter implements "); //$NON-NLS-1$
				it.append(getIDocumentationFormatter());
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate static final String SPACE_CHAR = \" \";"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprivate static final String NL_CHAR = \"\\n\";"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprivate static final String EMPTY_STR = \"\";"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprivate String mlLinePrefix;"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprivate String mlStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprivate String mlEnd;"); //$NON-NLS-1$
				it.newLine();
				it.append("\tprivate String slPrefix;"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprotected static boolean isNewLine(char character) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (character == '\\n' || character == '\\r' || character == '\\f') {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\treturn ((((1 << Character.LINE_SEPARATOR)"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t| (1 << Character.PARAGRAPH_SEPARATOR)) >> Character.getType((int) character)) & 1) != 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String getMultilineCommentStartSymbols() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn this.mlStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic void setMultilineCommentStartSymbols(String symbols) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tthis.mlStart = symbols;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String getMultilineCommentEndSymbols() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn this.mlEnd;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic void setMultilineCommentEndSymbols(String symbols) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tthis.mlEnd = symbols;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String getMultilineCommentLinePrefix() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn this.mlLinePrefix;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic void setMultilineCommentLinePrefix(String prefix) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tthis.mlLinePrefix = prefix;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String getSinglelineCommentPrefix() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn this.slPrefix;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tprotected "); //$NON-NLS-1$
				it.append(Set.class);
				it.append("<Character> getSinglelineCommentSpecialChars() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal "); //$NON-NLS-1$
				it.append(Set.class);
				it.append("<Character> set = new "); //$NON-NLS-1$
				it.append(TreeSet.class);
				it.append("<>();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tset.add('*');"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tset.add('+');"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tset.add('-');"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tset.add('=');"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn set;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic void setSinglelineCommentPrefix(String prefix) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tthis.slPrefix = prefix;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Inject.class);
				it.newLine();
				it.append("\tpublic void setGrammarAccess("); //$NON-NLS-1$
				it.append(DocumentationBuilderFragment.this.grammarAccessExtensions.getGrammarAccess(getGrammar()));
				it.append(" access) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (this.mlStart == null || this.mlEnd == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t"); //$NON-NLS-1$
				it.append(AbstractRule.class);
				it.append(" mlRule = access.getML_COMMENTRule();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfor ("); //$NON-NLS-1$
				it.append(AbstractElement.class);
				it.append(" element : (("); //$NON-NLS-1$
				it.append(Group.class);
				it.append(") mlRule.getAlternatives()).getElements()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (element instanceof "); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(" && this.mlStart == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tthis.mlStart = (("); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(") element).getValue();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t} else if (element instanceof "); //$NON-NLS-1$
				it.append(UntilToken.class);
				it.append(" && this.mlEnd == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tthis.mlEnd = (("); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(") (("); //$NON-NLS-1$
				it.append(UntilToken.class);
				it.append(") element).getTerminal()).getValue();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (this.mlLinePrefix == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.mlLinePrefix = this.mlStart.substring(this.mlStart.length() - 1);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (this.slPrefix == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t"); //$NON-NLS-1$
				it.append(AbstractRule.class);
				it.append(" slRule = access.getSL_COMMENTRule();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfor ("); //$NON-NLS-1$
				it.append(AbstractElement.class);
				it.append(" element : (("); //$NON-NLS-1$
				it.append(Group.class);
				it.append(") slRule.getAlternatives()).getElements()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (element instanceof "); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(") {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tthis.slPrefix = (("); //$NON-NLS-1$
				it.append(Keyword.class);
				it.append(") element).getValue().trim();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tbreak;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String formatMultilineComment(String doc) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn formatMultilineComment(doc, (String) null);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String formatMultilineComment(String doc, String indentation) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t"); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" appendable = new "); //$NON-NLS-1$
				it.append(StringBuilderBasedAppendable.class);
				it.append("();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tformatMultilineComment(doc, indentation, appendable);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn appendable.getContent();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic void formatMultilineComment(String doc, "); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" appendable) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tformatMultilineComment(doc, null, appendable);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic void formatMultilineComment(String doc, String indentation, "); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" appendable) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (!"); //$NON-NLS-1$
				it.append(Strings.class);
				it.append(".isEmpty(doc)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal "); //$NON-NLS-1$
				it.append(SortedMap.class);
				it.append("<Integer, Replacement> replacements = new "); //$NON-NLS-1$
				it.append(TreeMap.class);
				it.append("();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tformatMultlineComment(indentation, Strings.newLine(), new AppendableAccessor(appendable, doc, replacements, 0, doc.length()));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic void formatMultilineComment("); //$NON-NLS-1$
				it.append(ITextReplacerContext.class);
				it.append(" context, "); //$NON-NLS-1$
				it.append(IComment.class);
				it.append(" comment) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tformatMultlineComment(context.getIndentationString(), context.getNewLinesString(1), new RegionAccessor(context, comment));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String formatSinglelineComment(String doc) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn formatSinglelineComment(doc, (String) null);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\t\tpublic String formatSinglelineComment(String doc, String indentation) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t"); //$NON-NLS-1$
				it.append(StringBuilderBasedAppendable.class);
				it.append(" appendable = new "); //$NON-NLS-1$
				it.append(StringBuilderBasedAppendable.class);
				it.append("();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tformatSinglelineComment(doc, indentation, appendable);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn appendable.getContent();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic void formatSinglelineComment(String doc, "); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" appendable) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tformatSinglelineComment(doc, null, appendable);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic void formatSinglelineComment(String doc, String indentation, "); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" appendable) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (!"); //$NON-NLS-1$
				it.append(Strings.class);
				it.append(".isEmpty(doc)) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal "); //$NON-NLS-1$
				it.append(SortedMap.class);
				it.append("<Integer, Replacement> replacements = new "); //$NON-NLS-1$
				it.append(TreeMap.class);
				it.append("<>();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint offset = doc.indexOf(getSinglelineCommentPrefix());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (offset < 0) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\toffset = 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint endOffset = doc.indexOf(NL_CHAR, offset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (endOffset < 0) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tendOffset = doc.length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tformatSinglelineComment("); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tindentation,"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tnew AppendableAccessor(appendable, doc, replacements, offset, endOffset));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic void formatSinglelineComment("); //$NON-NLS-1$
				it.append(ITextReplacerContext.class);
				it.append(" context, "); //$NON-NLS-1$
				it.append(IComment.class);
				it.append(" comment) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tformatSinglelineComment(context.getIndentationString(), new RegionAccessor(context, comment));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate <T> void formatSinglelineComment(String indentationString, FormattedTextAccessor<T> backend) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal String indent = "); //$NON-NLS-1$
				it.append(Strings.class);
				it.append(".emptyIfNull(indentationString);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal String comment = backend.getCommentText();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Compute the starting offset of the text inside the comment"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint offset = comment.indexOf(getSinglelineCommentPrefix());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (offset < 0) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tbackend.replace(0, 0, getSinglelineCommentPrefix());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\toffset = 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\toffset += getSinglelineCommentPrefix().length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal int endOffset = comment.length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tT currentLine = backend.getFirstLine(backend.getCommentOffset());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tboolean firstLine = true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\twhile (currentLine != null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tString lineText = backend.getLineText(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint lineOffset = backend.getLineOffset(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint lineLength = backend.getLineLength(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Clamp the line text to the comment area."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (firstLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (lineOffset < offset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tfinal int len = offset - lineOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineText = lineText.substring(len);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineOffset += len;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineLength -= len;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} else if (lineOffset >= endOffset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t// After the end of comment"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tbackend.applyReplacements();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\treturn;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tfinal String prefix;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (!startsWith(lineText, 0, getSinglelineCommentPrefix())) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tprefix = indent + getSinglelineCommentPrefix();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tprefix = indent;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tbackend.replace(lineOffset, 0, prefix);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Skip the comment characters that corresponds to the Javadoc format: //[*-+=]."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint realCommentStart = 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal "); //$NON-NLS-1$
				it.append(Set.class);
				it.append("<Character> specialChars = getSinglelineCommentSpecialChars();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\twhile (realCommentStart < lineLength && specialChars.contains(lineText.charAt(realCommentStart))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t++realCommentStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Search for the first non whitespace"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint firstNonWhiteSpacePos = realCommentStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\twhile (firstNonWhiteSpacePos < lineLength && Character.isWhitespace(lineText.charAt(firstNonWhiteSpacePos))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t++firstNonWhiteSpacePos;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Add whitespace at the beginning."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (firstNonWhiteSpacePos == lineLength) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t// Empty comment"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (realCommentStart < firstNonWhiteSpacePos) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tbackend.replace(realCommentStart + lineOffset, lineLength - realCommentStart, EMPTY_STR);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tfinal int expectedNbWhiteSpaces = getWhiteSpacesOnFirstLine();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tfinal int nbWhiteSpaces = firstNonWhiteSpacePos - realCommentStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (nbWhiteSpaces != expectedNbWhiteSpaces) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tbackend.replace(realCommentStart + lineOffset, nbWhiteSpaces, makeWhiteSpaces(expectedNbWhiteSpaces));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t// Format the comment text"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tformatLineText("); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineText.substring(firstNonWhiteSpacePos, lineLength), true,"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tnew SubAccessor<>(backend, lineOffset + firstNonWhiteSpacePos));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t// Remove trailing whitespaces"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tint endOfText = lineLength;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\twhile ((endOfText - 1) > firstNonWhiteSpacePos && Character.isWhitespace(lineText.charAt(endOfText - 1))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\t--endOfText;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (endOfText < lineLength) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tbackend.replace(endOfText + lineOffset, lineLength - endOfText, EMPTY_STR);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfirstLine = false;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tcurrentLine = backend.getNextLine(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tbackend.applyReplacements();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate static String safeSubstring(String text, int start, int length) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (text == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn EMPTY_STR;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal int index = Math.max(0, start);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal int len = Math.max(0, Math.min(length, text.length()));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn text.substring(index, index + len);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate static boolean startsWith(String text, int start, String pattern) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn safeSubstring(text, start, pattern.length()).equals(pattern);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate static String makeWhiteSpaces(int nb) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal StringBuilder b = new StringBuilder();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfor (int i = 0; i < nb; ++i) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tb.append(SPACE_CHAR);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn b.toString();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprotected int getWhiteSpacesOnFirstLine() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn 1;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprotected int getWhiteSpacesOnOtherLines() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn 1;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprotected <T> void formatLineText(String lineText, boolean isMultlineComment, FormattedTextAccessor<T> backend) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate <T> boolean formatMultlineCommentFirstLine(String lineText, String indentationString, String newLineString, int endCommentOffset, FormattedTextAccessor<T> backend) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Skip the comment characters that corresponds to the Javadoc format: /**."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint realCommentStart = 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\twhile (realCommentStart < lineText.length() && startsWith(lineText, realCommentStart, getMultilineCommentLinePrefix())) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\trealCommentStart += getMultilineCommentLinePrefix().length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Search for the first non whitespace"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint firstNonWhiteSpacePos = realCommentStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tboolean hasNonSpaceChar = false;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\twhile (firstNonWhiteSpacePos < lineText.length() && Character.isWhitespace(lineText.charAt(firstNonWhiteSpacePos))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (!Character.isSpaceChar(lineText.charAt(firstNonWhiteSpacePos))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\thasNonSpaceChar = true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t++firstNonWhiteSpacePos;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Add whitespace at the beginning."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal int expectedNbWhiteSpaces = getWhiteSpacesOnFirstLine();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal int nbWhiteSpaces = firstNonWhiteSpacePos - realCommentStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (hasNonSpaceChar || nbWhiteSpaces != expectedNbWhiteSpaces) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tbackend.replace(realCommentStart, nbWhiteSpaces, makeWhiteSpaces(expectedNbWhiteSpaces));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Treat the end of comment"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (endCommentOffset <= lineText.length()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Comment end at the first line. Insert a newline character"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Search for the end of comment text."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint endPos = endCommentOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal int end = endPos;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\twhile ((endPos - 1) > firstNonWhiteSpacePos && Character.isWhitespace(lineText.charAt(endPos - 1))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t--endPos;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Format the comment text"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tformatLineText(lineText.substring(firstNonWhiteSpacePos, endPos), true, new SubAccessor<>(backend, firstNonWhiteSpacePos));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Do the replacement"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tbackend.replace(endPos, end - endPos, newLineString + indentationString + SPACE_CHAR);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// We don't need to treat more line"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Format the comment text"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tformatLineText(lineText.substring(firstNonWhiteSpacePos, lineText.length()), true, new SubAccessor<>(backend, firstNonWhiteSpacePos));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn false;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate <T> boolean formatMultlineCommentOtherLines(String lineText, String indentationString, String newLineString, int endCommentOffset, FormattedTextAccessor<T> backend) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Search for the comment prefix (usually \" * \""); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint realCommentStart = 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\twhile (realCommentStart < lineText.length() && Character.isWhitespace(lineText.charAt(realCommentStart))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t++realCommentStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tboolean foundStar = false;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (realCommentStart < lineText.length() && startsWith(lineText, realCommentStart, getMultilineCommentLinePrefix())) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\trealCommentStart += getMultilineCommentLinePrefix().length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfoundStar = true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\twhile (realCommentStart < lineText.length() && Character.isWhitespace(lineText.charAt(realCommentStart))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t++realCommentStart;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Compute the standard prefix."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tStringBuilder prefix = new StringBuilder(indentationString);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprefix.append(SPACE_CHAR);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprefix.append(getMultilineCommentLinePrefix());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprefix.append(makeWhiteSpaces(getWhiteSpacesOnOtherLines()));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Force replacement by the line's prefix"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint minBoundForEnd = 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (endCommentOffset > lineText.length() || foundStar || realCommentStart < endCommentOffset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tbackend.replace(0, realCommentStart, prefix.toString());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (foundStar) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tminBoundForEnd = prefix.length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Format the comment text"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (endCommentOffset <= lineText.length()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// End of comment on the current line."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint endPosition = endCommentOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal int end = endPosition;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\twhile ((endPosition - 1) >= minBoundForEnd && Character.isWhitespace(lineText.charAt(endPosition - 1))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t--endPosition;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (endPosition > 0) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t// Comment end with a text before. Insert a newline character"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tbackend.replace(endPosition, end - endPosition, newLineString + indentationString + SPACE_CHAR);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t// Replace spaces before end of comment if they exist"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tbackend.replace(endPosition, end - endPosition, indentationString + SPACE_CHAR);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// We don't need to treat more line"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn false;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate <T> void formatMultlineComment(String indentationString, String newLineString, FormattedTextAccessor<T> backend) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal String indent = Strings.emptyIfNull(indentationString);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tfinal String comment = backend.getCommentText();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t// Compute the starting offset of the text inside the comment"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint offset = comment.indexOf(getMultilineCommentStartSymbols());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tif (offset < 0) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tbackend.replace(0, 0, getMultilineCommentStartSymbols());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\toffset = 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\toffset += getMultilineCommentStartSymbols().length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Compute the ending offset of the text inside the comment"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint endOffset = comment.indexOf(getMultilineCommentEndSymbols(), offset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (endOffset < 0) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tendOffset = comment.length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tbackend.replace(endOffset, 0, getMultilineCommentEndSymbols());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t// Go through the lines"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tT currentLine = backend.getFirstLine(backend.getCommentOffset());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tboolean firstLine = true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\twhile (currentLine != null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tString lineText = backend.getLineText(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tint lineOffset = backend.getLineOffset(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tint lineLength = backend.getLineLength(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t// Clamp the line text to the comment area."); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (lineOffset < offset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tfinal int len = offset - lineOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineText = lineText.substring(len);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineOffset += len;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineLength -= len;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif ((lineOffset + lineLength) > endOffset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tfinal int len = lineOffset + lineLength - endOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineText = lineText.substring(0, lineText.length() - len);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tlineLength -= len;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (firstLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tif (formatMultlineCommentFirstLine(lineText, indent, newLineString, endOffset - lineOffset, new SubAccessor(backend, lineOffset))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\t\tbackend.applyReplacements();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\t\treturn;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (formatMultlineCommentOtherLines(lineText, indent, newLineString, endOffset - lineOffset, new SubAccessor(backend, lineOffset))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tbackend.applyReplacements();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\treturn;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfirstLine = false;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tcurrentLine = backend.getNextLine(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tbackend.applyReplacements();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLine();
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic interface FormattedTextAccessor<T> {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tT getFirstLine(int offset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tT getNextLine(T currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint getLineOffset(T currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint getLineLength(T currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tString getLineText(T line);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tString getCommentText();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint getCommentOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tint getCommentEndOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tReplacement replace(int offset, int length, String newText);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tvoid applyReplacements();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic class SubAccessor<T> implements FormattedTextAccessor<T> {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final FormattedTextAccessor<T> parent;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final int offsetInParent;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic SubAccessor(FormattedTextAccessor<T> parent, int offsetInParent) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tassert parent != null;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.parent = parent;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.offsetInParent = offsetInParent;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic T getFirstLine(int offset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.getFirstLine(offset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic T getNextLine(T currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.getNextLine(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic int getLineOffset(T currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.getLineOffset(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic int getLineLength(T currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.getLineLength(currentLine);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic String getLineText(T line) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.getLineText(line);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic String getCommentText() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.getCommentText();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic int getCommentOffset() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.getCommentOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic int getCommentEndOffset() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.getCommentEndOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic Replacement replace(int offset, int length, String newText) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.parent.replace(this.offsetInParent + offset, length, newText);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic final void applyReplacements() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthrow new UnsupportedOperationException();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic static class Line {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final int offset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final int length;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic static Line newInstance(String text, int offset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (offset < 0 || offset >= text.length()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\treturn null;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint soffset = offset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\twhile (soffset >= 0 && !isNewLine(text.charAt(soffset))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t--soffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t++soffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint eoffset = soffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\twhile (eoffset < text.length() && !isNewLine(text.charAt(eoffset))) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t++eoffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal int length = "); //$NON-NLS-1$
				it.append(Math.class);
				it.append(".max(0, eoffset - soffset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn new Line(soffset, length);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate Line(int offset, int length) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.offset = offset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.length = length;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic int getOffset() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.offset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic int getLength() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.length;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic String toString() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn \"offset: \" + getOffset() + \"; length: \" + getLength();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic static abstract class AbstractReplacementAccessor<T> implements FormattedTextAccessor<T> {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final String documentation;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate "); //$NON-NLS-1$
				it.append(SortedMap.class);
				it.append("<Integer, Replacement> replacements;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate boolean applied;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic AbstractReplacementAccessor(String documentation, "); //$NON-NLS-1$
				it.append(SortedMap.class);
				it.append("<Integer, Replacement> replacements) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.documentation = documentation;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.replacements = replacements;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprotected final void checkNotApplied() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (this.applied) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthrow new IllegalStateException(\"Changes are already applied\");"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.applied = true;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic String getCommentText() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.documentation;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprotected "); //$NON-NLS-1$
				it.append(SortedMap.class);
				it.append("<Integer, Replacement> getReplacements() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (this.replacements == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthis.replacements = new "); //$NON-NLS-1$
				it.append(TreeMap.class);
				it.append("<>();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.replacements;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic Replacement replace(int offset, int length, String newText) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tReplacement rep = getReplacements().remove(offset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (rep == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\trep = new Replacement(offset, length, newText);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\trep = new Replacement(offset, rep.getLength() + length, rep.getText() + newText);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tgetReplacements().put(offset, rep);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn rep;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprotected static void applyReplacements("); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" appendable, String text, "); //$NON-NLS-1$
				it.append(Map.class);
				it.append("<Integer, Replacement> replacements) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint offset = 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfor (final Replacement replacement : replacements.values()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tif (replacement.getOffset() < offset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tappendable.append(\"<<<Conflicting replacements>>>\");"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t} else {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tassert offset >= 0;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tassert replacement.getOffset() <= text.length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tString notReplacedString = text.substring(offset, replacement.getOffset());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tappendable.append(notReplacedString);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\toffset += notReplacedString.length();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\tappendable.append(replacement.getText());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t\toffset += replacement.getLength();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (offset < text.length()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tString notReplacedString = text.substring(offset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tappendable.append(notReplacedString);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic static abstract class AbstractDebuggingAccessor<T> extends AbstractReplacementAccessor<T> {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate String buffer;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic AbstractDebuggingAccessor(String text, "); //$NON-NLS-1$
				it.append(SortedMap.class);
				it.append("<Integer, Replacement> replacements) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tsuper(text, replacements);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate String computeBuffer() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t"); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" appendable = new "); //$NON-NLS-1$
				it.append(FakeTreeAppendable.class);
				it.append("();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tapplyReplacements(appendable, getCommentText(), getReplacements());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn appendable.getContent();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic String toString() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (this.buffer == null) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthis.buffer = computeBuffer();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.buffer;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic Replacement replace(int offset, int length, String newText) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal Replacement rep = super.replace(offset, length, newText);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.buffer = computeBuffer();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn rep;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic static class RegionAccessor extends AbstractReplacementAccessor<"); //$NON-NLS-1$
				it.append(ILineRegion.class);
				it.append("> {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final "); //$NON-NLS-1$
				it.append(ITextReplacerContext.class);
				it.append(" context;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final "); //$NON-NLS-1$
				it.append(ITextRegionAccess.class);
				it.append(" access;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final "); //$NON-NLS-1$
				it.append(IComment.class);
				it.append(" comment;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic RegionAccessor("); //$NON-NLS-1$
				it.append(ITextReplacerContext.class);
				it.append(" context, "); //$NON-NLS-1$
				it.append(IComment.class);
				it.append(" comment) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tsuper(comment.getText(), null);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.context = context;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.comment = comment;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.access = comment.getTextRegionAccess();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic String getCommentText() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.comment.getText();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic String getLineText("); //$NON-NLS-1$
				it.append(ILineRegion.class);
				it.append(" line) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t"); //$NON-NLS-1$
				it.append(ITextSegment.class);
				it.append(" segment = this.access.regionForOffset(line.getOffset(), line.getLength());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn segment.getText();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic int getCommentOffset() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.comment.getOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic int getCommentEndOffset() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.comment.getEndOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic "); //$NON-NLS-1$
				it.append(ILineRegion.class);
				it.append(" getFirstLine(int offset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.access.regionForLineAtOffset(offset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic "); //$NON-NLS-1$
				it.append(ILineRegion.class);
				it.append(" getNextLine("); //$NON-NLS-1$
				it.append(ILineRegion.class);
				it.append(" currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn currentLine.getNextLine();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic int getLineOffset("); //$NON-NLS-1$
				it.append(ILineRegion.class);
				it.append(" currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn currentLine.getOffset() - getCommentOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic int getLineLength("); //$NON-NLS-1$
				it.append(ILineRegion.class);
				it.append(" currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn currentLine.getLength();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic void applyReplacements() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tcheckNotApplied();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfor (Replacement replacement : getReplacements().values()) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\t"); //$NON-NLS-1$
				it.append(ITextSegment.class);
				it.append(" target = this.access.regionForOffset(replacement.getOffset() + getCommentOffset(), replacement.getLength());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\tthis.context.addReplacement(target.replaceWith(replacement.getText()));"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate static class AppendableAccessor extends AbstractReplacementAccessor<Line> {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final "); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" target;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final int commentOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final int commentEndOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic AppendableAccessor("); //$NON-NLS-1$
				it.append(IAppendable.class);
				it.append(" target, String documentation, "); //$NON-NLS-1$
				it.append(SortedMap.class);
				it.append("<Integer, Replacement> replacements, int commentOffset, int commentEndOffset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tsuper(documentation, replacements);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.target = target;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.commentOffset = commentOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.commentEndOffset = commentEndOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic Line getFirstLine(int offset) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn Line.newInstance(getCommentText(), offset);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic Line getNextLine(Line currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tint index = getCommentText().indexOf(NL_CHAR, currentLine.getOffset());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tif (index < 0) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t\treturn null;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn Line.newInstance(getCommentText(), index + 1);"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic int getLineOffset(Line currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn currentLine.getOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic int getLineLength(Line currentLine) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn currentLine.getLength();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic String getLineText(Line line) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tfinal int offset = line.getOffset();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn getCommentText().substring(offset, offset + line.getLength());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic int getCommentOffset() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.commentOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic int getCommentEndOffset() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.commentEndOffset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\tpublic void applyReplacements() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tcheckNotApplied();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tapplyReplacements(this.target, getCommentText(), getReplacements());"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic static class Replacement {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final int offset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final int length;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tprivate final String text;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic Replacement(int offset, int length, String text) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.offset = offset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.length = length;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\tthis.text = text;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic int getOffset() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.offset;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic int getLength() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.length;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic String getText() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn this.text;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tpublic String toString() {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t\treturn \"offset: \" + getOffset() + \"; length: \" + getLength() + \"; new text: \" + getText();"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}

		};
		JavaFileAccess createJavaFile = getFileAccessFactory().createJavaFile(formatter, content);
		createJavaFile.writeTo(getSrcGen());
	}
891136
public void add(DOCUMENT doc) {
      if (doc != null) {
         documents.add(doc);
         int id = documents.size() - 1;
         for (KEY key : documentMapper.apply(doc)) {
            index.put(key, id);
         }
      }
   }
393796
protected void createExtendedMetaDataAnnotations() {
		String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";		
		addAnnotation
		  (documentRootEClass, 
		   source, 
		   new String[] {
			 "name", "",
			 "kind", "mixed"
		   });		
		addAnnotation
		  (getDocumentRoot_Mixed(), 
		   source, 
		   new String[] {
			 "kind", "elementWildcard",
			 "name", ":mixed"
		   });		
		addAnnotation
		  (getDocumentRoot_XMLNSPrefixMap(), 
		   source, 
		   new String[] {
			 "kind", "attribute",
			 "name", "xmlns:prefix"
		   });		
		addAnnotation
		  (getDocumentRoot_XSISchemaLocation(), 
		   source, 
		   new String[] {
			 "kind", "attribute",
			 "name", "xsi:schemaLocation"
		   });		
		addAnnotation
		  (getDocumentRoot_BackgroundColor(), 
		   source, 
		   new String[] {
			 "kind", "attribute",
			 "name", "background-color",
			 "namespace", "##targetNamespace"
		   });		
		addAnnotation
		  (getDocumentRoot_BorderColor(), 
		   source, 
		   new String[] {
			 "kind", "attribute",
			 "name", "border-color",
			 "namespace", "##targetNamespace"
		   });		
		addAnnotation
		  (getDocumentRoot_Color(), 
		   source, 
		   new String[] {
			 "kind", "attribute",
			 "name", "color",
			 "namespace", "##targetNamespace"
		   });		
		addAnnotation
		  (hexColorEDataType, 
		   source, 
		   new String[] {
			 "name", "HexColor",
			 "baseType", "http://www.eclipse.org/emf/2003/XMLType#string",
			 "pattern", "#[0-9a-fA-F]{6}"
		   });
	}
671418
protected void generateHelpFile() throws DocFileIOException {
        String title = configuration.getText("doclet.Window_Help_title");
        HtmlTree body = getBody(true, getWindowTitle(title));
        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
                ? HtmlTree.HEADER()
                : body;
        addTop(htmlTree);
        addNavLinks(true, htmlTree);
        if (configuration.allowTag(HtmlTag.HEADER)) {
            body.addContent(htmlTree);
        }
        addHelpFileContents(body);
        if (configuration.allowTag(HtmlTag.FOOTER)) {
            htmlTree = HtmlTree.FOOTER();
        }
        addNavLinks(false, htmlTree);
        addBottom(htmlTree);
        if (configuration.allowTag(HtmlTag.FOOTER)) {
            body.addContent(htmlTree);
        }
        printHtmlDocument(null, true, body);
    }
212021
@Override
    public synchronized void insertUpdate(DocumentEvent e) {
        int len = e.getLength();
        int off = e.getOffset();
        if (outputMark > off) {
            outputMark += len;
        }
    }
439158
public void add(PdfContentByte other) {
        if (other.writer != null && writer != other.writer)
            throw new RuntimeException("Inconsistent writers. Are you mixing two documents?");
        content.append(other.content);
    }
235650
protected function _add_page_text() {
		//Helpers::dompdf_debug("trace", "()");

		if (!count($this->_page_text)) {
			return;
		}

		$page_number = 1;
		$eval = null;

		foreach ($this->_pages as $pid) {
			//$this->reopen_object($pid);

			$this->_pdf->setPage($pid);
			foreach ($this->_page_text as $pt) {
				extract($pt);

				switch($_t) {

					case "text":
						$text = str_replace( array ("{PAGE_NUM}", "{PAGE_COUNT}"),
						array ($page_number, $this->_pdf->getNumPages()), $text);
						$this->text($x, $y, $text, $font, $size, $color, $adjust, 0, $angle); //***
						break;

					case "script":
						if (!$eval) {
							$eval = new PHP_Evaluator($this);
						}
						$eval->evaluate($code, array ('PAGE_NUM'=>$page_number, 'PAGE_COUNT'=>$this->_pdf->getNumPages()));
						break;
				}
			}

			//$this->close_object();
			$page_number++;
		}
	}
296544
protected void writePdf(final MBasicTable table, final OutputStream out) throws IOException {
		try {
			// step 1: creation of a document-object
			final Rectangle pageSize = landscape ? PageSize.A4.rotate() : PageSize.A4;
			final Document document = new Document(pageSize, 50, 50, 50, 50);
			// step 2: we create a writer that listens to the document and directs a PDF-stream to out
			createWriter(table, document, out);

			// we add some meta information to the document, and we open it
			document.addAuthor(System.getProperty("user.name"));
			document.addCreator("JavaMelody");
			final String title = buildTitle(table);
			if (title != null) {
				document.addTitle(title);
			}
			document.open();

			// ouvre la boîte de dialogue Imprimer de Adobe Reader
			// if (writer instanceof PdfWriter) {
			// ((PdfWriter) writer).addJavaScript("this.print(true);", false);
			// }

			// table
			final Table datatable = new Table(table.getColumnCount());
			datatable.setCellsFitPage(true);
			datatable.setPadding(4);
			datatable.setSpacing(0);

			// headers
			renderHeaders(table, datatable);

			// data rows
			renderList(table, datatable);

			document.add(datatable);

			// we close the document
			document.close();
		} catch (final DocumentException e) {
			// on ne peut déclarer d'exception autre que IOException en throws
			throw new IOException(e);
		}
	}
5275
protected function addDocumentation()
    {
        $docDirectory = $this->getDocumentationDirectory();

        // If there's a documentation directory
        if (is_dir($docDirectory)) {
            $validIndexDocuments = [
                'index.md',
                'readme.md',
                strtolower($this->basename.'.md')
            ];
            $indexDocument       = null;
            $documents           = [];

            // Run through all documentation files
            foreach (scandir($docDirectory) as $document) {
                if (!is_file($docDirectory.DIRECTORY_SEPARATOR.$document)) {
                    continue;
                }

                // If there's a valid documentation index file
                if (in_array(strtolower($document), $validIndexDocuments)) {
                    if ($indexDocument === null) {
                        $indexDocument = $docDirectory.DIRECTORY_SEPARATOR.$document;
                    }
                    continue;
                }

                $documents[] = $docDirectory.DIRECTORY_SEPARATOR.$document;
            }

            // If there's an index document
            if ($indexDocument !== null) {
                $this->addNotice(file_get_contents($indexDocument));

                return;
            }

            // If there are remaining documents: Auto-create a simple listing
            if (count($documents)) {
                $listing = [];

                // Run through all documents
                foreach ($documents as $document) {
                    $extension = strtolower(pathinfo($document, PATHINFO_EXTENSION));
                    $listing[] = '* '.(in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'svg']) ? '!' : '').
                                 '['.pathinfo($document, PATHINFO_FILENAME).']('.basename($document).')';
                }

                $this->addNotice(implode(PHP_EOL, $listing));
            }
        }
    }
884717
private static void addDocumentPropertyDefinitions(DocumentTypeDefinitionImpl type) {

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.IS_IMMUTABLE,
                "Is Immutable",
                "Is Immutable",
                PropertyType.BOOLEAN,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.IS_LATEST_VERSION,
                "Is Latest Version",
                "Is Latest Version",
                PropertyType.BOOLEAN,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.IS_MAJOR_VERSION,
                "Is Major Version",
                "Is Major Version",
                PropertyType.BOOLEAN,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.IS_LATEST_MAJOR_VERSION,
                "Is Latest Major Version",
                "Is Latest Major Version",
                PropertyType.BOOLEAN,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.VERSION_LABEL,
                "Version Label",
                "Version Label",
                PropertyType.STRING,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.VERSION_SERIES_ID,
                "Version Series Id",
                "Version Series Id",
                PropertyType.ID,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.IS_VERSION_SERIES_CHECKED_OUT,
                "Is Verison Series Checked Out",
                "Is Verison Series Checked Out",
                PropertyType.BOOLEAN,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.VERSION_SERIES_CHECKED_OUT_ID,
                "Version Series Checked Out Id",
                "Version Series Checked Out Id",
                PropertyType.ID,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.VERSION_SERIES_CHECKED_OUT_BY,
                "Version Series Checked Out By",
                "Version Series Checked Out By",
                PropertyType.STRING,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.CHECKIN_COMMENT,
                "Checkin Comment",
                "Checkin Comment",
                PropertyType.STRING,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.CONTENT_STREAM_LENGTH,
                "Content Stream Length",
                "Content Stream Length",
                PropertyType.INTEGER,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.CONTENT_STREAM_MIME_TYPE,
                "MIME Type",
                "MIME Type",
                PropertyType.STRING,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.CONTENT_STREAM_FILE_NAME,
                "Filename",
                "Filename",
                PropertyType.STRING,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.CONTENT_STREAM_ID,
                "Content Stream Id",
                "Content Stream Id",
                PropertyType.ID,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));
    }