diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/model/FileModel.java b/src/main/java/org/gcube/portlets/user/workspace/client/model/FileModel.java index 281a0d8..088f103 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/model/FileModel.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/model/FileModel.java @@ -207,11 +207,14 @@ public class FileModel extends BaseModelData implements Serializable { }else if(this.isShared()){ //SHARED ITEM? - if(this.isShareable()) //IS ROOT SHARED FOLDER - absImgPr = Resources.getIconSharedFolder(); - else - absImgPr = Resources.getIconFolder(); //IS A DESCENDANT - + if(this.isVreFolder()) + absImgPr = Resources.getIconVREFolder(); + else{ + if(this.isShareable()) //IS ROOT SHARED FOLDER + absImgPr = Resources.getIconSharedFolder(); + else + absImgPr = Resources.getIconFolder(); //IS A DESCENDANT + } }else if(this.getStatus() == ConstantsExplorer.FOLDERNOTLOAD){ //IS A FOLDER IN LOADING absImgPr = Resources.getIconLoading2(); diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/model/FolderModel.java b/src/main/java/org/gcube/portlets/user/workspace/client/model/FolderModel.java index d5ff63d..e27b0b5 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/model/FolderModel.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/model/FolderModel.java @@ -17,10 +17,12 @@ public class FolderModel extends FileModel { public FolderModel(String identifier, String name, FileModel parent, boolean isDirectory, boolean isShared, boolean isVreFolder) { super(identifier, name, parent, isDirectory, isShared); + super.setVreFolder(isVreFolder); } public FolderModel(String identifier, String name, boolean isDirectory, boolean isVreFolder) { super(identifier, name, isDirectory); + super.setVreFolder(isVreFolder); } @Override 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 3de3450..c9ce6d2 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 @@ -298,5 +298,8 @@ public interface Icons extends ClientBundle { @Source("icons/writeall.png") ImageResource writeall(); + + @Source("icons/vrefolder.png") + ImageResource vreFolder(); } 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 0f78198..e04d3bc 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 @@ -60,6 +60,11 @@ public class Resources { return AbstractImagePrototype.create(ICONS.createNew()); } + public static AbstractImagePrototype getIconVREFolder(){ + + return AbstractImagePrototype.create(ICONS.vreFolder()); + } + public static AbstractImagePrototype getIconPpt(){ return AbstractImagePrototype.create(ICONS.ppt()); diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/vrefolder.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/vrefolder.png new file mode 100644 index 0000000..4b4149a Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/vrefolder.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/AsyncTreePanel.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/AsyncTreePanel.java index 1d4b427..ea58f5f 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/AsyncTreePanel.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/AsyncTreePanel.java @@ -151,6 +151,10 @@ public class AsyncTreePanel extends LayoutContainer { if(model.getStatus() == ConstantsExplorer.FOLDERNOTLOAD) return Resources.getIconLoading2(); + if(model.isVreFolder()){ + + return Resources.getIconVREFolder(); + } //SHARE ICON if(model.isShared()){ if(model.isShareable()) diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java index e88a8a1..d433bcf 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java @@ -710,8 +710,8 @@ public class ContextMenuTree { contextMenu.getItemByItemId(WorkspaceOperation.SHARE_LINK.getId()).setVisible(true); } - /* - if(selectedItem.isBaseVREFolder()){ + //IS VRE FOLDER? + if(selectedItem.isVreFolder()){ contextMenu.getItemByItemId(WorkspaceOperation.SHARE.getId()).setVisible(false); //SHARE contextMenu.getItemByItemId(WorkspaceOperation.INSERT_SHARED_FOLDER.getId()).setVisible(false); //insert shared folder @@ -719,7 +719,7 @@ public class ContextMenuTree { contextMenu.getItemByItemId(WorkspaceOperation.RENAME.getId()).setVisible(false); //UNSHARE contextMenu.getItemByItemId(WorkspaceOperation.REMOVE.getId()).setVisible(false); //UNSHARE return; - }*/ + } //CASE DIRECTORY if(selectedItem.isDirectory()){ 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 ee50ed5..1ed9f1c 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 @@ -860,8 +860,10 @@ public class GWTWorkspaceBuilder { case SHARED_FOLDER: - WorkspaceSharedFolder sharedFolder = (WorkspaceSharedFolder) item; - fileModel = new FolderModel(item.getId(), item.getName(), true, sharedFolder.isVreFolder()); + WorkspaceSharedFolder shared = (WorkspaceSharedFolder) item; + String name = shared.isVreFolder()?shared.getDisplayName():item.getName(); + + fileModel = new FolderModel(item.getId(), name, true, shared.isVreFolder()); fileModel.setShared(true); fileModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString()); @@ -952,7 +954,7 @@ public class GWTWorkspaceBuilder { case SHARED_FOLDER: WorkspaceSharedFolder shared = (WorkspaceSharedFolder) item; String name = shared.isVreFolder()?shared.getDisplayName():item.getName(); - fileModel = new FolderModel(item.getId(), name, (FolderModel) parentFolderModel, true, true,shared.isVreFolder()); + fileModel = new FolderModel(item.getId(), name, (FolderModel) parentFolderModel, true, true, shared.isVreFolder()); fileModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString()); fileModel.setShareable(true); fileModel.setDescription(item.getDescription());