85 lines
2.2 KiB
Java
85 lines
2.2 KiB
Java
package org.gcube.portlets.user.dataminermanager.client.events;
|
|
|
|
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
|
|
|
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;
|
|
|
|
/**
|
|
* Computation Ready Event
|
|
*
|
|
*
|
|
* @author "Giancarlo Panichi" <a
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class ComputationReadyEvent extends
|
|
GwtEvent<ComputationReadyEvent.ComputationReadyEventHandler> {
|
|
|
|
public static Type<ComputationReadyEventHandler> TYPE = new Type<ComputationReadyEventHandler>();
|
|
private Operator operator;
|
|
private String computationTitle;
|
|
private String computationDescription;
|
|
|
|
public interface ComputationReadyEventHandler extends EventHandler {
|
|
void onReady(ComputationReadyEvent event);
|
|
}
|
|
|
|
public interface HasComputationReadyEventHandler extends HasHandlers {
|
|
public HandlerRegistration addComputationReadyEventHandler(
|
|
ComputationReadyEventHandler handler);
|
|
}
|
|
|
|
public ComputationReadyEvent(Operator operator, String computationTitle,
|
|
String computationDescription) {
|
|
super();
|
|
this.operator = operator;
|
|
this.computationTitle = computationTitle;
|
|
this.computationDescription = computationDescription;
|
|
}
|
|
|
|
@Override
|
|
protected void dispatch(ComputationReadyEventHandler handler) {
|
|
handler.onReady(this);
|
|
}
|
|
|
|
@Override
|
|
public Type<ComputationReadyEventHandler> getAssociatedType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static Type<ComputationReadyEventHandler> getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static void fire(HasHandlers source, ComputationReadyEvent event) {
|
|
source.fireEvent(event);
|
|
}
|
|
|
|
public static Type<ComputationReadyEventHandler> getTYPE() {
|
|
return TYPE;
|
|
}
|
|
|
|
public Operator getOperator() {
|
|
return operator;
|
|
}
|
|
|
|
public String getComputationTitle() {
|
|
return computationTitle;
|
|
}
|
|
|
|
public String getComputationDescription() {
|
|
return computationDescription;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "ComputationReadyEvent [operator=" + operator
|
|
+ ", computationTitle=" + computationTitle
|
|
+ ", computationDescription=" + computationDescription + "]";
|
|
}
|
|
|
|
}
|