84 lines
2.1 KiB
Java
84 lines
2.1 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;
|
|
|
|
/**
|
|
* Start Computation Event
|
|
*
|
|
*
|
|
* @author "Giancarlo Panichi" <a
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class StartComputationEvent extends
|
|
GwtEvent<StartComputationEvent.StartComputationEventHandler> {
|
|
|
|
public static Type<StartComputationEventHandler> TYPE = new Type<StartComputationEventHandler>();
|
|
private Operator op;
|
|
private String computationTitle;
|
|
private String computationDescription;
|
|
|
|
public interface StartComputationEventHandler extends EventHandler {
|
|
void onStart(StartComputationEvent event);
|
|
}
|
|
|
|
public interface HasStartComputationEventHandler extends HasHandlers {
|
|
public HandlerRegistration addStartComputationEventHandler(
|
|
StartComputationEventHandler handler);
|
|
}
|
|
|
|
public StartComputationEvent(Operator op, String computationTitle, String computationDescription) {
|
|
this.op=op;
|
|
this.computationTitle=computationTitle;
|
|
this.computationDescription=computationDescription;
|
|
|
|
}
|
|
|
|
@Override
|
|
protected void dispatch(StartComputationEventHandler handler) {
|
|
handler.onStart(this);
|
|
}
|
|
|
|
@Override
|
|
public Type<StartComputationEventHandler> getAssociatedType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static Type<StartComputationEventHandler> getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static void fire(HasHandlers source,
|
|
StartComputationEvent startComputationEvent) {
|
|
source.fireEvent(startComputationEvent);
|
|
}
|
|
|
|
public Operator getOp() {
|
|
return op;
|
|
}
|
|
|
|
public String getComputationTitle() {
|
|
return computationTitle;
|
|
}
|
|
|
|
public String getComputationDescription() {
|
|
return computationDescription;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "StartComputationEvent [op=" + op + ", computationTitle="
|
|
+ computationTitle + ", computationDescription="
|
|
+ computationDescription + "]";
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|