Fixed OnEsc error

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-wizard-widget@101670 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-11-21 11:11:36 +00:00 committed by Giancarlo Panichi
parent 2e902b3a79
commit de664ce16d
1 changed files with 39 additions and 27 deletions

View File

@ -11,7 +11,10 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.Callback;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Widget;
import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;
@ -46,7 +49,6 @@ public class WizardWindow extends Window {
protected String BUTTONNEXTLABEL = "Next";
protected String BUTTONFINISHLABEL = "Finish";
protected ArrayList<WizardCard> cardStack = new ArrayList<WizardCard>();
protected TextButton backButton;
@ -131,7 +133,6 @@ public class WizardWindow extends Window {
SelectHandler selectionHandler = new SelectHandler() {
public void onSelect(SelectEvent event) {
TextButton button = (TextButton) event.getSource();
String btnID = button.getId();
@ -159,7 +160,6 @@ public class WizardWindow extends Window {
setWidget(container);
}
/**
* {@inheritDoc}
*/
@ -169,7 +169,6 @@ public class WizardWindow extends Window {
closeBtn.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
fireAborted();
hide();
@ -178,6 +177,20 @@ public class WizardWindow extends Window {
}
@Override
protected void onKeyPress(Event we) {
int keyCode = we.getKeyCode();
boolean t = getElement().isOrHasChild(
we.getEventTarget().<Element> cast());
boolean key = true;
if (key && super.isClosable() && super.isOnEsc() && keyCode == KeyCodes.KEY_ESCAPE && t) {
fireAborted();
hide();
}
}
public void addListener(WizardListener listener) {
listeners.add(listener);
}
@ -482,7 +495,6 @@ public class WizardWindow extends Window {
listener.putInBackground();
}
public void fireAborted() {
for (WizardListener listener : listeners)
listener.aborted();