diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/event/TrashEvent.java b/src/main/java/org/gcube/portlets/user/workspace/client/event/TrashEvent.java index 3099fb8..2f00312 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/event/TrashEvent.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/event/TrashEvent.java @@ -19,10 +19,10 @@ public class TrashEvent extends GwtEvent implements GuiEventI public static Type TYPE = new Type(); - private List targetFileModels; + private List targetFileModels; private WorkspaceTrashOperation trashOperation; - public TrashEvent(WorkspaceTrashOperation trashOperation, List targets) { + public TrashEvent(WorkspaceTrashOperation trashOperation, List targets) { this.trashOperation = trashOperation; this.setTargetFileModels(targets); } @@ -50,11 +50,12 @@ public class TrashEvent extends GwtEvent implements GuiEventI this.trashOperation = trashOperation; } + @SuppressWarnings("unchecked") public List getTargetFileModels() { - return targetFileModels; + return (List) targetFileModels; } - public void setTargetFileModels(List targetFileModels) { + public void setTargetFileModels( List targetFileModels) { this.targetFileModels = targetFileModels; } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java index f0593ae..b810de5 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java @@ -287,8 +287,11 @@ public interface Icons extends ClientBundle { @Source("icons/sharelink.png") ImageResource publicLink(); - @Source("icons/trash.png") - ImageResource trash(); + @Source("icons/user_trash_full.png") + ImageResource trash_full(); + + @Source("icons/user_trash.png") + ImageResource trash_empty(); @Source("icons/readonly.png") ImageResource readonly(); @@ -313,5 +316,19 @@ public interface Icons extends ClientBundle { @Source("icons/sharegroup.png") ImageResource groupusers(); + + /** + * @return + */ + @Source("icons/undo.png") + ImageResource undo(); + + + + /** + * @return + */ + @Source("icons/recycle.png") + ImageResource recycle(); } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Resources.java b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Resources.java index e381988..d16c0cc 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Resources.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Resources.java @@ -45,14 +45,29 @@ public class Resources { return AbstractImagePrototype.create(ICONS.table()); } + public static AbstractImagePrototype getIconRecycle(){ + + return AbstractImagePrototype.create(ICONS.recycle()); + } + + public static AbstractImagePrototype getIconUndo(){ + + return AbstractImagePrototype.create(ICONS.undo()); + } + public static AbstractImagePrototype getIconShareLink(){ return AbstractImagePrototype.create(ICONS.shareLink()); } - public static AbstractImagePrototype getTrash(){ + public static AbstractImagePrototype getTrashFull(){ - return AbstractImagePrototype.create(ICONS.trash()); + return AbstractImagePrototype.create(ICONS.trash_full()); + } + + public static AbstractImagePrototype getTrashEmpty(){ + + return AbstractImagePrototype.create(ICONS.trash_empty()); } public static AbstractImagePrototype getIconCreateNew(){ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/recycle.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/recycle.png new file mode 100644 index 0000000..415603d Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/recycle.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/undo.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/undo.png new file mode 100644 index 0000000..b39d182 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/undo.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/user_trash.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/user_trash.png new file mode 100644 index 0000000..0e0953c Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/user_trash.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/user_trash_full.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/user_trash_full.png new file mode 100644 index 0000000..695d215 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/user_trash_full.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java index 9607fb0..102443a 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java @@ -2235,8 +2235,11 @@ public class GWTWorkspaceBuilder { FileTrashedModel fileTrashModel = new FileTrashedModel(); fileTrashModel.setName(trashedItem.getName()); + fileTrashModel.setIdentifier(trashedItem.getOriginalParentId()+trashedItem.getName()); //CALCULATED ID + //SETTING PARENT FileModel oldParent = new FileModel(trashedItem.getOriginalParentId(), "", true); + fileTrashModel.setOrginalPath(trashedItem.getDeletedFrom()); fileTrashModel.setParentFileModel(oldParent); diff --git a/src/main/java/org/gcube/portlets/user/workspace/shared/WorkspaceTrashOperation.java b/src/main/java/org/gcube/portlets/user/workspace/shared/WorkspaceTrashOperation.java index 5ffc55b..3ab8c63 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/shared/WorkspaceTrashOperation.java +++ b/src/main/java/org/gcube/portlets/user/workspace/shared/WorkspaceTrashOperation.java @@ -19,9 +19,9 @@ public enum WorkspaceTrashOperation { //CALLING OPERATION SERVER REFRESH("Refresh", "Refresh trash content"), - RESTORE("Restore", "Restore the trash item"), + RESTORE("Restore", "Restore the trash item/s (selected)"), RESTORE_ALL("Restore All", "Restore all trash content"), - DELETE_PERMANENTLY("Delete Permanently", "Delete Permanently the trash item"), + DELETE_PERMANENTLY("Delete Permanently", "Delete Permanently the trash item/s (selected)"), EMPTY_TRASH("Empty", "Empty definitively trash content"); public String label;