tabular-data-widget-common-.../src/main/java/org/gcube/portlets/user/td/widgetcommonevent/client/event/DataViewActiveEvent.java

64 lines
1.5 KiB
Java

package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataView;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DataViewActiveEvent extends
GwtEvent<DataViewActiveEvent.DataViewActiveEventHandler> {
public static Type<DataViewActiveEventHandler> TYPE = new Type<DataViewActiveEventHandler>();
private DataView dataView;
public interface DataViewActiveEventHandler extends EventHandler {
void onDataViewActive(DataViewActiveEvent event);
}
public interface HasDataViewActiveEventHandler extends HasHandlers {
public HandlerRegistration addDataViewActiveEventHandler(
DataViewActiveEventHandler handler);
}
public DataViewActiveEvent(DataView dataView) {
this.dataView=dataView;
}
@Override
protected void dispatch(DataViewActiveEventHandler handler) {
handler.onDataViewActive(this);
}
@Override
public Type<DataViewActiveEventHandler> getAssociatedType() {
return TYPE;
}
public static Type<DataViewActiveEventHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source,
DataView dataView) {
source.fireEvent(new DataViewActiveEvent(dataView));
}
public DataView getDataView() {
return dataView;
}
}