Re: get all highlight information (position + color)

Peter Cheung <[email protected]> Sat, 15 Apr 2017 15:48:45 +0000
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <SINPR04MB05277682B082CD79CC827911B5040@SINPR04MB0527.apcprd04.prod.outlook.com>
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));

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