Java Code Examples for javax.swing.text.ChangedCharSetException

The following examples show how to use javax.swing.text.ChangedCharSetException. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: SwingBox   Source File: BrowserPane.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
void read(InputStream in, Document doc) throws IOException
{
    EditorKit kit = getEditorKit();

    try
    {
        kit.read(in, doc, 0);

    } catch (ChangedCharSetException ccse)
    {
        // ignored, may be in the future will be processed
        throw ccse;
    } catch (BadLocationException ble)
    {
        throw new IOException(ble);
    }

}
 
Example 2
Source Project: jdk1.8-source-analysis   Source File: Parser.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 3
Source Project: dragonwell8_jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 4
Source Project: dragonwell8_jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 5
Source Project: TencentKona-8   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 6
Source Project: TencentKona-8   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 7
Source Project: jdk8u60   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 8
Source Project: jdk8u60   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 9
Source Project: jdk8u-dev-jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 10
Source Project: JDKSourceCode1.8   Source File: Parser.java    License: MIT License 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 11
Source Project: JDKSourceCode1.8   Source File: Parser.java    License: MIT License 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 12
Source Project: openjdk-jdk8u   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 13
Source Project: jdk8u-dev-jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 14
Source Project: openjdk-jdk8u-backup   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 15
Source Project: openjdk-jdk8u-backup   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 16
Source Project: Bytecoder   Source File: Parser.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 17
Source Project: Bytecoder   Source File: Parser.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 18
Source Project: jdk8u-jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 19
Source Project: openjdk-jdk9   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 20
Source Project: jdk8u-jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 21
Source Project: jdk8u-jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 22
Source Project: jdk8u-jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 23
Source Project: Java8CN   Source File: Parser.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 24
Source Project: Java8CN   Source File: Parser.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 25
Source Project: hottub   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 26
Source Project: hottub   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 27
Source Project: openjdk-8-source   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 28
Source Project: openjdk-8-source   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
 
Example 29
Source Project: openjdk-8   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
 
Example 30
Source Project: jdk8u_jdk   Source File: Parser.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}