2019-01-17 20:11:53 +01:00
|
|
|
package org.gcube.portlets.user.dataminerexecutor.client.events;
|
|
|
|
|
2019-03-13 11:53:59 +01:00
|
|
|
import org.gcube.portlets.user.dataminerexecutor.shared.process.InvocationModel;
|
2019-01-17 20:11:53 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Operators Classification Request Event
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2019-03-13 11:53:59 +01:00
|
|
|
public class InvocationModelEvent extends GwtEvent<InvocationModelEvent.InvocationModelEventHandler> {
|
2019-01-17 20:11:53 +01:00
|
|
|
|
|
|
|
public static Type<InvocationModelEventHandler> TYPE = new Type<InvocationModelEventHandler>();
|
2019-03-13 11:53:59 +01:00
|
|
|
private InvocationModel invocationModel;
|
|
|
|
|
2019-01-17 20:11:53 +01:00
|
|
|
public interface InvocationModelEventHandler extends EventHandler {
|
|
|
|
void onInvocation(InvocationModelEvent event);
|
|
|
|
}
|
|
|
|
|
|
|
|
public interface HasInvocationModelEventHandler extends HasHandlers {
|
2019-03-13 11:53:59 +01:00
|
|
|
public HandlerRegistration addInvocationModelEventHandler(InvocationModelEventHandler handler);
|
2019-01-17 20:11:53 +01:00
|
|
|
}
|
|
|
|
|
2019-03-13 11:53:59 +01:00
|
|
|
public InvocationModelEvent(InvocationModel invocationModel) {
|
|
|
|
this.invocationModel = invocationModel;
|
2019-01-17 20:11:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void dispatch(InvocationModelEventHandler handler) {
|
|
|
|
handler.onInvocation(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Type<InvocationModelEventHandler> getAssociatedType() {
|
|
|
|
return TYPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Type<InvocationModelEventHandler> getType() {
|
|
|
|
return TYPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void fire(HasHandlers source, InvocationModelEvent event) {
|
|
|
|
source.fireEvent(event);
|
|
|
|
}
|
|
|
|
|
2019-03-13 11:53:59 +01:00
|
|
|
public InvocationModel getInvocationModel() {
|
|
|
|
return invocationModel;
|
2019-01-17 20:11:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
2019-03-13 11:53:59 +01:00
|
|
|
return "InvocationModelEvent [invocationModel=" + invocationModel + "]";
|
2019-01-17 20:11:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|