Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@90886 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-04 17:26:03 +00:00
parent f2fdc4b76f
commit eede44e9d2
2 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,65 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.WidgetRequestType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
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;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class WidgetRequestEvent extends GwtEvent<WidgetRequestEvent.WidgetRequestEventHandler> {
public static Type<WidgetRequestEventHandler> TYPE = new Type<WidgetRequestEventHandler>();
private WidgetRequestType widgetRequestType;
private TRId trId;
public interface WidgetRequestEventHandler extends EventHandler {
void onWidgetRequest(WidgetRequestEvent event);
}
public interface HasWidgetRequestEventHandler extends HasHandlers{
public HandlerRegistration addWidgetRequestEventHandler(WidgetRequestEventHandler handler);
}
public WidgetRequestEvent(WidgetRequestType closeType) {
this.widgetRequestType = closeType;
}
public WidgetRequestType getWidgetRequestType() {
return widgetRequestType;
}
@Override
protected void dispatch(WidgetRequestEventHandler handler) {
handler.onWidgetRequest(this);
}
@Override
public Type<WidgetRequestEventHandler> getAssociatedType() {
return TYPE;
}
public static Type<WidgetRequestEventHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, WidgetRequestType widgetRequestType) {
source.fireEvent(new WidgetRequestEvent(widgetRequestType));
}
public TRId getTrId() {
return trId;
}
public void setTrId(TRId trId) {
this.trId = trId;
}
}

View File

@ -0,0 +1,14 @@
/**
*
*/
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public enum WidgetRequestType {
CHANGECOLUMNTYPEPANEL;
}