Re: what is my next step to get the highlight occurrence position information

geertjan wielenga <[email protected]> Sat, 8 Jul 2017 10:34:04 +0200
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Organization Oracle Corporation
Message-ID <[email protected]>
Don't know the answer, but maybe this helps:


https://platform.netbeans.org/tutorials/nbm-mark-occurrences.html


Thanks,


Gj


On 8-7-2017 8:42, Peter Cheung wrote:
>
> Hi All
>
>    I use these to get all HighlightsLayerFactory, what is my next step 
> to get the highlight occurrence position information in current editor?
>
> Lookup.Result<HighlightsLayerFactory> factories = lookup.lookup(new 
> Lookup.Template<HighlightsLayerFactory>(HighlightsLayerFactory.class));
>
> Collection<? extends HighlightsLayerFactory> all = 
> factories.allInstances();
>
> for (HighlightsLayerFactory fac: all){
>
> ModuleLib.log("fac = " + fac);
>
> }
>
>
> Will print out:
>
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.refactoring.java.ui.HighlightsLayerFactory@9fbf0a9
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.java.editor.codegen.RemoveSurroundingCodePanel$UnwrapCodeHighlightsLayerFactory@1fcff640
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.java.hints.introduce.IntroduceHint$HLFImpl@7d1e9f4d
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.gsf.codecoverage.CoverageHighlightsLayerFactory@7bb11ddd
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.javadoc.highlighting.Factory@b83fa8c
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.java.debug.HighlightsLayerFactoryImpl@6b9e604a
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.java.editor.semantic.HighlightsLayerFactoryImpl@62736e83
>
> 14:41:2.216 - fac = 
> org.netbeans.spi.debugger.ui.MethodChooser$MethodChooserHighlightsLayerFactory@11dfd8e5
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.debugger.jpda.projectsui.HighlightsLayerFactoryImpl@51c17c8
>
> 14:41:2.216 - fac = 
> org.netbeans.lib.editor.codetemplates.textsync.TextRegionManager$Highlighting$HLFactory@1d98ab11
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.merge.builtin.visualizer.MergeHighlightsLayerFactory@64e6c957
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.diff.builtin.visualizer.editable.DiffHighlightsLayerFactory@b113dde
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.editor.impl.highlighting.HLFactory@6ed6c923
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.editor.hints.HighlightsLayerFactoryImpl@364e27cb
>
> 14:41:2.216 - fac = 
> org.netbeans.modules.editor.bracesmatching.BracesMatchHighlighting$Factory@6430fc24
>
> 14:41:2.217 - fac = 
> org.netbeans.lib.editor.hyperlink.HyperlinkOperation$HighlightFactoryImpl@664dd2b1
>
> 14:41:2.217 - fac = 
> org.netbeans.modules.editor.lib2.highlighting.Factory@3e0a908a
>
> 14:41:2.217 - fac = 
> org.netbeans.modules.editor.search.TextSearchHighlighting$FactoryImpl@793d88ff
>
> 14:41:2.217 - fac = 
> org.netbeans.modules.editor.url.HighlightURLs$FactoryImpl@1a8f9a20
>
>
> Thanks
>
> from Peter
>