Fixed close button

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@93147 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-14 17:48:30 +00:00
parent de4d3ae3e3
commit bc0cbdd652
3 changed files with 72 additions and 3 deletions

View File

@ -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.expressionwidget.client.resource.ExpressionResources;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; 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.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.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression; import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; 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.Window;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox; 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.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.HideEvent.HideHandler;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/** /**
* *
@ -62,12 +66,38 @@ public class ColumnExpressionDialog extends Window {
setBodyBorder(false); setBodyBorder(false);
setResizable(false); setResizable(false);
setHeadingText("New Rule"); setHeadingText("New Rule");
setClosable(false); setClosable(true);
setModal(true); setModal(true);
forceLayoutOnResize = true; forceLayoutOnResize = true;
getHeader().setIcon(ExpressionResources.INSTANCE.rule()); 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() { protected void create() {
if (column.getTypeCode() if (column.getTypeCode()

View File

@ -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.Window;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox; 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.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.HideEvent.HideHandler;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/** /**
@ -66,10 +68,27 @@ public class ColumnFilterDialog extends Window {
setBodyBorder(false); setBodyBorder(false);
setResizable(false); setResizable(false);
setHeadingText("New Filter"); setHeadingText("New Filter");
setClosable(false); setClosable(true);
getHeader().setIcon(ExpressionResources.INSTANCE.filter()); 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() { protected void create() {
if (column.getTypeCode() if (column.getTypeCode()

View File

@ -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.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window; 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();
}
} }