64 lines
1.6 KiB
Java
64 lines
1.6 KiB
Java
package org.gcube.portlets.user.dataminermanager.client.events;
|
|
|
|
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
|
|
|
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;
|
|
|
|
/**
|
|
* Output Resource Event
|
|
*
|
|
*
|
|
* @author "Giancarlo Panichi" <a
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class OutputResourceEvent extends
|
|
GwtEvent<OutputResourceEvent.OutputResourceEventHandler> {
|
|
public static Type<OutputResourceEventHandler> TYPE = new Type<OutputResourceEventHandler>();
|
|
private Resource resource;
|
|
|
|
public interface OutputResourceEventHandler extends EventHandler {
|
|
void onOutput(OutputResourceEvent event);
|
|
}
|
|
|
|
public interface HasOutputResourceEventHandler extends HasHandlers {
|
|
public HandlerRegistration addOutputResourceEventHandler(
|
|
OutputResourceEventHandler handler);
|
|
}
|
|
|
|
public OutputResourceEvent(Resource resource) {
|
|
this.resource = resource;
|
|
}
|
|
|
|
@Override
|
|
protected void dispatch(OutputResourceEventHandler handler) {
|
|
handler.onOutput(this);
|
|
}
|
|
|
|
@Override
|
|
public Type<OutputResourceEventHandler> getAssociatedType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static Type<OutputResourceEventHandler> getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static void fire(HasHandlers source, OutputResourceEvent event) {
|
|
source.fireEvent(event);
|
|
}
|
|
|
|
public Resource getResource() {
|
|
return resource;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "OutputResourceEvent [resource=" + resource + "]";
|
|
}
|
|
|
|
}
|