ultimate management of special folder on his selection

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@92864 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-03-10 11:00:30 +00:00
parent e19ddebe10
commit 9532f5891e
4 changed files with 69 additions and 15 deletions

View File

@ -445,7 +445,7 @@ public class AppController implements SubscriberInterface {
}else{ //IS MULTISELECTION
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activeButtonForMultiSelection(true);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().enableButtons(false);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().enableInfoHistoryButtons(false);
}
//setFileDetailsInView(event.getSourceFile().getIdentifier());
@ -971,7 +971,8 @@ public class AppController implements SubscriberInterface {
private void doElementGridSelected(boolean isSelected, FileModel target) {
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activeButtonsOnSelectForOperation(target, isSelected);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().enableButtons(isSelected);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().enableInfoHistoryButtons(isSelected);
disableButtonsOnBreadcrumbSpecialFolder();
if(isSelected){
FileModel lastParent = this.wsPortlet.getToolBarPath().getLastParent();
@ -985,11 +986,17 @@ public class AppController implements SubscriberInterface {
}
else
loadBreadcrumbByFileModel(target,false);
}
}
private void disableButtonsOnBreadcrumbSpecialFolder(){
GxtBreadcrumbPathPanel breadCrumb = this.wsPortlet.getToolBarPath();
FileModel parent = breadCrumb.getLastParent();
if(parent!=null && parent.isSpecialFolder())
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().disableButtonSpecialFolderSelected();
}
private FileGridModel getGridSelectedItem(){
return wsPortlet.getGridGroupContainer().getSelectedItem();
}
@ -1068,17 +1075,20 @@ public class AppController implements SubscriberInterface {
FileModel parent = breadCrumb.getLastParent();
// GWT.log("Update Breadcrumb for : "+parent);
GWT.log("Update Breadcrumb for : "+parent);
if(parent!=null){
if(parent.isDirectory() && parent.isShared()){ //IS SHARED FOLDER
if(parent.isDirectory() && parent.isShared()){ //IS SHARED FOLDER, ENABLING OPERATION FOR ACTIVE BREADCRUMB
setACLInfo(parent.getIdentifier());
}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);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
}else if(parent.isSpecialFolder()){ //IS SPECIAL FOLDER? DISABLING BUTTONS
GWT.log("Update Breadcrumb is special folder.. disabling special folder buttons");
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().disableButtonSpecialFolderSelected();
setACLInfo(null);
}else
}else{ //ENABLING OPERATION FOR ACTIVE BREADCRUMB
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
setACLInfo(null); //IS NOT A SHARE FOLDER DOSN'T DISPLAY ACL INFO
}
}else
setACLInfo(null);

View File

@ -86,7 +86,7 @@ public class GxtGridFilterPanel extends LayoutContainer {
@Override
public void selectionChanged(SelectionChangedEvent<FileGridModel> se) {
System.out.println("selection grid change");
System.out.println(" SelectionChangedListener selection grid change");
ModelData target = se.getSelectedItem();

View File

@ -126,7 +126,7 @@ public class GxtBottomToolBarItem extends ToolBar{
enableButtons(false);
enableInfoHistoryButtons(false);
}
@ -138,7 +138,7 @@ public class GxtBottomToolBarItem extends ToolBar{
this.txtOwner.setText("");
}
public void enableButtons(boolean enable){
public void enableInfoHistoryButtons(boolean enable){
bHistory.setEnabled(enable);
bRead.setEnabled(enable);
btnGetInfo.setEnabled(enable);

View File

@ -605,6 +605,11 @@ public class GxtToolBarItemFunctionality {
this.btnOpen.enable();
this.btnSetPermission.disable();
//ADDED 07/03/2014
this.btnAddFolder.enable();
this.btnUploadArchive.enable();
this.btnUploadFile.enable();
if(target!=null){
if(active & target.getGXTFolderItemType()!=null){
@ -670,7 +675,7 @@ public class GxtToolBarItemFunctionality {
//TARGET (SELECTED ITEM) CAN BE NULL, HIS PARENT IS NOT NULL ACTIVING BUTTONS
activeButtons(active);
//HANDLE VRE FOLDER AND SPECIAL FOLDER
//HANDLING VRE FOLDER AND SPECIAL FOLDER GRID ITEM SELECTION
if(target!=null && (target.isVreFolder() || target.isSpecialFolder())){
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
@ -679,8 +684,7 @@ public class GxtToolBarItemFunctionality {
this.btnSetPermission.enable();
if(target.isSpecialFolder()){ //IS SPECIAL FOLDER -> DISABLING COPY AND PASTE
this.btnPasteItem.disable();
this.btnCopyItem.disable();
disableButtonSpecialFolderSelected();
}
this.btnRefreshFolder.enable();
@ -699,6 +703,12 @@ public class GxtToolBarItemFunctionality {
this.btnOpen.disable();
this.btnCopyItem.disable();
this.btnCutItem.disable();
//ADDED 07/03/2104
// this.btnAddFolder.disable();
// this.btnUploadArchive.disable();
// this.btnUploadFile.disable();
// this.btnGetInfo.disable();
// this.btnGetSharedLink.disable();
} else {
@ -708,6 +718,12 @@ public class GxtToolBarItemFunctionality {
this.btnOpen.enable();
this.btnCopyItem.enable();
this.btnCutItem.enable();
//ADDED 07/03/2104
// this.btnAddFolder.enable();
// this.btnUploadArchive.enable();
// this.btnUploadFile.enable();
// this.btnGetInfo.enable();
}
@ -758,5 +774,33 @@ public class GxtToolBarItemFunctionality {
public void activePasteButton(boolean b){
btnPasteItem.setEnabled(b);
}
public void disableButtonSpecialFolderSelected(){
this.btnPasteItem.disable();
this.btnCopyItem.disable();
this.btnAddFolder.disable();
this.btnUploadArchive.disable();
this.btnUploadFile.disable();
this.btnPasteItem.disable();
this.btnDownloadFile.disable();
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
}
public void enableButtonForActiveBreadcrumb(FileModel parent){
if(parent!=null){
//IF TARGET IS NOT NULL AND AN ITEM IS COPIED, PASTE IS ENABLING
if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null){
this.btnPasteItem.enable();
}
this.btnCopyItem.enable();
this.btnAddFolder.enable();
this.btnUploadArchive.enable();
this.btnUploadFile.enable();
this.btnDownloadFile.enable();
}
}
}