001package votorola.g.web.gwt.event; // Copyright 2011, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE. 002 003import com.google.gwt.core.client.Scheduler; 004import com.google.gwt.view.client.*; 005 006 007/** A coalescing scheduler for the dispatch of selection change events. 008 */ 009public final class CoalescingSelectionChangeGun extends CoalescingSchedulerS 010 implements Scheduler.ScheduledCommand 011{ 012 013 014 /** Constructs a new CoalescingSelectionChangeGun. 015 * 016 * @see #source() 017 * @see #phaser() 018 */ 019 public CoalescingSelectionChangeGun( SelectionModel<?> _source, Phaser _phaser ) 020 { 021 super( Scheduler.get(), _phaser ); 022 source = _source; 023 init( CoalescingSelectionChangeGun.this ); 024 } 025 026 027 028 // ------------------------------------------------------------------------------------ 029 030 031 /** The source from which the selection events are to be fired. 032 */ 033 public SelectionModel<?> source() { return source; } 034 035 036 private final SelectionModel<?> source; 037 038 039 040 // - S c h e d u l e r . S c h e d u l e d - C o m m a n d ---------------------------- 041 042 043 public final void execute() { SelectionChangeEvent.fire( source ); } 044 045 046 047}