Updated UI event type

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@94945 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-04-17 09:38:17 +00:00
parent 305faf67fb
commit d894e4a0c9
2 changed files with 25 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.google.gwt.event.shared.EventHandler;
@ -20,6 +21,7 @@ public class ChangeTableRequestEvent extends GwtEvent<ChangeTableRequestEvent.Ch
public static Type<ChangeTableRequestEventHandler> TYPE = new Type<ChangeTableRequestEventHandler>();
private ChangeTableRequestType changeTableRequestType;
private TRId trId;
private ChangeTableWhy why;
public interface ChangeTableRequestEventHandler extends EventHandler {
void onChangeTableRequestEvent(ChangeTableRequestEvent event);
@ -29,11 +31,11 @@ public class ChangeTableRequestEvent extends GwtEvent<ChangeTableRequestEvent.Ch
public HandlerRegistration addChangeTableRequestEventHandler(ChangeTableRequestEventHandler handler);
}
public static void fire(HasHandlers source, ChangeTableRequestType operationCompleteType, TRId trId) {
source.fireEvent(new ChangeTableRequestEvent(operationCompleteType,trId));
public static void fire(HasHandlers source, ChangeTableRequestType operationCompleteType, TRId trId, String why) {
source.fireEvent(new ChangeTableRequestEvent(operationCompleteType,trId, why));
}
public ChangeTableRequestEvent(ChangeTableRequestType changeTableRequestType, TRId trId) {
public ChangeTableRequestEvent(ChangeTableRequestType changeTableRequestType, TRId trId, String why) {
this.changeTableRequestType = changeTableRequestType;
this.trId = trId;
}
@ -64,11 +66,24 @@ public class ChangeTableRequestEvent extends GwtEvent<ChangeTableRequestEvent.Ch
this.trId = trId;
}
public ChangeTableWhy getWhy() {
return why;
}
public void setWhy(ChangeTableWhy why) {
this.why = why;
}
@Override
public String toString() {
return "ChangeTableRequestEvent [changeTableRequestType="
+ changeTableRequestType + ", trId=" + trId + "]";
+ changeTableRequestType + ", trId=" + trId + ", why=" + why
+ "]";
}

View File

@ -0,0 +1,6 @@
package org.gcube.portlets.user.td.widgetcommonevent.client.type;
public enum ChangeTableWhy {
TABLEUPDATED,
TABLECURATION;
}