On 17 sep, 03:27, Mats <[email protected]> wrote:
> Hello,
>
> I'm trying to use the YouTube library hotforcode in 1.7, but I'm
> having trouble porting some the event stuff from 1.5 code.
>
> Specifically I'm wondering about this
> filehttp://code.google.com/p/hotforcode/source/browse/trunk/YouTubeTv/src...
>
> What do I change changeListeners.fireChange(this) to?
1. replace the changeListeners.add() with addHandler(...)
2. do *not* use ChangeHandler/ChangeEvent, because it's a DomEvent,
not a "logical" event; in this case, maybe you could use a
SelectionEvent<Video> instead of creating a new "specialized" event
3. to fire the event, just call SelectionEvent.fire(this,
this.currentVideo)
> PlaylistPlayer is also references from player.addChangeListener(new
> ChangeListener()
> inhttp://code.google.com/p/hotforcode/source/browse/trunk/YouTubeTv/src...
> I'm not sure if I need to change that method also?
You'd have to change PlaylistPlayer to implement
HasSelectionHandlers<Video> (if you choose to use SelectionHandler/
SelectionEvent) instead of SourcesChangeEvents, which means replacing
add/removeChangeListener with addSelectionHandler:
public void addSelectionHandler(SelectionHandler<Video> handler) {
addHandler(SelectionEvent.getType(), handler)
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---