Re: get all highlight information (position + color)

geertjan wielenga <[email protected]> Sat, 15 Apr 2017 17:58:05 +0200
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Organization Oracle Corporation
Message-ID <[email protected]>

On 15-4-2017 17:48, Peter Cheung wrote:
>
> Sorry, you email dropped to my junk box. I am enhancing my minimal 
> plugin and want to show the highlighted occurrences words. So I need 
> to know what positions of the current occurrence word.
>
>
> Below is my code up to, but seems can get the information I want:
>
>
> Lookup.Result<HighlightsLayerFactory> factories = lookup.lookup(new 
> Lookup.Template<HighlightsLayerFactory>(HighlightsLayerFactory.class));
>

Lookup.Template is deprecated: 
http://bits.netbeans.org/dev/javadoc/org-openide-util-lookup/org/openide/util/Lookup.Template.html

Here is a tutorial about this topic of mark occurrences, though still no 
idea what it is you're trying to do with these APIs.

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

Gj


> Collection<? extends HighlightsLayerFactory> all = 
> factories.allInstances();
>
> HashMap<String, HighlightsLayer> layers = new HashMap<String, 
> HighlightsLayer>();
>
> Iterator it = layers.entrySet().iterator();
>
> while (it.hasNext()) {
>
> Map.Entry pair = (Map.Entry) it.next();
>
> ModuleLib.log(pair.getKey() + " = " + pair.getValue());
>
> }
>
>
> Thanks for helping
>
>
>
> ------------------------------------------------------------------------
> *From:* geertjan wielenga <[email protected]>
> *Sent:* Saturday, April 15, 2017 11:38 PM
> *To:* [email protected]
> *Subject:* [platform-dev] Re: get all highlight information (position 
> + color)
>
>
> I doubt anyone can help you -- not sure what it is you're talking 
> about. Are you talking about the Output window? Or an editor? Which 
> editor?
>
>
> And why -- what is the use case you're trying to address?
>
>
> Gj
>
>
> On 10-4-2017 5:49, Peter Cheung wrote:
>>
>> Hi
>>
>>     May I know how to get all highlight information (position + color)?
>>
>> thanks
>>
>> from Peter
>>
>