2014-01-13 17:11:09 +01:00
|
|
|
package org.gcube.portlets.user.workspace.client.event;
|
|
|
|
|
2014-05-13 11:26:57 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2014-01-13 17:11:09 +01:00
|
|
|
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
|
|
|
|
import org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface;
|
|
|
|
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
2014-02-17 15:56:42 +01:00
|
|
|
import org.gcube.portlets.user.workspace.shared.WorkspaceTrashOperation;
|
2014-01-13 17:11:09 +01:00
|
|
|
|
|
|
|
import com.google.gwt.event.shared.GwtEvent;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2019-02-22 12:05:22 +01:00
|
|
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
|
|
|
* May 23, 2013
|
2014-01-13 17:11:09 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class TrashEvent extends GwtEvent<TrashEventHandler> implements GuiEventInterface{
|
|
|
|
|
|
|
|
public static Type<TrashEventHandler> TYPE = new Type<TrashEventHandler>();
|
|
|
|
|
2014-05-13 17:46:06 +02:00
|
|
|
private List<? extends FileModel> targetFileModels;
|
2014-02-17 15:56:42 +01:00
|
|
|
private WorkspaceTrashOperation trashOperation;
|
2014-01-13 17:11:09 +01:00
|
|
|
|
2014-05-13 17:46:06 +02:00
|
|
|
public TrashEvent(WorkspaceTrashOperation trashOperation, List<? extends FileModel> targets) {
|
2014-01-13 17:11:09 +01:00
|
|
|
this.trashOperation = trashOperation;
|
2014-05-13 11:26:57 +02:00
|
|
|
this.setTargetFileModels(targets);
|
2014-01-13 17:11:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Type<TrashEventHandler> getAssociatedType() {
|
|
|
|
return TYPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void dispatch(TrashEventHandler handler) {
|
|
|
|
handler.onTrashEvent(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* (non-Javadoc)
|
|
|
|
* @see org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface#getKey()
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public EventsTypeEnum getKey() {
|
|
|
|
return EventsTypeEnum.TRASH_EVENT;
|
|
|
|
}
|
2014-02-17 15:56:42 +01:00
|
|
|
|
|
|
|
public void setTrashOperation(WorkspaceTrashOperation trashOperation) {
|
|
|
|
this.trashOperation = trashOperation;
|
|
|
|
}
|
2014-05-13 11:26:57 +02:00
|
|
|
|
2014-05-13 17:46:06 +02:00
|
|
|
@SuppressWarnings("unchecked")
|
2014-05-13 11:26:57 +02:00
|
|
|
public List<FileModel> getTargetFileModels() {
|
2014-05-13 17:46:06 +02:00
|
|
|
return (List<FileModel>) targetFileModels;
|
2014-05-13 11:26:57 +02:00
|
|
|
}
|
|
|
|
|
2014-05-13 17:46:06 +02:00
|
|
|
public void setTargetFileModels( List<? extends FileModel> targetFileModels) {
|
2014-05-13 11:26:57 +02:00
|
|
|
this.targetFileModels = targetFileModels;
|
|
|
|
}
|
|
|
|
|
|
|
|
public WorkspaceTrashOperation getTrashOperation() {
|
|
|
|
return trashOperation;
|
|
|
|
}
|
2014-01-13 17:11:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
}
|