get all highlight information (position + color)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

get all highlight information (position + color)

Peter Cheung

Hi

    May I know how to get all highlight information (position + color)?

thanks

from Peter

Reply | Threaded
Open this post in threaded view
|

Re: get all highlight information (position + color)

geertjan.wielenga@oracle.com


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


Reply | Threaded
Open this post in threaded view
|

Re: get all highlight information (position + color)

Peter Cheung

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 <[hidden email]>
Sent: Saturday, April 15, 2017 11:38 PM
To: [hidden email]
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


Reply | Threaded
Open this post in threaded view
|

Re: get all highlight information (position + color)

geertjan.wielenga@oracle.com


Which plugin, where? What does it mean "to show the highlighted occurrences words"? And why? What is it you're trying to do, what is the plugin trying to achieve.


Gj


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));

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 [hidden email]
Sent: Saturday, April 15, 2017 11:38 PM
To: [hidden email]
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



Reply | Threaded
Open this post in threaded view
|

Re: get all highlight information (position + color)

geertjan.wielenga@oracle.com
In reply to this post by Peter Cheung



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 [hidden email]
Sent: Saturday, April 15, 2017 11:38 PM
To: [hidden email]
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



Reply | Threaded
Open this post in threaded view
|

Re: get all highlight information (position + color)

Peter Cheung

I am doing something like this https://atom.io/packages/minimap-highlight-selected , show the current occurrence words in my minimal plugin.

I am nearly defeat atom editor's minmap. I need to get the occurrences word information (position+color).

Thanks
Peter.






From: geertjan wielenga <[hidden email]>
Sent: Saturday, April 15, 2017 11:58 PM
To: [hidden email]
Subject: [platform-dev] Re: get all highlight information (position + color)
 



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 [hidden email]
Sent: Saturday, April 15, 2017 11:38 PM
To: [hidden email]
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