pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A.J. (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PIVOT-611) add a method hasListener() in ListenerList object
Date Thu, 26 Aug 2010 14:11:53 GMT

    [ https://issues.apache.org/jira/browse/PIVOT-611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12902870#action_12902870
] 

A.J. commented on PIVOT-611:
----------------------------

I'm creating a Form at runtime based on user interaction;
In this process, I'm adding listeners on some components.
During user interaction, some of these components may be processed again (listeners set) and
I want to avoid having twice the same listener on the component (it wont happen, I will get
a sysout message instead, but I want to avoid this too).
When the form is hidden or disposed, I just want to remove the listeners without having to
create a Map at application level to retain which component is concerned or not.
The remove() method does not fit here since it will throw an error if the listener has not
been added.
I could refactor all this to have a more precise behaviour, but having this method could save
me a lot of time :)
and I think it could be useful in other circumstances as well.

> add a method hasListener() in ListenerList object
> -------------------------------------------------
>
>                 Key: PIVOT-611
>                 URL: https://issues.apache.org/jira/browse/PIVOT-611
>             Project: Pivot
>          Issue Type: Improvement
>    Affects Versions: 1.5
>            Reporter: A.J.
>            Priority: Minor
>
> there is no easy way to determine wether a listener has already been added to a listener
list (except by getting an iterator and traversing the list).
> it would be convenient to have 'hasListener' method in the ListenerList class that encapsulates
this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message