Presumably, the primary issue is getting hold of the editor component so that you can add a mouse listener.

One approach is to add listener to the EditorRegistry.

   
https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/api/editor/EditorRegistry.html

and use the FOCUS_GAINED_PROPERTY. This conveniently also has the previous editor if you want to remove a listener.

-ernie


On 6/14/22 6:30 AM, Peter Cheung wrote:
Dear Sir/Madam
      I want to enhance my netbeans-antlr plugin 
(https://gitlab.com/quantr/toolchain/netbeans-antlr) by allowing people to 
click on the editor and highlight the token in the tree view. How can I 
subscribe the click event of the current editor?


Thanks

>From Peter (System Architect, Quantr Limited https://www.quantr.hk , Mobile : 
96554595)



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to