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; } }
private boolean isMethod(DrawContext ctx) { int idEndOffset = ctx.getTokenOffset() + ctx.getTokenLength(); if (idEndOffset > resolvedEndOffset) { // beyond the resolved area resolvedEndOffset = idEndOffset; // will resolve now int endOffset = ctx.getEndOffset(); int bufferStartOffset = ctx.getBufferStartOffset(); char[] buffer = ctx.getBuffer(); int nwOffset = Analyzer.findFirstNonWhite(buffer, idEndOffset - bufferStartOffset, endOffset - idEndOffset); if (nwOffset >= 0) { // found non-white resolvedValue = (buffer[nwOffset] == '('); } else { // must resolve after buffer end try { resolvedValue = (ctx.getEditorUI().getDocument().find(nwFinder, endOffset, -1) >= 0) && (nwFinder.getFoundChar() == '('); } catch (BadLocationException e) { resolvedValue = false; } } } return resolvedValue; }
if (idEndOffset > resolvedEndOffset) { // beyond the resolved area int endOffset = ctx.getEndOffset(); int bufferStartOffset = ctx.getBufferStartOffset(); char[] buffer = ctx.getBuffer();