enhancements on VRE folder management

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@91540 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-02-13 15:12:37 +00:00
parent 895c4b33d4
commit 5172556090
8 changed files with 30 additions and 11 deletions

View File

@ -207,11 +207,14 @@ public class FileModel extends BaseModelData implements Serializable {
}else if(this.isShared()){ //SHARED ITEM? }else if(this.isShared()){ //SHARED ITEM?
if(this.isShareable()) //IS ROOT SHARED FOLDER if(this.isVreFolder())
absImgPr = Resources.getIconSharedFolder(); absImgPr = Resources.getIconVREFolder();
else else{
absImgPr = Resources.getIconFolder(); //IS A DESCENDANT 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 }else if(this.getStatus() == ConstantsExplorer.FOLDERNOTLOAD){ //IS A FOLDER IN LOADING
absImgPr = Resources.getIconLoading2(); absImgPr = Resources.getIconLoading2();

View File

@ -17,10 +17,12 @@ public class FolderModel extends FileModel {
public FolderModel(String identifier, String name, FileModel parent, boolean isDirectory, boolean isShared, boolean isVreFolder) { public FolderModel(String identifier, String name, FileModel parent, boolean isDirectory, boolean isShared, boolean isVreFolder) {
super(identifier, name, parent, isDirectory, isShared); super(identifier, name, parent, isDirectory, isShared);
super.setVreFolder(isVreFolder);
} }
public FolderModel(String identifier, String name, boolean isDirectory, boolean isVreFolder) { public FolderModel(String identifier, String name, boolean isDirectory, boolean isVreFolder) {
super(identifier, name, isDirectory); super(identifier, name, isDirectory);
super.setVreFolder(isVreFolder);
} }
@Override @Override

View File

@ -298,5 +298,8 @@ public interface Icons extends ClientBundle {
@Source("icons/writeall.png") @Source("icons/writeall.png")
ImageResource writeall(); ImageResource writeall();
@Source("icons/vrefolder.png")
ImageResource vreFolder();
} }

View File

@ -60,6 +60,11 @@ public class Resources {
return AbstractImagePrototype.create(ICONS.createNew()); return AbstractImagePrototype.create(ICONS.createNew());
} }
public static AbstractImagePrototype getIconVREFolder(){
return AbstractImagePrototype.create(ICONS.vreFolder());
}
public static AbstractImagePrototype getIconPpt(){ public static AbstractImagePrototype getIconPpt(){
return AbstractImagePrototype.create(ICONS.ppt()); return AbstractImagePrototype.create(ICONS.ppt());

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

View File

@ -151,6 +151,10 @@ public class AsyncTreePanel extends LayoutContainer {
if(model.getStatus() == ConstantsExplorer.FOLDERNOTLOAD) if(model.getStatus() == ConstantsExplorer.FOLDERNOTLOAD)
return Resources.getIconLoading2(); return Resources.getIconLoading2();
if(model.isVreFolder()){
return Resources.getIconVREFolder();
}
//SHARE ICON //SHARE ICON
if(model.isShared()){ if(model.isShared()){
if(model.isShareable()) if(model.isShareable())

View File

@ -710,8 +710,8 @@ public class ContextMenuTree {
contextMenu.getItemByItemId(WorkspaceOperation.SHARE_LINK.getId()).setVisible(true); contextMenu.getItemByItemId(WorkspaceOperation.SHARE_LINK.getId()).setVisible(true);
} }
/* //IS VRE FOLDER?
if(selectedItem.isBaseVREFolder()){ if(selectedItem.isVreFolder()){
contextMenu.getItemByItemId(WorkspaceOperation.SHARE.getId()).setVisible(false); //SHARE contextMenu.getItemByItemId(WorkspaceOperation.SHARE.getId()).setVisible(false); //SHARE
contextMenu.getItemByItemId(WorkspaceOperation.INSERT_SHARED_FOLDER.getId()).setVisible(false); //insert shared folder 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.RENAME.getId()).setVisible(false); //UNSHARE
contextMenu.getItemByItemId(WorkspaceOperation.REMOVE.getId()).setVisible(false); //UNSHARE contextMenu.getItemByItemId(WorkspaceOperation.REMOVE.getId()).setVisible(false); //UNSHARE
return; return;
}*/ }
//CASE DIRECTORY //CASE DIRECTORY
if(selectedItem.isDirectory()){ if(selectedItem.isDirectory()){

View File

@ -860,8 +860,10 @@ public class GWTWorkspaceBuilder {
case SHARED_FOLDER: case SHARED_FOLDER:
WorkspaceSharedFolder sharedFolder = (WorkspaceSharedFolder) item; WorkspaceSharedFolder shared = (WorkspaceSharedFolder) item;
fileModel = new FolderModel(item.getId(), item.getName(), true, sharedFolder.isVreFolder()); String name = shared.isVreFolder()?shared.getDisplayName():item.getName();
fileModel = new FolderModel(item.getId(), name, true, shared.isVreFolder());
fileModel.setShared(true); fileModel.setShared(true);
fileModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString()); fileModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString());
@ -952,7 +954,7 @@ public class GWTWorkspaceBuilder {
case SHARED_FOLDER: case SHARED_FOLDER:
WorkspaceSharedFolder shared = (WorkspaceSharedFolder) item; WorkspaceSharedFolder shared = (WorkspaceSharedFolder) item;
String name = shared.isVreFolder()?shared.getDisplayName():item.getName(); 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.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString());
fileModel.setShareable(true); fileModel.setShareable(true);
fileModel.setDescription(item.getDescription()); fileModel.setDescription(item.getDescription());