Simply extending all classes to remove all parameterized elements did the trick.
--
Sébastien Tromp
-- 2011/8/3 Sébastien Tromp <sebastien.tromp@gmail.com>
Hello,I am trying to build an implementation of the Set interface that notifies registered handlers when a modification occurs on the Set.First of all, has this already been done somewhere?I couldn't find anything, so I went on to build my own. The issue I have is that, when the Change event is fired, the handlers are not notified.My code is as follows:public class NotifyingSet<T> extends Composite implements HasCollectionChangeHandlers<T>, Set<T> {private final Set<T> wrappedSet;public NotifyingSet() {this.wrappedSet = new HashSet<T>();}@Overridepublic boolean add(final T e) {final boolean ret = this.wrappedSet.add(e);this.fireEvent(new CollectionChangeEvent<T>(Operation.ADD, e));return ret;}...}--------------------public interface HasCollectionChangeHandlers<T> {HandlerRegistration addCollectionChangeHandler(CollectionChangeEventHandler<T> handler);}
-------------------In my presenter, I do this:// Also tried with GWT.create()private final NotifyingSet<FightRequest> fightRequests = new NotifyingSet<FightRequest>();this.registerHandler(this.fightRequests.addCollectionChangeHandler(new CollectionChangeEventHandler<FightRequest>() {@Overridepublic void onCollectionChange(final FightRequest element,final com.fiveorbs.client.events.CollectionChangeEventHandler.Operation operation) {logger.info("on collection change")}}));...fightRequests.add(someobject);----------------After the add, I would expect my handler to be called, but to no avail.Would you have any idea as to what I'm doing wrong?Thanks,--Sébastien Tromp
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment