accounting-manager/src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/DownloadCSVRequestEvent.java

70 lines
1.7 KiB
Java

package org.gcube.portlets.admin.accountingmanager.client.event;
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingType;
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 DownloadCSVRequestEvent extends
GwtEvent<DownloadCSVRequestEvent.DownloadCSVRequestEventHandler> {
public static Type<DownloadCSVRequestEventHandler> TYPE = new Type<DownloadCSVRequestEventHandler>();
private AccountingType accountingType;
public interface DownloadCSVRequestEventHandler extends EventHandler {
void onDownload(DownloadCSVRequestEvent event);
}
public interface HasDownloadCSVRequestEventHandler extends HasHandlers {
public HandlerRegistration addDownloadCSVRequestEventHandler(
DownloadCSVRequestEventHandler handler);
}
public DownloadCSVRequestEvent(AccountingType accountingType) {
this.accountingType = accountingType;
}
@Override
protected void dispatch(DownloadCSVRequestEventHandler handler) {
handler.onDownload(this);
}
@Override
public Type<DownloadCSVRequestEventHandler> getAssociatedType() {
return TYPE;
}
public static Type<DownloadCSVRequestEventHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source,
DownloadCSVRequestEvent accountingMenuEvent) {
source.fireEvent(accountingMenuEvent);
}
public AccountingType getAccountingType() {
return accountingType;
}
@Override
public String toString() {
return "DownloadCSVRequestEvent [accountingType=" + accountingType
+ "]";
}
}