From 08b43ede6eed7f7b325cd3e0d37b1168ece4adc8 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 27 Feb 2014 10:56:43 +0000 Subject: [PATCH] Fixed Scroll Bar on ConditionWidget git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@92406 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/ConditionWidget.java | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ConditionWidget.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ConditionWidget.java index 19f6fc9..5dd98eb 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ConditionWidget.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ConditionWidget.java @@ -30,6 +30,7 @@ import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer; import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; import com.sencha.gxt.widget.core.client.event.BeforeShowEvent; @@ -78,7 +79,10 @@ public class ConditionWidget extends SimpleContainer { itemIdBtnDel = "BtnDel"+column.getName(); VerticalLayoutContainer baseLayout = new VerticalLayoutContainer(); - + //baseLayout.setAdjustForScroll(true); + //baseLayout.setScrollMode(ScrollMode.AUTOY); + //baseLayout.getScrollSupport().setScrollMode(ScrollMode.AUTO); + Radio radioAll = new Radio(); radioAll.setName("All"); radioAll.setBoxLabel("All conditions"); @@ -106,11 +110,22 @@ public class ConditionWidget extends SimpleContainer { vert = new VerticalLayoutContainer(); vert.setScrollMode(ScrollMode.AUTO); vert.setAdjustForScroll(true); + /*if(baseLayout.getScrollSupport()==null){ + Log.error("ScrollSupport is null"); + } else { + Log.info("ScrollSupport:"+baseLayout.getScrollSupport()); + baseLayout.getScrollSupport().setScrollMode(ScrollMode.AUTO); + }*/ + setup(); - baseLayout.add(vert, new VerticalLayoutData(-1, -1, new Margins(0))); + baseLayout.add(vert, new VerticalLayoutData(1, 1, new Margins(0))); + add(baseLayout); + + + show(); @@ -141,6 +156,7 @@ public class ConditionWidget extends SimpleContainer { matchLabel.setVisible(true); addCondition(); thisCont.forceLayout(); + vert.forceLayout(); } }); @@ -163,6 +179,7 @@ public class ConditionWidget extends SimpleContainer { } } thisCont.forceLayout(); + vert.forceLayout(); } }); @@ -252,7 +269,7 @@ public class ConditionWidget extends SimpleContainer { horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 0, 2, 0))); horiz.add(btnDel, new BoxLayoutData(new Margins(2, 0, 2, 0))); - vert.add(horiz, new VerticalLayoutData(-1, -1, new Margins(1))); + vert.add(horiz, new VerticalLayoutData(-1,-1,new Margins(1))); addBeforeShowHandler(new BeforeShowEvent.BeforeShowHandler() { @@ -262,6 +279,9 @@ public class ConditionWidget extends SimpleContainer { } }); + + + } @@ -292,6 +312,7 @@ public class ConditionWidget extends SimpleContainer { matchLabel.setVisible(true); addCondition(); thisCont.forceLayout(); + vert.forceLayout(); } }); btnAdd.setVisible(false); @@ -313,6 +334,7 @@ public class ConditionWidget extends SimpleContainer { } } thisCont.forceLayout(); + vert.forceLayout(); } }); @@ -400,9 +422,9 @@ public class ConditionWidget extends SimpleContainer { horiz.add(secondArg, new BoxLayoutData(new Margins(0))); horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 0, 2, 0))); horiz.add(btnDel, new BoxLayoutData(new Margins(2, 0, 2, 0))); - - vert.add(horiz, new VerticalLayoutData(-1, -1, new Margins(1))); - + + vert.add(horiz, new VerticalLayoutData(-1,-1,new Margins(1))); + } public C_Expression getExpression() {