2016-01-12 17:21:22 +01:00
|
|
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.event;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
2018-12-14 18:00:41 +01:00
|
|
|
* Input Request Event
|
2016-01-12 17:21:22 +01:00
|
|
|
*
|
|
|
|
*
|
2017-05-12 18:26:05 +02:00
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
2016-01-12 17:21:22 +01:00
|
|
|
*
|
|
|
|
*/
|
2019-01-17 15:15:09 +01:00
|
|
|
public class InputRequestEvent extends GwtEvent<InputRequestEvent.InputRequestEventHandler> {
|
2016-01-12 17:21:22 +01:00
|
|
|
|
|
|
|
public static Type<InputRequestEventHandler> TYPE = new Type<InputRequestEventHandler>();
|
2019-01-17 15:15:09 +01:00
|
|
|
private boolean requested;
|
2016-01-12 17:21:22 +01:00
|
|
|
|
|
|
|
public interface InputRequestEventHandler extends EventHandler {
|
|
|
|
void onInputRequest(InputRequestEvent event);
|
|
|
|
}
|
|
|
|
|
|
|
|
public interface HasInputRequestEventHandler extends HasHandlers {
|
2019-01-17 15:15:09 +01:00
|
|
|
public HandlerRegistration addInputRequestEventHandler(InputRequestEventHandler handler);
|
2016-01-12 17:21:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public InputRequestEvent() {
|
2019-01-17 15:15:09 +01:00
|
|
|
requested = true;
|
2016-01-12 17:21:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void dispatch(InputRequestEventHandler handler) {
|
|
|
|
handler.onInputRequest(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Type<InputRequestEventHandler> getAssociatedType() {
|
|
|
|
return TYPE;
|
|
|
|
}
|
|
|
|
|
2019-01-17 15:15:09 +01:00
|
|
|
public boolean isRequested() {
|
|
|
|
return requested;
|
2016-01-12 17:21:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
2019-01-17 15:15:09 +01:00
|
|
|
return "InputRequestEvent [requested=" + requested + "]";
|
2016-01-12 17:21:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|