statistical-algorithms-impo.../src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/event/ProjectStatusEvent.java

66 lines
1.8 KiB
Java

package org.gcube.portlets.user.statisticalalgorithmsimporter.client.event;
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.ProjectStatusEventType;
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;
/**
* Project Status Event
*
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ProjectStatusEvent extends
GwtEvent<ProjectStatusEvent.ProjectStatusEventHandler> {
public static Type<ProjectStatusEventHandler> TYPE = new Type<ProjectStatusEventHandler>();
private ProjectStatusEventType projectStatusEventType;
public interface ProjectStatusEventHandler extends EventHandler {
void onProjectStatus(ProjectStatusEvent event);
}
public interface HasProjectStatusEventHandler extends HasHandlers {
public HandlerRegistration addProjectStatusEventHandler(
ProjectStatusEventHandler handler);
}
public ProjectStatusEvent(ProjectStatusEventType projectStatusEventType) {
this.projectStatusEventType = projectStatusEventType;
}
@Override
protected void dispatch(ProjectStatusEventHandler handler) {
handler.onProjectStatus(this);
}
@Override
public Type<ProjectStatusEventHandler> getAssociatedType() {
return TYPE;
}
public static Type<ProjectStatusEventHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source,
ProjectStatusEvent projectStatusEvent) {
source.fireEvent(projectStatusEvent);
}
public ProjectStatusEventType getProjectStatusEventType() {
return projectStatusEventType;
}
@Override
public String toString() {
return "ProjectStatusEvent [projectStatusEventType="
+ projectStatusEventType + "]";
}
}