From 45bae9ec7dbdabb9328baf091aca61a7b0eafc02 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 24 Feb 2014 17:28:38 +0000 Subject: [PATCH] Minor Updated git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@92210 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/ColumnExpressionPanel.java | 34 +++++++++++-------- .../client/ConditionWidget.java | 14 ++++++-- .../client/MultiColumnFilterTabPanel.java | 13 ++----- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionPanel.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionPanel.java index fdefa16..90974a7 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionPanel.java @@ -20,6 +20,8 @@ import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer; import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign; 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; +import com.sencha.gxt.widget.core.client.event.BeforeShowEvent.BeforeShowHandler; import com.sencha.gxt.widget.core.client.event.SelectEvent; import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; import com.sencha.gxt.widget.core.client.form.FieldLabel; @@ -45,8 +47,7 @@ public class ColumnExpressionPanel extends FramedPanel { protected ColumnExpressionDialog parentRuleDialog; protected ColumnFilterDialog parentFilterDialog; protected MultiColumnFilterTabPanel parentMultiColumnFilterTabPanel; - - + protected ColumnData column; protected ConditionWidget conditionWidget; @@ -55,7 +56,8 @@ public class ColumnExpressionPanel extends FramedPanel { private TextButton btnSave; private TextButton btnClose; - public ColumnExpressionPanel(MultiColumnFilterTabPanel parentMultiColumnFilterTabPanel, + public ColumnExpressionPanel( + MultiColumnFilterTabPanel parentMultiColumnFilterTabPanel, ColumnData column, EventBus eventBus) { super(); type = ColumnExpressionPanelType.MultiColumnFilter; @@ -66,7 +68,7 @@ public class ColumnExpressionPanel extends FramedPanel { create(); } - + public ColumnExpressionPanel(ColumnFilterDialog parentFilterDialog, ColumnData column, EventBus eventBus) { super(); @@ -99,7 +101,7 @@ public class ColumnExpressionPanel extends FramedPanel { protected void create() { setBodyBorder(false); setHeaderVisible(false); - + VerticalLayoutContainer basicLayout = new VerticalLayoutContainer(); basicLayout.setScrollMode(ScrollMode.AUTO); basicLayout.setAdjustForScroll(true); @@ -293,8 +295,19 @@ public class ColumnExpressionPanel extends FramedPanel { basicLayout.add(flowButton, new VerticalLayoutData(1, -1, new Margins( 5, 2, 5, 2))); add(basicLayout); + + + + addBeforeShowHandler(new BeforeShowHandler() { + + @Override + public void onBeforeShow(BeforeShowEvent event) { + conditionWidget.forceLayout(); + + } + }); + show(); - } protected void applyRule() { @@ -321,16 +334,11 @@ public class ColumnExpressionPanel extends FramedPanel { parentFilterDialog.applyFilter(exp); break; case MultiColumnFilter: - parentMultiColumnFilterTabPanel.applyFilter(column,exp); + parentMultiColumnFilterTabPanel.applyFilter(column, exp); break; default: break; } - - - - - } @@ -362,6 +370,4 @@ public class ColumnExpressionPanel extends FramedPanel { } - - } 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 8b731c5..1489d3c 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 @@ -32,6 +32,7 @@ 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.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; +import com.sencha.gxt.widget.core.client.event.BeforeShowEvent; import com.sencha.gxt.widget.core.client.form.ComboBox; import com.sencha.gxt.widget.core.client.form.FieldLabel; import com.sencha.gxt.widget.core.client.form.Radio; @@ -111,6 +112,7 @@ public class ConditionWidget extends SimpleContainer { baseLayout.add(vert, new VerticalLayoutData(-1, -1, new Margins(0))); add(baseLayout); show(); + } @@ -176,7 +178,7 @@ public class ConditionWidget extends SimpleContainer { Log.debug("Store created"); ComboBox comboOp = new ComboBox(storeOp, props.label()); - + Log.debug("Combo created"); comboOp.addSelectionHandler(new SelectionHandler() { @@ -251,7 +253,15 @@ public class ConditionWidget extends SimpleContainer { horiz.add(btnDel, new BoxLayoutData(new Margins(2, 0, 2, 0))); vert.add(horiz, new VerticalLayoutData(-1, -1, new Margins(1))); - + + addBeforeShowHandler(new BeforeShowEvent.BeforeShowHandler() { + + @Override + public void onBeforeShow(BeforeShowEvent event) { + forceLayout(); + + } + }); } diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/MultiColumnFilterTabPanel.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/MultiColumnFilterTabPanel.java index 6055d53..3fae2d9 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/MultiColumnFilterTabPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/MultiColumnFilterTabPanel.java @@ -68,19 +68,10 @@ public class MultiColumnFilterTabPanel extends TabPanel { ColumnTypeCode.CODENAME.toString()) == 0 || col.getTypeCode().compareTo( ColumnTypeCode.MEASURE.toString()) == 0) { - final ColumnExpressionPanel columnExpressionPanel = new ColumnExpressionPanel(this, col, - eventBus); + final ColumnExpressionPanel columnExpressionPanel = new ColumnExpressionPanel( + this, col, eventBus); add(columnExpressionPanel, columnFilterItemConf); - columnExpressionPanel - .addBeforeShowHandler(new BeforeShowHandler() { - - @Override - public void onBeforeShow(BeforeShowEvent event) { - columnExpressionPanel.forceLayout(); - - } - }); } else { }