geoportal-data-entry-app/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/events/ActionOnItemEvent.java

77 lines
1.6 KiB
Java

package org.gcube.portlets.user.geoportaldataentry.client.events;
import java.util.List;
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_ON_ITEM;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class ActionOnItemEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Aug 5, 2021
* @param <T> the generic type
*/
public class ActionOnItemEvent<T> extends GwtEvent<ActionOnItemEventHandler> {
public static Type<ActionOnItemEventHandler> TYPE = new Type<ActionOnItemEventHandler>();
private List<T> selectItems;
private ACTION_ON_ITEM action;
/**
* Instantiates a new click item event.
*
* @param selectItems the select items
*/
public ActionOnItemEvent(List<T> selectItems, ACTION_ON_ITEM doAction) {
this.selectItems = selectItems;
this.action = doAction;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
/*
* (non-Javadoc)
*
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@Override
public Type<ActionOnItemEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
/*
* (non-Javadoc)
*
* @see
* com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
* EventHandler)
*/
@Override
protected void dispatch(ActionOnItemEventHandler handler) {
handler.onDoActionFired(this);
}
/**
* Gets the select items.
*
* @return the select items
*/
public List<T> getSelectItems() {
return selectItems;
}
public ACTION_ON_ITEM getAction() {
return action;
}
}