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:
parent
2e902b3a79
commit
de664ce16d
|
@ -11,7 +11,10 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.Callback;
|
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.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.gwt.user.client.ui.Widget;
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
import com.google.web.bindery.event.shared.SimpleEventBus;
|
import com.google.web.bindery.event.shared.SimpleEventBus;
|
||||||
|
@ -42,10 +45,9 @@ public class WizardWindow extends Window {
|
||||||
protected String WIZARDHEIGHT = "520px";
|
protected String WIZARDHEIGHT = "520px";
|
||||||
protected boolean WIZARRESIZABLE = false;
|
protected boolean WIZARRESIZABLE = false;
|
||||||
protected boolean WIZARDCOLLAPSIBLE = true;
|
protected boolean WIZARDCOLLAPSIBLE = true;
|
||||||
protected String BUTTONBACKLABEL="Back";
|
protected String BUTTONBACKLABEL = "Back";
|
||||||
protected String BUTTONNEXTLABEL="Next";
|
protected String BUTTONNEXTLABEL = "Next";
|
||||||
protected String BUTTONFINISHLABEL="Finish";
|
protected String BUTTONFINISHLABEL = "Finish";
|
||||||
|
|
||||||
|
|
||||||
protected ArrayList<WizardCard> cardStack = new ArrayList<WizardCard>();
|
protected ArrayList<WizardCard> cardStack = new ArrayList<WizardCard>();
|
||||||
|
|
||||||
|
@ -114,9 +116,9 @@ public class WizardWindow extends Window {
|
||||||
|
|
||||||
backButton.setEnabled(false);
|
backButton.setEnabled(false);
|
||||||
backButton.setTabIndex(1001);
|
backButton.setTabIndex(1001);
|
||||||
cardMoveToolBar.add(backButton,new BoxLayoutData(new Margins(1)));
|
cardMoveToolBar.add(backButton, new BoxLayoutData(new Margins(1)));
|
||||||
|
|
||||||
fillSpacingCardMoveToolBar=new FillToolItem();
|
fillSpacingCardMoveToolBar = new FillToolItem();
|
||||||
|
|
||||||
cardMoveToolBar.add(fillSpacingCardMoveToolBar);
|
cardMoveToolBar.add(fillSpacingCardMoveToolBar);
|
||||||
|
|
||||||
|
@ -131,7 +133,6 @@ public class WizardWindow extends Window {
|
||||||
|
|
||||||
SelectHandler selectionHandler = new SelectHandler() {
|
SelectHandler selectionHandler = new SelectHandler() {
|
||||||
|
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
TextButton button = (TextButton) event.getSource();
|
TextButton button = (TextButton) event.getSource();
|
||||||
String btnID = button.getId();
|
String btnID = button.getId();
|
||||||
|
@ -159,7 +160,6 @@ public class WizardWindow extends Window {
|
||||||
setWidget(container);
|
setWidget(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -169,7 +169,6 @@ public class WizardWindow extends Window {
|
||||||
|
|
||||||
closeBtn.addSelectHandler(new SelectHandler() {
|
closeBtn.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
fireAborted();
|
fireAborted();
|
||||||
hide();
|
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) {
|
public void addListener(WizardListener listener) {
|
||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
}
|
}
|
||||||
|
@ -452,7 +465,7 @@ public class WizardWindow extends Window {
|
||||||
|
|
||||||
public void showErrorAndHide(final String title, final String message,
|
public void showErrorAndHide(final String title, final String message,
|
||||||
final Throwable throwable) {
|
final Throwable throwable) {
|
||||||
UtilsGXT3.alert(title, message, new Callback<Component,Void>() {
|
UtilsGXT3.alert(title, message, new Callback<Component, Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Void reason) {
|
public void onFailure(Void reason) {
|
||||||
|
@ -482,7 +495,6 @@ public class WizardWindow extends Window {
|
||||||
listener.putInBackground();
|
listener.putInBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void fireAborted() {
|
public void fireAborted() {
|
||||||
for (WizardListener listener : listeners)
|
for (WizardListener listener : listeners)
|
||||||
listener.aborted();
|
listener.aborted();
|
||||||
|
|
Loading…
Reference in New Issue