public void init(DrawContext ctx) { if (enabled) { try { BaseDocument doc = ctx.getEditorUI().getDocument(); blocks = FindSupport.getFindSupport().getBlocks(blocks, doc, ctx.getStartOffset(), ctx.getEndOffset()); } catch (BadLocationException e) { blocks = new int[] { -1, -1 }; } coloring = null; // reset so it will be re-read curInd = 0; } }
public void init(DrawContext ctx) { if (enabled) { try { BaseDocument doc = ctx.getEditorUI().getDocument(); blocks = FindSupport.getFindSupport().getBlocks(blocks, doc, ctx.getStartOffset(), ctx.getEndOffset()); } catch (BadLocationException e) { blocks = new int[] { -1, -1 }; } coloring = null; // reset so it will be re-read curInd = 0; } }
public void init(final DrawContext ctx) { coloring = null; tokenEndOffset = 0; int startOffset = ctx.getStartOffset(); TokenHierarchy hi = tokenHierarchy(); active = (hi != null); if (active) { pastSequences = new Stack<TokenSequence>(); if (hi.isActive()) { tokenSequence = hi.tokenSequence(); tokenSequence.move(startOffset); if (tokenSequence.moveNext()) { updateTokenEndOffsetAndColoring(startOffset); } else { // no tokens active = false; } } else { active = false; } } }