Package org.netbeans.api.lexer

Examples of org.netbeans.api.lexer.TokenSequence.moveNext()


                    newIdentMap.put(context.lineStartOffset(ts.offset()), newIndent);
                } catch (BadLocationException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
        } while (ts.moveNext());
        for (Integer line : newIdentMap.keySet()) {
            //System.out.println(line + " : " + newIdentMap.get(line));
            setIndent(context, line, newIdentMap.get(line));
        }
        //System.out.println("--------------------");
View Full Code Here


     * Finds the root element of the xml document.
     */
    public static String getDocRoot(Document document) {
        TokenHierarchy th = TokenHierarchy.get(document);
        TokenSequence ts = th.tokenSequence();
        while (ts.moveNext()) {
            Token nextToken = ts.token();
            if (nextToken.id() == XMLTokenId.TAG) {
                String tagName = nextToken.text().toString();
                if (tagName.startsWith("<")) {
                    return tagName.substring(1, tagName.length());
View Full Code Here

        StringBuilder foldText = new StringBuilder();

        TokenSequence tokens = TokenHierarchy.get(doc).tokenSequence();
        tokens.moveStart();

        while(tokens.moveNext()) {
            String tk = tokens.token().id().name();
            String tkn = tokens.token().toString();
            foldText.append(tkn);
           
            if(tk.equals(LIST_START)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.