public void highlightChanged(HighlightsChangeEvent event) { fireHighlightsChange(event.getStartOffset(), event.getEndOffset()); } });
public HighlightsLayer[] createLayers(Context context) { return new HighlightsLayer[]{ HighlightsLayer.create( "rhtml-embedded-ruby-scriplets-highlighting-layer", //NOI18N ZOrder.BOTTOM_RACK.forPosition(100), true, new EmbeddedSectionsHighlighting(context.getDocument()) )}; } } // End of Factory class
public HighlightsLayer[] createLayers(Context ctx) { OffsetsBag bag = getBag(ctx.getComponent()); return new HighlightsLayer[] { HighlightsLayer.create(SpellcheckerHighlightLayerFactory.class.getName(), ZOrder.CARET_RACK.forPosition(30), true, bag), }; }
public HighlightsLayer[] createLayers(Context context) { return new HighlightsLayer[] { HighlightsLayer.create(DebuggerAnnotation.class.getName(), ZOrder.DEFAULT_RACK, false, DebuggerAnnotation.getHighlightsBag(context.getDocument())) }; }
private void update(BaseDocument doc, final Interrupter interrupter) { boolean macroExpansionView = (doc.getProperty(CsmMacroExpansion.MACRO_EXPANSION_VIEW_DOCUMENT) != null); PositionsBag newBag = new PositionsBag(doc); newBag.clear(); final CsmFile csmFile = CsmUtilities.getCsmFile(doc, false, false); long start = System.currentTimeMillis(); PositionsBag tempBag = new PositionsBag(doc); tempBag.addAllHighlights(newBag); HighlightsSequence seq = newBag.getHighlights(0, Integer.MAX_VALUE); Set<AttributeSet> set = new HashSet<AttributeSet>(); while (seq.moveNext()) { set.add(seq.getAttributes()); seq = old.getHighlights(0, Integer.MAX_VALUE); while (seq.moveNext()) { if (!set.contains(seq.getAttributes())) { int startOffset = getDocumentOffset(doc, seq.getStartOffset()); int endOffset = getDocumentOffset(doc, seq.getEndOffset()); if (startOffset < doc.getLength() && endOffset > 0) { addHighlightsToBag(tempBag, startOffset, endOffset, seq.getAttributes(), "cached"); //NOI18N getHighlightsBag(doc).setHighlights(tempBag); } else { getHighlightsBag(doc).setHighlights(newBag); getHighlightsBag(doc).setHighlights(newBag);
HighlightsSequence hs = getHighlightsBag(doc).getHighlights(0, doc.getLength() - 1); while (hs.moveNext()) { if (lastPosition >= hs.getStartOffset() && lastPosition <= hs.getEndOffset()) { final PositionsBag obag = new PositionsBag(doc); obag.clear(); final AttributeSet attrs = defaultColors.get(mimeType); if (attrs == null) { getHighlightsBag(doc).setHighlights(obag); OccurrencesMarkProvider.get(doc).setOccurrences( OccurrencesMarkProvider.createMarks(doc, out, ES_COLOR, NbBundle.getMessage(MarkOccurrencesHighlighter.class, "LBL_ES_TOOLTIP")));
@SuppressWarnings("empty-statement") private static int findOccurrencePosition(boolean directionForward, Document doc, int curPos) { OffsetsBag bag = MarkOccurrencesHighlighter.getHighlightsBag(doc); HighlightsSequence hs = bag.getHighlights(0, doc.getLength()); if (hs.moveNext()) { if (directionForward) { int firstStart = hs.getStartOffset(), firstEnd = hs.getEndOffset(); while (hs.getStartOffset() <= curPos && hs.moveNext()); if (hs.getStartOffset() > curPos) { return hs.getStartOffset(); } else if (!(firstEnd >= curPos && firstStart <= curPos)) { int current = hs.getStartOffset(), last; boolean stuck = false; do { last = current; current = hs.getStartOffset(); } while (hs.getEndOffset() < curPos && (stuck = hs.moveNext())); while (hs.moveNext()); if (!(hs.getEndOffset() >= curPos && hs.getStartOffset() <= curPos)) { return hs.getStartOffset();
@SuppressWarnings("empty-statement") private static int findOccurrencePosition(boolean directionForward, Document doc, int curPos) { PositionsBag bag = MarkOccurrencesHighlighter.getHighlightsBag(doc); HighlightsSequence hs = bag.getHighlights(0, doc.getLength()); if (hs.moveNext()) { if (directionForward) { int firstStart = hs.getStartOffset(), firstEnd = hs.getEndOffset(); while (hs.getStartOffset() <= curPos && hs.moveNext()); if (hs.getStartOffset() > curPos) { return hs.getStartOffset(); } else if (!(firstEnd >= curPos && firstStart <= curPos)) { int current = hs.getStartOffset(), last; boolean stuck = false; do { last = current; current = hs.getStartOffset(); } while (hs.getEndOffset() < curPos && (stuck = hs.moveNext())); while (hs.moveNext()); if (!(hs.getEndOffset() >= curPos && hs.getStartOffset() <= curPos)) { return hs.getStartOffset();
public HighlightsLayer[] createLayers(Context context) { return new HighlightsLayer[]{ HighlightsLayer.create(PROP_HIGLIGHT_HEADER_LAYER, ZOrder.SYNTAX_RACK.forPosition(120), true, new HeadersHighlighting(context.getDocument())), HighlightsLayer.create(PROP_HIGLIGHT_BLOCKS_LAYER, ZOrder.BOTTOM_RACK.forPosition(110), true, new BlocksHighlighting(context.getDocument())) }; }
@Override public HighlightsLayer[] createLayers(Context context) { return new HighlightsLayer[] { HighlightsLayer.create(DebuggerAnnotation.class.getName(), ZOrder.TOP_RACK, true, DebuggerAnnotation.getHighlightsBag(context.getDocument())) }; }
public void highlightChanged(HighlightsChangeEvent event) { fireHighlightsChange(event.getStartOffset(), event.getEndOffset()); } });
@Override public HighlightsLayer[] createLayers(Context context) { return new HighlightsLayer[] { //"above" mark occurrences (1000) HighlightsLayer.create(InstantRenamePerformer.class.getName(), ZOrder.CARET_RACK.forPosition(1075), false, InstantRenamePerformer.getHighlightsBag(context.getDocument())), }; } }
@Override public HighlightsLayer[] createLayers(Context context) { return new HighlightsLayer[] { HighlightsLayer.create(DebuggerAnnotation.class.getName(), ZOrder.TOP_RACK, true, DebuggerAnnotation.getHighlightsBag(context.getDocument())) }; }
public HighlightsLayer[] createLayers(Context context) { //LexerBasedHighlightLayer semantic = LexerBasedHighlightLayer.getLayer(SemanticHighlighter.class, context.getDocument()); GsfSemanticLayer semantic = GsfSemanticLayer.getLayer(SemanticHighlighter.class, context.getDocument()); semantic.clearColoringCache(); return new HighlightsLayer[] { HighlightsLayer.create(SemanticHighlighter.class.getName() + "-1", ZOrder.SYNTAX_RACK.forPosition(1000), false, semantic), // HighlightsLayer.create(SemanticHighlighter.class.getName() + "-2", ZOrder.SYNTAX_RACK.forPosition(1500), false, SemanticHighlighter.getImportHighlightsBag(context.getDocument())), //the mark occurrences layer should be "above" current row and "below" the search layers: HighlightsLayer.create(MarkOccurrencesHighlighter.class.getName(), ZOrder.CARET_RACK.forPosition(50), false, MarkOccurrencesHighlighter.getHighlightsBag(context.getDocument())), //"above" mark occurrences, "below" search layers: HighlightsLayer.create(InstantRenamePerformer.class.getName(), ZOrder.CARET_RACK.forPosition(75), false, InstantRenamePerformer.getHighlightsBag(context.getDocument())), }; }
@Override public HighlightsLayer[] createLayers(Context context) { if (SEMANTIC_DISABLED) { return new HighlightsLayer[]{ HighlightsLayer.create( MarkOccurrencesHighlighter.class.getName(), ZOrder.CARET_RACK.forPosition(1000), true, MarkOccurrencesHighlighter.getHighlightsBag(context.getDocument())),}; } else { return new HighlightsLayer[] { HighlightsLayer.create( SemanticHighlighter.class.getName(), ZOrder.SYNTAX_RACK.forPosition(2000), true, SemanticHighlighter.getHighlightsBag(context.getDocument())), HighlightsLayer.create( MarkOccurrencesHighlighter.class.getName(), ZOrder.CARET_RACK.forPosition(1000), true, MarkOccurrencesHighlighter.getHighlightsBag(context.getDocument())), }; } } }
public HighlightsLayer[] createLayers (Context context) { Document document = context.getDocument (); // try { // if (LanguagesManager.getDefault ().getLanguage (mimeType).getParser () == null) // return null; return new HighlightsLayer[] { HighlightsLayer.create ( "GLF Semantic Coloring", ZOrder.SYNTAX_RACK.forPosition (10), false, new SemanticHighlightsLayer (document) ), HighlightsLayer.create ( "GLF Languages Coloring", ZOrder.SYNTAX_RACK.forPosition (11), false, new LanguagesHighlightsLayer (document) ), HighlightsLayer.create ( "GLF Token Highlighting", ZOrder.SHOW_OFF_RACK.forPosition (0), false, new TokenHighlightsLayer (document) ) }; // } catch (LanguageDefinitionNotFoundException ex) { // return null; // } } }