You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Peter Cheung <pe...@quantr.hk> on 2022/06/14 13:30:50 UTC

netbeans-antlr pluging, click on the current editor event

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)

Re: netbeans-antlr pluging, click on the current editor event

Posted by Ernie Rael <er...@raelity.com>.
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: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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