[prev in list] [next in list] [prev in thread] [next in thread]
List: groovy-scm
Subject: [groovy-scm] [jira] Created: (GROOVY-5057) new way to create events
From: "Jonathan de Sena Ribeiro (JIRA)" <jira () codehaus ! org>
Date: 2011-09-30 21:14:17
Message-ID: 998268971.10640.1317417257133.JavaMail.j2ee-jira () codehaus01-new ! managed ! contegix ! com
[Download RAW message or body]
new way to create events
------------------------
Key: GROOVY-5057
URL: https://jira.codehaus.org/browse/GROOVY-5057
Project: groovy
Issue Type: Wish
Environment: The better way to handling events in Groovy. Would be very \
good! Reporter: Jonathan de Sena Ribeiro
I think that the way to handle event in groovy aint the best, would may be that model \
only a 3 simples steps: declaring, dispatching e listening
// 1. declare event
// declare the name and the assignature
public event Click(object sender);
// 2. dispatch event
// execute the event as a method
this.Click(this);
// 3. listening event
// associate a method with a member event in object
// simple, clean and intuitive
// the assignature will bem checked in compile-time
public void Frame_Click(object sender) : testComponent.Click
{
}
/// all code
class TestComponent
{
public event Click(object sender);
public void MomentOk()
{
Click(this);
}
}
class TestForm
{
public TestComponent cmp;
public main()
{
cmp = new TestComponent();
}
public void Component_Click(object sender) : cmp.Click
{
}
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
<a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic