Example usage for org.eclipse.jdt.core.dom TagElement TAG_LINKPLAIN

List of usage examples for org.eclipse.jdt.core.dom TagElement TAG_LINKPLAIN

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom TagElement TAG_LINKPLAIN.

Prototype

String TAG_LINKPLAIN

To view the source code for org.eclipse.jdt.core.dom TagElement TAG_LINKPLAIN.

Click Source Link

Document

Standard inline doc tag name (value ).

Usage

From source file:at.bestsolution.fxide.jdt.text.javadoc.JavaDoc2HTMLTextReader.java

License:Open Source License

private String printBlockTag(String tag, String tagContent) {

    if (TagElement.TAG_LINK.equals(tag) || TagElement.TAG_LINKPLAIN.equals(tag)) {

        char[] contentChars = tagContent.toCharArray();
        boolean inParentheses = false;
        int labelStart = 0;

        for (int i = 0; i < contentChars.length; i++) {
            char nextChar = contentChars[i];

            // tagContent always has a leading space
            if (i == 0 && Character.isWhitespace(nextChar)) {
                labelStart = 1;//from ww  w . jav a 2s  . c  o  m
                continue;
            }

            if (nextChar == '(') {
                inParentheses = true;
                continue;
            }

            if (nextChar == ')') {
                inParentheses = false;
                continue;
            }

            // Stop at first whitespace that is not in parentheses
            if (!inParentheses && Character.isWhitespace(nextChar)) {
                labelStart = i + 1;
                break;
            }
        }
        if (TagElement.TAG_LINK.equals(tag))
            return "<code>" + substituteQualification(tagContent.substring(labelStart)) + "</code>"; //$NON-NLS-1$//$NON-NLS-2$
        else
            return substituteQualification(tagContent.substring(labelStart));

    } else if (TagElement.TAG_LITERAL.equals(tag)) {
        return printLiteral(tagContent);

    } else if (TagElement.TAG_CODE.equals(tag)) {
        return "<code>" + printLiteral(tagContent) + "</code>"; //$NON-NLS-1$//$NON-NLS-2$
    }

    // If something went wrong at least replace the {} with the content
    return substituteQualification(tagContent);
}

From source file:at.bestsolution.fxide.jdt.text.javadoc.JavadocContentAccess2.java

License:Open Source License

private void handleInlineTagElement(TagElement node) {
    String name = node.getTagName();

    if (TagElement.TAG_VALUE.equals(name) && handleValueTag(node))
        return;/* w  w  w.  ja v  a  2  s .c om*/

    boolean isLink = TagElement.TAG_LINK.equals(name);
    boolean isLinkplain = TagElement.TAG_LINKPLAIN.equals(name);
    boolean isCode = TagElement.TAG_CODE.equals(name);
    boolean isLiteral = TagElement.TAG_LITERAL.equals(name);

    if (isLiteral || isCode)
        fLiteralContent++;
    if (isLink || isCode)
        fBuf.append("<code>"); //$NON-NLS-1$

    if (isLink || isLinkplain)
        handleLink(node.fragments());
    else if (isCode || isLiteral)
        handleContentElements(node.fragments(), true);
    else if (handleInheritDoc(node)) {
        // handled
    } else if (handleDocRoot(node)) {
        // handled
    } else {
        //print uninterpreted source {@tagname ...} for unknown tags
        int start = node.getStartPosition();
        String text = fSource.substring(start, start + node.getLength());
        fBuf.append(removeDocLineIntros(text));
    }

    if (isLink || isCode)
        fBuf.append("</code>"); //$NON-NLS-1$
    if (isLiteral || isCode)
        fLiteralContent--;

}

From source file:org.eclipse.xtext.xbase.ui.hover.XbaseHoverDocumentationProvider.java

License:Open Source License

protected void handleInlineTagElement(TagElement node) {
    String name = node.getTagName();
    if (TagElement.TAG_VALUE.equals(name) && handleValueTag(node))
        return;/* w w  w. ja v a  2  s  .  c o m*/
    boolean isLink = TagElement.TAG_LINK.equals(name);
    boolean isLinkplain = TagElement.TAG_LINKPLAIN.equals(name);
    boolean isCode = TagElement.TAG_CODE.equals(name);
    boolean isLiteral = TagElement.TAG_LITERAL.equals(name);
    if (isLiteral || isCode)
        fLiteralContent++;
    if (isLink || isCode)
        buffer.append("<code>"); //$NON-NLS-1$
    if (isLink || isLinkplain)
        handleLink(node.fragments());
    else if (isCode || isLiteral) {
        @SuppressWarnings("unchecked")
        List<ASTNode> fragments = node.fragments();
        handleContentElements(fragments, true);
    } else if (handleInheritDoc(node)) {
        // handled
    } else if (handleDocRoot(node)) {
        // handled
    } else {
        //print uninterpreted source {@tagname ...} for unknown tags
        int start = node.getStartPosition();
        String text = rawJavaDoc.substring(start, start + node.getLength());
        buffer.append(removeDocLineIntros(text));
    }
    if (isLink || isCode)
        buffer.append("</code>"); //$NON-NLS-1$
    if (isLiteral || isCode)
        fLiteralContent--;

}

From source file:org.jboss.tools.vscode.javadoc.internal.JavaDoc2MarkdownTextReader.java

License:Open Source License

private String printBlockTag(String tag, String tagContent) {

    if (TagElement.TAG_LINK.equals(tag) || TagElement.TAG_LINKPLAIN.equals(tag)) {

        char[] contentChars = tagContent.toCharArray();
        boolean inParentheses = false;
        int labelStart = 0;

        for (int i = 0; i < contentChars.length; i++) {
            char nextChar = contentChars[i];

            // tagContent always has a leading space
            if (i == 0 && Character.isWhitespace(nextChar)) {
                labelStart = 1;/*  www  .j  a  va2s . c om*/
                continue;
            }

            if (nextChar == '(') {
                inParentheses = true;
                continue;
            }

            if (nextChar == ')') {
                inParentheses = false;
                continue;
            }

            // Stop at first whitespace that is not in parentheses
            if (!inParentheses && Character.isWhitespace(nextChar)) {
                labelStart = i + 1;
                break;
            }
        }
        if (TagElement.TAG_LINK.equals(tag))
            return "`" + substituteQualification(tagContent.substring(labelStart)) + "`"; //$NON-NLS-1$//$NON-NLS-2$
        else
            return substituteQualification(tagContent.substring(labelStart));

    } else if (TagElement.TAG_LITERAL.equals(tag)) {
        return printLiteral(tagContent);

    } else if (TagElement.TAG_CODE.equals(tag)) {
        return "`" + printLiteral(tagContent) + "`"; //$NON-NLS-1$//$NON-NLS-2$
    }

    // If something went wrong at least replace the {} with the content
    return substituteQualification(tagContent);
}