Search in sources :

Example 16 with Tag

use of org.omegat.util.TagUtil.Tag in project omegat by omegat-org.

the class TagIssue method insertText.

private void insertText(StyledDocument doc, String text, Map<Tag, TagError> errors) throws BadLocationException {
    doc.insertString(0, text, null);
    for (Map.Entry<Tag, TagError> e : errors.entrySet()) {
        Tag tag = e.getKey();
        doc.setCharacterAttributes(tag.pos, tag.tag.length(), styleForError(e.getValue()), false);
    }
}
Also used : TagError(org.omegat.core.tagvalidation.ErrorReport.TagError) Tag(org.omegat.util.TagUtil.Tag) Map(java.util.Map)

Aggregations

Tag (org.omegat.util.TagUtil.Tag)16 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)4 Map (java.util.Map)3 Matcher (java.util.regex.Matcher)3 Pattern (java.util.regex.Pattern)3 HashMap (java.util.HashMap)2 TagError (org.omegat.core.tagvalidation.ErrorReport.TagError)2 List (java.util.List)1 Stack (java.util.Stack)1 ProtectedPart (org.omegat.core.data.ProtectedPart)1 SourceTextEntry (org.omegat.core.data.SourceTextEntry)1