fixed reload item on upload file
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@76934 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f0603d0c58
commit
563e181d26
|
@ -440,7 +440,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
public void onRefreshItem(RefreshFolderEvent refreshtemEvent) {
|
public void onRefreshItem(RefreshFolderEvent refreshtemEvent) {
|
||||||
|
|
||||||
if(refreshtemEvent.getFolderTarget()!=null){
|
if(refreshtemEvent.getFolderTarget()!=null){
|
||||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(refreshtemEvent.getFolderTarget().getIdentifier());
|
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(refreshtemEvent.getFolderTarget().getIdentifier(), true);
|
||||||
notifySubscriber(refreshtemEvent);
|
notifySubscriber(refreshtemEvent);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -818,10 +818,10 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
private void doCompletedFileUploadEvent(CompletedFileUploadEvent completedFileUploadEvent) {
|
private void doCompletedFileUploadEvent(CompletedFileUploadEvent completedFileUploadEvent) {
|
||||||
|
|
||||||
// explorerPanel.getAsycTreePanel().reloadAndSelectTreeLevelFromWorkspaceForUplaod(completedFileUploadEvent.getParentFileModel().getIdentifier());
|
// explorerPanel.getAsycTreePanel().reloadAndSelectTreeLevelFromWorkspaceForUplaod(completedFileUploadEvent.getParentFileModel().getIdentifier());
|
||||||
|
boolean isLevelExpanded = treeLevelIsExpanded(completedFileUploadEvent.getTargetFolderModel().getIdentifier());
|
||||||
//REFRESH TREE ONLY IF FOLDER PARENT EXISTS IN TREE
|
//REFRESH TREE ONLY IF FOLDER PARENT EXISTS IN TREE
|
||||||
if(explorerPanel.getAsycTreePanel().getFileModelByIdentifier(completedFileUploadEvent.getTargetFolderModel().getIdentifier())!=null){
|
if(explorerPanel.getAsycTreePanel().getFileModelByIdentifier(completedFileUploadEvent.getTargetFolderModel().getIdentifier())!=null){
|
||||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(completedFileUploadEvent.getTargetFolderModel().getIdentifier());
|
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(completedFileUploadEvent.getTargetFolderModel().getIdentifier(), isLevelExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
notifySubscriber(completedFileUploadEvent);
|
notifySubscriber(completedFileUploadEvent);
|
||||||
|
@ -1196,15 +1196,15 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
new MessageBoxAlert("Error", caught.getMessage()+"." , null);
|
new MessageBoxAlert("Error", caught.getMessage()+"." , null);
|
||||||
System.out.println(caught.getMessage());
|
System.out.println(caught.getMessage());
|
||||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getTargetParentFileModel().getIdentifier());
|
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getTargetParentFileModel().getIdentifier(), false);
|
||||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getFileSourceModel().getParentFileModel().getIdentifier());
|
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getFileSourceModel().getParentFileModel().getIdentifier(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(Boolean result) {
|
||||||
if(result){
|
if(result){
|
||||||
|
|
||||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getTargetParentFileModel().getIdentifier());
|
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getTargetParentFileModel().getIdentifier(), true);
|
||||||
notifySubscriber(event);
|
notifySubscriber(event);
|
||||||
|
|
||||||
// explorerPanel.getAsycTreePanel().setExpandTreeLevel(event.getTargetParentFileModel(), true); //Expand level drop
|
// explorerPanel.getAsycTreePanel().setExpandTreeLevel(event.getTargetParentFileModel(), true); //Expand level drop
|
||||||
|
@ -1227,6 +1227,11 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
else
|
else
|
||||||
doClickPreview(imagePreviewEvent, 50, 50);
|
doClickPreview(imagePreviewEvent, 50, 50);
|
||||||
|
|
||||||
|
|
||||||
|
// if(imagePreviewEvent.getSourceFileModel()!=null){ //FILE CAN NOT LOADED IN TREE
|
||||||
|
// imagePreviewEvent.getSourceFileModel().setMarkAsRead(true);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doClickPreview(ImagePreviewEvent imagePreviewEvent, final int positionX, final int positionY) {
|
private void doClickPreview(ImagePreviewEvent imagePreviewEvent, final int positionX, final int positionY) {
|
||||||
|
@ -1583,6 +1588,15 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param folderId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean treeLevelIsExpanded(String folderId){
|
||||||
|
return explorerPanel.getAsycTreePanel().isExpanded(folderId);
|
||||||
|
}
|
||||||
|
|
||||||
private List<FileModel> getListParents(List<FileModel> listParentModel, FileModel item){
|
private List<FileModel> getListParents(List<FileModel> listParentModel, FileModel item){
|
||||||
|
|
||||||
getParents(listParentModel, item);
|
getParents(listParentModel, item);
|
||||||
|
|
|
@ -686,13 +686,13 @@ private static final String TREE_MESSAGE_PANEL_ASYNC = "treeMessagePanelAsync";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void reloadTreeLevelAndExpandFolder(String folderIdentifier){
|
public void reloadTreeLevelAndExpandFolder(String folderIdentifier, boolean expandFolder){
|
||||||
final FolderModel folder = (FolderModel) getFileModelByIdentifier(folderIdentifier);
|
final FolderModel folder = (FolderModel) getFileModelByIdentifier(folderIdentifier);
|
||||||
reloadTreeLevelAndExpandFolder(folder);
|
reloadTreeLevelAndExpandFolder(folder, expandFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void reloadTreeLevelAndExpandFolder(final FolderModel folder){
|
private void reloadTreeLevelAndExpandFolder(final FolderModel folder, final boolean expandFolder){
|
||||||
|
|
||||||
treePanel.mask(ConstantsExplorer.VALIDATINGOPERATION,ConstantsExplorer.LOADINGSTYLE);
|
treePanel.mask(ConstantsExplorer.VALIDATINGOPERATION,ConstantsExplorer.LOADINGSTYLE);
|
||||||
|
|
||||||
|
@ -716,7 +716,9 @@ private static final String TREE_MESSAGE_PANEL_ASYNC = "treeMessagePanelAsync";
|
||||||
|
|
||||||
addChildrenToFolder(folder.getIdentifier(), result);
|
addChildrenToFolder(folder.getIdentifier(), result);
|
||||||
|
|
||||||
setExpandTreeLevel(folder, true);
|
setExpandTreeLevel(folder, expandFolder);
|
||||||
|
|
||||||
|
// selectItem(folder);
|
||||||
|
|
||||||
System.out.println("End RPC - getFolderChildren for uplaod/move");
|
System.out.println("End RPC - getFolderChildren for uplaod/move");
|
||||||
}
|
}
|
||||||
|
@ -958,6 +960,26 @@ private static final String TREE_MESSAGE_PANEL_ASYNC = "treeMessagePanelAsync";
|
||||||
*/
|
*/
|
||||||
private void setExpandTreeLevel(FileModel parent, boolean bool) {
|
private void setExpandTreeLevel(FileModel parent, boolean bool) {
|
||||||
treePanel.setExpanded(parent, bool);
|
treePanel.setExpanded(parent, bool);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param identifier
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isExpanded(String identifier){
|
||||||
|
|
||||||
|
if(identifier==null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
FileModel fileTarget = getFileModelByIdentifier(identifier);
|
||||||
|
|
||||||
|
if(fileTarget==null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return treePanel.isExpanded(fileTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExpandTreeLevel(String identifier, boolean bool) {
|
public void setExpandTreeLevel(String identifier, boolean bool) {
|
||||||
|
@ -966,7 +988,11 @@ private static final String TREE_MESSAGE_PANEL_ASYNC = "treeMessagePanelAsync";
|
||||||
treePanel.setExpanded(item, bool);
|
treePanel.setExpanded(item, bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param identifier
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public boolean selectItem(String identifier){
|
public boolean selectItem(String identifier){
|
||||||
|
|
||||||
FileModel fileTarget = getFileModelByIdentifier(identifier);
|
FileModel fileTarget = getFileModelByIdentifier(identifier);
|
||||||
|
|
Loading…
Reference in New Issue