diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionDialog.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionDialog.java index eda712c..4b3592a 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionDialog.java @@ -3,6 +3,8 @@ package org.gcube.portlets.user.td.expressionwidget.client; import org.gcube.portlets.user.td.expressionwidget.client.resource.ExpressionResources; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; +import org.gcube.portlets.user.td.widgetcommonevent.client.event.ExpressionEvent; +import org.gcube.portlets.user.td.widgetcommonevent.client.type.ExpressionType; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; @@ -15,7 +17,9 @@ import com.google.web.bindery.event.shared.EventBus; import com.sencha.gxt.widget.core.client.Window; import com.sencha.gxt.widget.core.client.box.AlertMessageBox; import com.sencha.gxt.widget.core.client.event.HideEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent; import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; /** * @@ -62,12 +66,38 @@ public class ColumnExpressionDialog extends Window { setBodyBorder(false); setResizable(false); setHeadingText("New Rule"); - setClosable(false); + setClosable(true); setModal(true); forceLayoutOnResize = true; getHeader().setIcon(ExpressionResources.INSTANCE.rule()); } + + /** + * {@inheritDoc} + */ + @Override + protected void initTools() { + super.initTools(); + + closeBtn.addSelectHandler(new SelectHandler() { + + + public void onSelect(SelectEvent event) { + close(); + } + }); + + } + + protected void close (){ + ExpressionEvent expressionEvent = new ExpressionEvent( + ExpressionType.EXPRESSIONNULL); + Log.debug(expressionEvent.toString()); + hide(); + eventBus.fireEvent(expressionEvent); + } + protected void create() { if (column.getTypeCode() diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnFilterDialog.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnFilterDialog.java index fc81c5b..372e0bd 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnFilterDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnFilterDialog.java @@ -18,7 +18,9 @@ import com.google.web.bindery.event.shared.EventBus; import com.sencha.gxt.widget.core.client.Window; import com.sencha.gxt.widget.core.client.box.AlertMessageBox; import com.sencha.gxt.widget.core.client.event.HideEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent; import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; /** @@ -66,10 +68,27 @@ public class ColumnFilterDialog extends Window { setBodyBorder(false); setResizable(false); setHeadingText("New Filter"); - setClosable(false); + setClosable(true); getHeader().setIcon(ExpressionResources.INSTANCE.filter()); } + + /** + * {@inheritDoc} + */ + @Override + protected void initTools() { + super.initTools(); + + closeBtn.addSelectHandler(new SelectHandler() { + + + public void onSelect(SelectEvent event) { + close(); + } + }); + + } protected void create() { if (column.getTypeCode() diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/MultiColumnFilterDialog.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/MultiColumnFilterDialog.java index ec6b523..bb49ae3 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/MultiColumnFilterDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/MultiColumnFilterDialog.java @@ -6,6 +6,8 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi import com.google.web.bindery.event.shared.EventBus; import com.sencha.gxt.widget.core.client.Window; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; /** @@ -46,7 +48,25 @@ public class MultiColumnFilterDialog extends Window { } + /** + * {@inheritDoc} + */ + @Override + protected void initTools() { + super.initTools(); + + closeBtn.addSelectHandler(new SelectHandler() { + + + public void onSelect(SelectEvent event) { + close(); + } + }); + + } - + protected void close() { + hide(); + } }