45 lines
1.1 KiB
Java
45 lines
1.1 KiB
Java
package org.gcube.portlets.user.td.widgetcommonevent.client.event;
|
|
|
|
import com.google.gwt.event.shared.GwtEvent;
|
|
import com.google.gwt.event.shared.EventHandler;
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType;
|
|
|
|
import com.google.gwt.event.shared.HasHandlers;
|
|
|
|
public class UIStateEvent extends GwtEvent<UIStateEvent.UIStateHandler> {
|
|
|
|
public static Type<UIStateHandler> TYPE = new Type<UIStateHandler>();
|
|
private UIStateType uiStateType;
|
|
|
|
public interface UIStateHandler extends EventHandler {
|
|
void onUIState(UIStateEvent event);
|
|
}
|
|
|
|
public UIStateEvent(UIStateType uiStateType) {
|
|
this.uiStateType = uiStateType;
|
|
}
|
|
|
|
public UIStateType getUIStateType() {
|
|
return uiStateType;
|
|
}
|
|
|
|
@Override
|
|
protected void dispatch(UIStateHandler handler) {
|
|
handler.onUIState(this);
|
|
}
|
|
|
|
@Override
|
|
public Type<UIStateHandler> getAssociatedType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static Type<UIStateHandler> getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static void fire(HasHandlers source, UIStateType uiStateType) {
|
|
source.fireEvent(new UIStateEvent(uiStateType));
|
|
}
|
|
}
|