use of com.google.gwt.core.client.RunAsyncCallback in project activityinfo by bedatadriven.
the class ConfigLoader method load.
@Override
public void load(final PageId pageId, final PageState place, final AsyncCallback<Page> callback) {
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess() {
final Page page = pageProviders.get(pageId).get();
if (page == null) {
callback.onFailure(new Exception("ConfigLoader didn't know how to handle " + place.toString()));
} else if (page instanceof DbPage) {
dispatch.execute(new GetSchema(), new AsyncCallback<SchemaDTO>() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess(SchemaDTO result) {
DbPageState dbPlace = (DbPageState) place;
((DbPage) page).go(result.getDatabaseById(dbPlace.getDatabaseId()));
callback.onSuccess(page);
}
});
} else {
page.navigate(place);
callback.onSuccess(page);
}
}
});
}
use of com.google.gwt.core.client.RunAsyncCallback in project pentaho-platform by pentaho.
the class PerspectiveManager method showSchedulesPerspective.
private void showSchedulesPerspective() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
DeckPanel contentDeck = MantleApplication.getInstance().getContentDeck();
if (MantleApplication.getInstance().getContentDeck().getWidgetIndex(SchedulesPerspectivePanel.getInstance()) == -1) {
contentDeck.add(SchedulesPerspectivePanel.getInstance());
} else {
SchedulesPerspectivePanel.getInstance().refresh();
}
contentDeck.showWidget(contentDeck.getWidgetIndex(SchedulesPerspectivePanel.getInstance()));
}
public void onFailure(Throwable reason) {
}
});
setCheckMMenuItem(false, true);
}
use of com.google.gwt.core.client.RunAsyncCallback in project pentaho-platform by pentaho.
the class RefreshSchedulesCommand method performOperation.
protected void performOperation(boolean feedback) {
try {
// $NON-NLS-1$
final String url = GWT.getHostPageBaseURL() + "api/repo/files/canAdminister";
RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, url);
requestBuilder.setHeader("accept", "text/plain");
requestBuilder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
requestBuilder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable caught) {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
SchedulesPerspectivePanel.getInstance().refresh();
}
public void onFailure(Throwable reason) {
}
});
}
public void onResponseReceived(Request request, final Response response) {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
SchedulesPerspectivePanel.getInstance().refresh();
}
public void onFailure(Throwable reason) {
}
});
}
});
} catch (RequestException e) {
Window.alert(e.getMessage());
}
}
Aggregations