From 42713e33d56644f7298ad5046c0000d13da28cbd Mon Sep 17 00:00:00 2001 From: Loredana Liccardo Date: Wed, 9 Jul 2014 16:34:40 +0000 Subject: [PATCH] bugs fixed on result size equal to 0 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@98536 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/panels/GxtBorderLayoutPanel.java | 4 ++++ .../client/panels/GxtTreePanel.java | 22 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtBorderLayoutPanel.java b/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtBorderLayoutPanel.java index 9b5d8d6..a69d56c 100644 --- a/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtBorderLayoutPanel.java +++ b/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtBorderLayoutPanel.java @@ -1319,6 +1319,8 @@ public class GxtBorderLayoutPanel extends ContentPanel { // LinkedHashMap data = element.getDBInfo(); List dataDB = element.getDBInfo(); + + if (dataDB!=null){ // System.out.println("GxtBorderLayout->size info: " + dataDB.size()); @@ -1347,6 +1349,8 @@ public class GxtBorderLayoutPanel extends ContentPanel { centerUpper.add(grid); centerUpper.layout(true); + + } } diff --git a/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtTreePanel.java b/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtTreePanel.java index 75b3a71..080fb9c 100644 --- a/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtTreePanel.java +++ b/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtTreePanel.java @@ -349,10 +349,18 @@ public class GxtTreePanel extends LayoutContainer { } // int numChildrenFolder = store.getChildCount(element); - + + + addChildren(element, result); element.setIsLoaded(true); + + if (result.size()==0){ + element.setIsExpanded(false); + treePanel.setExpanded(element, false); + } + if (tree.isMasked()) tree.unmask(); @@ -554,6 +562,11 @@ public class GxtTreePanel extends LayoutContainer { // // fire event // eventBus.fireEvent(new DisplayDBInfoEvent()); + + if (result.size()==0){ + element.setIsExpanded(false); + treePanel.setExpanded(element, false); + } if (treePanel.isMasked()) treePanel.unmask(); @@ -629,6 +642,9 @@ public class GxtTreePanel extends LayoutContainer { // loadTables(element); rootLogger.log(Level.INFO, "the database has not schema"); + + element.setIsExpanded(false); + treePanel.setExpanded(element, false); } else { @@ -649,10 +665,12 @@ public class GxtTreePanel extends LayoutContainer { addChildren(element, result); - element.setIsLoaded(true); +// element.setIsLoaded(true); // } } + + element.setIsLoaded(true); if (treePanel.isMasked()) treePanel.unmask();