@Override public HighlightsSequence getHighlights(final int startOffset, final int endOffset) { if (headersBag != null) { return headersBag.getHighlights(startOffset, endOffset); } else { return HighlightsSequence.EMPTY; } }
public void run() { if (isCanceled()) { return; } OffsetsBag localHighlightsBag = new OffsetsBag(_document); for (int[] current : localHighlights) { localHighlightsBag.addHighlight(current[0], current[1], ERROR); } paneBag.setHighlights(localHighlightsBag); } });
public synchronized HighlightsSequence getHighlights (int startOffset, int endOffset) { //S ystem.out.println("SemanticHighlightsLayer.getHighlights " + startOffset + " : " + endOffset); if (offsetsBag == null) { offsetsBag = new OffsetsBag (document); refresh (); } return offsetsBag.getHighlights (startOffset, endOffset); }
static synchronized OffsetsBag getHighlightsBag(Document doc) { OffsetsBag bag = (OffsetsBag) doc.getProperty(DebuggerAnnotation.class); if (bag == null) { doc.putProperty(DebuggerAnnotation.class, bag = new OffsetsBag(doc, true)); } return bag; }
protected void addAnnotation(Annotation anno) { synchronized(DebuggerAnnotation.class) { OffsetsBag bag = getHighlightsBag(doc); bag.addHighlight(start, end, attrs); } }
protected void removeAnnotation(Annotation anno) { synchronized(DebuggerAnnotation.class) { OffsetsBag bag = getHighlightsBag(doc); bag.removeHighlights(start, end, true); } }
public static PositionsBag getHighlightsBag(Document doc) { PositionsBag bag = (PositionsBag) doc.getProperty(POSITION_BAG); if (bag == null) { doc.putProperty(POSITION_BAG, bag = new PositionsBag(doc)); } return bag; }
@Override public void insertUpdate(DocumentEvent e) { bagFin.removeHighlights(e.getOffset(), e.getOffset()); }
static synchronized OffsetsBag getHighlightsBag(Document doc) { OffsetsBag bag = (OffsetsBag) doc.getProperty(DebuggerAnnotation.class); if (bag == null) { doc.putProperty(DebuggerAnnotation.class, bag = new OffsetsBag(doc, true)); } return bag; }
@Override protected void addAnnotation(Annotation anno) { synchronized(DebuggerAnnotation.class) { if (doc != null) { OffsetsBag bag = getHighlightsBag(doc); bag.addHighlight(start, end, attrs); } } }
@Override protected void removeAnnotation(Annotation anno) { synchronized(DebuggerAnnotation.class) { if (doc != null) { OffsetsBag bag = getHighlightsBag(doc); bag.removeHighlights(start, end, false); } } }
@Override public HighlightsSequence getHighlights(int startOffset, int endOffset) { if (blocksBag != null) { return blocksBag.getHighlights(startOffset, endOffset); } else { return HighlightsSequence.EMPTY; } }
public static PositionsBag getHighlightsBag(Document doc) { if (doc == null) { return null; } PositionsBag bag = (PositionsBag) doc.getProperty(SemanticHighlighter.class); if (bag == null) { doc.putProperty(SemanticHighlighter.class, bag = new PositionsBag(doc)); } return bag; }
@Override public void removeUpdate(DocumentEvent e) { bagFin.removeHighlights(e.getOffset(), e.getOffset()); }
static synchronized OffsetsBag getHighlightsBag(Document doc) { OffsetsBag bag = (OffsetsBag) doc.getProperty(DebuggerAnnotation.class); if (bag == null) { doc.putProperty(DebuggerAnnotation.class, bag = new OffsetsBag(doc, true)); } return bag; }
@Override protected void addAnnotation(Annotation anno) { synchronized(DebuggerAnnotation.class) { if (doc != null) { OffsetsBag bag = getHighlightsBag(doc); bag.addHighlight(start, end, attrs); } } }
@Override protected void removeAnnotation(Annotation anno) { synchronized(DebuggerAnnotation.class) { if (doc != null) { OffsetsBag bag = getHighlightsBag(doc); bag.removeHighlights(start, end, false); } } }
public static synchronized OffsetsBag getBag(JTextComponent component) { OffsetsBag bag = (OffsetsBag) component.getClientProperty(SpellcheckerHighlightLayerFactory.class); Spellchecker.register (component); if (bag == null) { component.putClientProperty(SpellcheckerHighlightLayerFactory.class, bag = new OffsetsBag(component.getDocument())); } return bag; }
public void insertUpdate(DocumentEvent e) { bagFin.removeHighlights(e.getOffset(), e.getOffset(), false); } public void removeUpdate(DocumentEvent e) {
public void removeUpdate(DocumentEvent e) { bagFin.removeHighlights(e.getOffset(), e.getOffset(), false); } public void changedUpdate(DocumentEvent e) {}