You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/01/27 10:56:00 UTC

[jira] [Updated] (GROOVY-1762) Add event introspection to the MetaClass

     [ https://issues.apache.org/jira/browse/GROOVY-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King updated GROOVY-1762:
------------------------------
    Fix Version/s:     (was: 3.x)
                   4.x

> Add event introspection to the MetaClass
> ----------------------------------------
>
>                 Key: GROOVY-1762
>                 URL: https://issues.apache.org/jira/browse/GROOVY-1762
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-runtime
>    Affects Versions: 1.0
>            Reporter: Daniel Ferrin
>            Priority: Minor
>             Fix For: 4.x
>
>         Attachments: MetaClassGroovyTest.groovy, MetaEvent.java, MetaEvent.java, groovy-1762-diff.txt, groovy-1762-diff.txt
>
>
> There is no means to determine which events an object can accept closures for. As an example the snippet <code>button.actionPerformed = { doButtonAction())</code> would require the user to know that one of the listener methods on JButton is an ActionListener with an actionPerfomed method, but there is no programatic way to introspect that pseudo property.
> The soluition would be to extend MetaMethod with the needed fields to provide sensible information about the event, and enumerate that in the MetaClass via a getEvents() method.
> Implementation forthcoming...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)