TokenizedDocument
from a SyntaxDocument by the SyntaxDocument.tokenize() method.TokenizedDocument
.
TokenizedDocument
, and iterate through Tokens of the Token.KEYWORD1 type, before a position:JEditor editor = new JEditor(); editor.setText(url); editor.setTokenMarker(new XMLTokenMarker()); SyntaxDocument syntaxdoc = editor.getSyntaxDocument(); TokenizedDocument tokDoc = syntaxdoc.tokenize(); Iterator<PosToken> it = tokDoc.iterateBefore(<the index>, Token.KEYWORD1);
Copyright 2016-2019 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence