update copy&paste behaviour to manage special folder
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@92830 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a1e6f7ce07
commit
e19ddebe10
|
@ -1068,10 +1068,20 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
FileModel parent = breadCrumb.getLastParent();
|
FileModel parent = breadCrumb.getLastParent();
|
||||||
|
|
||||||
if(parent!=null && parent.isDirectory() && parent.isShared())
|
// GWT.log("Update Breadcrumb for : "+parent);
|
||||||
|
|
||||||
|
if(parent!=null){
|
||||||
|
if(parent.isDirectory() && parent.isShared()){ //IS SHARED FOLDER
|
||||||
setACLInfo(parent.getIdentifier());
|
setACLInfo(parent.getIdentifier());
|
||||||
else
|
}else if(parent.isSpecialFolder()){ //IS SPECIAL FOLDER? DISABLING PASTE BUTTON
|
||||||
|
// GWT.log("Update Breadcrumb is special folder.. disabling paste button");
|
||||||
|
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false);
|
||||||
setACLInfo(null);
|
setACLInfo(null);
|
||||||
|
}else
|
||||||
|
setACLInfo(null); //IS NOT A SHARE FOLDER DOSN'T DISPLAY ACL INFO
|
||||||
|
}else
|
||||||
|
setACLInfo(null);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1633,8 +1643,21 @@ public class AppController implements SubscriberInterface {
|
||||||
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#pasteEventIsCompleted()
|
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#pasteEventIsCompleted()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void pasteEventIsCompleted() {
|
public void pasteEventIsCompleted(boolean isTreeRefreshable, String parentId) {
|
||||||
|
|
||||||
|
if(isTreeRefreshable){
|
||||||
wsPortlet.getGridGroupContainer().unmask();
|
wsPortlet.getGridGroupContainer().unmask();
|
||||||
|
}else{ //FORCE GRID REFRESH
|
||||||
|
FileModel lastBreadCrumb = wsPortlet.getToolBarPath().getLastParent();
|
||||||
|
GWT.log("PasteEventIsCompleted tree is not refreshable");
|
||||||
|
|
||||||
|
if(lastBreadCrumb!=null){
|
||||||
|
GWT.log("Comparing breadcrumb id: "+lastBreadCrumb.getIdentifier() + " and parent id: "+parentId);
|
||||||
|
if(lastBreadCrumb.getIdentifier().compareToIgnoreCase(parentId)==0){
|
||||||
|
eventBus.fireEvent(new GridRefreshEvent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Info.display("Info", "paste submitting...");
|
// Info.display("Info", "paste submitting...");
|
||||||
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false);
|
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false);
|
||||||
|
|
||||||
|
|
|
@ -660,16 +660,31 @@ public class GxtToolBarItemFunctionality {
|
||||||
activeButtonForSharing(active);
|
activeButtonForSharing(active);
|
||||||
else
|
else
|
||||||
activeButtonForSharing(false);
|
activeButtonForSharing(false);
|
||||||
|
|
||||||
|
//IF TARGET IS NOT NULL AND AN ITEM IS COPIED, PASTE IS ENABLING
|
||||||
|
if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null){
|
||||||
|
this.btnPasteItem.enable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TARGET (SELECTED ITEM) CAN BE NULL, HIS PARENT IS NOT NULL ACTIVING BUTTONS
|
||||||
activeButtons(active);
|
activeButtons(active);
|
||||||
|
|
||||||
//HANDLE VRE FOLDER AND SPECIAL FOLDER
|
//HANDLE VRE FOLDER AND SPECIAL FOLDER
|
||||||
if(target!=null && (target.isVreFolder() || target.isSpecialFolder())){
|
if(target!=null && (target.isVreFolder() || target.isSpecialFolder())){
|
||||||
this.btnRemoveItem.disable();
|
this.btnRemoveItem.disable();
|
||||||
this.btnRenameItem.disable();
|
this.btnRenameItem.disable();
|
||||||
|
|
||||||
|
if(target.isVreFolder()) //IS VRE -> ENABLING SET PERMISSION
|
||||||
this.btnSetPermission.enable();
|
this.btnSetPermission.enable();
|
||||||
|
|
||||||
|
if(target.isSpecialFolder()){ //IS SPECIAL FOLDER -> DISABLING COPY AND PASTE
|
||||||
|
this.btnPasteItem.disable();
|
||||||
|
this.btnCopyItem.disable();
|
||||||
|
}
|
||||||
|
|
||||||
this.btnRefreshFolder.enable();
|
this.btnRefreshFolder.enable();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue