Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-wizard-widget@115565 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-06-25 16:33:11 +00:00 committed by Giancarlo Panichi
parent 6bda77cd3e
commit eeaf919122
1 changed files with 22 additions and 28 deletions

View File

@ -76,7 +76,6 @@ public class WizardWindow extends Window {
protected FillToolItem fillSpacingCardMoveToolBar; protected FillToolItem fillSpacingCardMoveToolBar;
/** /**
* Create a new Wizard Window with the specified title. * Create a new Wizard Window with the specified title.
* *
@ -90,7 +89,7 @@ public class WizardWindow extends Window {
public WizardWindow(String title, EventBus eventBus) { public WizardWindow(String title, EventBus eventBus) {
super(); super();
this.title=title; this.title = title;
this.eventBus = eventBus; this.eventBus = eventBus;
initWindow(); initWindow();
@ -186,12 +185,12 @@ public class WizardWindow extends Window {
protected void onKeyPress(Event we) { protected void onKeyPress(Event we) {
int keyCode = we.getKeyCode(); int keyCode = we.getKeyCode();
// Use Element: import com.google.gwt.dom.client.Element;
//Use Element: import com.google.gwt.dom.client.Element;
boolean t = getElement().isOrHasChild( boolean t = getElement().isOrHasChild(
we.getEventTarget().<Element> cast()); we.getEventTarget().<Element> cast());
boolean key = true; boolean key = true;
if (key && super.isClosable() && super.isOnEsc() && keyCode == KeyCodes.KEY_ESCAPE && t) { if (key && super.isClosable() && super.isOnEsc()
&& keyCode == KeyCodes.KEY_ESCAPE && t) {
fireAborted(); fireAborted();
hide(); hide();
} }
@ -299,10 +298,6 @@ public class WizardWindow extends Window {
hide(); hide();
} }
public EventBus getEventBus(){
return eventBus;
}
/** /**
* Sets the label of next button to "Finish" value and add a close command * Sets the label of next button to "Finish" value and add a close command
* to it. * to it.
@ -476,23 +471,24 @@ public class WizardWindow extends Window {
public void showErrorAndHide(final String title, final String message, public void showErrorAndHide(final String title, final String message,
final String details, final Throwable throwable) { final String details, final Throwable throwable) {
UtilsGXT3.alert(title, message+" "+details, new Callback<Component, Void>() { UtilsGXT3.alert(title, message + " " + details,
new Callback<Component, Void>() {
@Override @Override
public void onFailure(Void reason) { public void onFailure(Void reason) {
hide(); hide();
fireFailed(title, message, details, throwable); fireFailed(title, message, details, throwable);
} }
@Override @Override
public void onSuccess(Component result) { public void onSuccess(Component result) {
hide(); hide();
fireAborted(); fireAborted();
} }
}); });
} }
@ -511,12 +507,10 @@ public class WizardWindow extends Window {
listener.aborted(); listener.aborted();
} }
public void fireFailed(String title, String message, String details, Throwable throwable) { public void fireFailed(String title, String message, String details,
Throwable throwable) {
for (WizardListener listener : listeners) for (WizardListener listener : listeners)
listener.failed(title, message, details, throwable); listener.failed(title, message, details, throwable);
} }
} }