use of com.google.gwt.core.client.RunAsyncCallback in project rstudio by rstudio.
the class SatelliteApplication method initialize.
public void initialize(String name, SatelliteApplicationView view, Satellite satellite, Provider<AceThemes> pAceThemes, ApplicationUncaughtExceptionHandler uncaughtExHandler, Commands commands) {
name_ = name;
view_ = view;
satellite_ = satellite;
pAceThemes_ = pAceThemes;
uncaughtExHandler_ = uncaughtExHandler;
commands.showRequestLog().addHandler(new CommandHandler() {
public void onCommand(AppCommand command) {
GWT.runAsync(new RunAsyncCallback() {
public void onFailure(Throwable reason) {
Window.alert(reason.toString());
}
public void onSuccess() {
final RequestLogVisualization viz = new RequestLogVisualization();
final RootLayoutPanel root = RootLayoutPanel.get();
root.add(viz);
root.setWidgetTopBottom(viz, 10, Unit.PX, 10, Unit.PX);
root.setWidgetLeftRight(viz, 10, Unit.PX, 10, Unit.PX);
viz.addCloseHandler(new CloseHandler<RequestLogVisualization>() {
public void onClose(CloseEvent<RequestLogVisualization> event) {
root.remove(viz);
}
});
}
});
}
});
}
use of com.google.gwt.core.client.RunAsyncCallback in project pentaho-platform by pentaho.
the class MantleController method activateWaitingSecurityPanel.
public void activateWaitingSecurityPanel(boolean activate) {
if (activate && (adminPanelAwaitingActivation != null)) {
for (int i = 0; i < MantleXul.getInstance().getAdminContentDeck().getWidgetCount(); i++) {
Widget w = MantleXul.getInstance().getAdminContentDeck().getWidget(i);
if (adminPanelAwaitingActivation.id.equals(w.getElement().getId())) {
ISysAdminPanel sysAdminPanel = sysAdminPanelsMap.get(adminPanelAwaitingActivation.id);
if (sysAdminPanel != null) {
sysAdminPanel.activate();
}
break;
}
}
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
if (UserRolesAdminPanelController.getInstance().getId().equals(adminPanelAwaitingActivation.id)) {
model.loadUserRolesAdminPanel();
UserRolesAdminPanelController.getInstance().getElement().setId((UserRolesAdminPanelController.getInstance()).getId());
} else if ((EmailAdminPanelController.getInstance()).getId().equals(adminPanelAwaitingActivation.id)) {
model.loadEmailAdminPanel();
EmailAdminPanelController.getInstance().getElement().setId((EmailAdminPanelController.getInstance()).getId());
} else if ((ContentCleanerPanel.getInstance()).getId().equals(adminPanelAwaitingActivation.id)) {
model.loadSettingsPanel();
ContentCleanerPanel.getInstance().getElement().setId((ContentCleanerPanel.getInstance()).getId());
} else {
model.loadAdminContent(adminPanelAwaitingActivation.id, adminPanelAwaitingActivation.url);
}
}
public void onFailure(Throwable reason) {
}
});
} else if (!activate) {
adminPanelAwaitingActivation = null;
}
}
use of com.google.gwt.core.client.RunAsyncCallback in project activityinfo by bedatadriven.
the class ReportLoader method load.
@Override
public void load(final PageId pageId, final PageState pageState, final AsyncCallback<Page> callback) {
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onFailure(Throwable reason) {
callback.onFailure(reason);
}
@Override
public void onSuccess() {
if (ReportsPage.PAGE_ID.equals(pageId)) {
callback.onSuccess(reportsPage.get());
} else if (ReportDesignPage.PAGE_ID.equals(pageId)) {
ReportDesignPage page = reportDesignPage.get();
page.navigate(pageState);
callback.onSuccess(page);
} else {
GWT.log("ReportLoader received a request it didn't know how to handle: " + pageState.toString(), null);
}
}
});
}
use of com.google.gwt.core.client.RunAsyncCallback in project gwt-test-utils by gwt-test-utils.
the class MainGwtTest method runAsync.
@Test
public void runAsync() {
// Test
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onFailure(Throwable reason) {
fail("GWT.runAsync() has called \"onFailure\" callback");
}
@Override
public void onSuccess() {
success = true;
}
});
// Then
assertThat(success).isTrue();
}
use of com.google.gwt.core.client.RunAsyncCallback in project rstudio by rstudio.
the class RStudio method delayLoadApplication.
private void delayLoadApplication(final Command dismissProgressAnimation) {
final RunAsyncCallback runCallback = new RunAsyncCallback() {
public void onFailure(Throwable reason) {
dismissProgressAnimation.execute();
Window.alert("Error: " + reason.getMessage());
}
public void onSuccess() {
// TODO (gary) This early loading of XTermWidget dependencies needs to be
// removed once I figure out why XTermWidget.load in
// TerminalPane:createMainWidget) isn't sufficient. Suspect due to xterm.js
// loading its add-ons (fit.js) but need to investigate.
XTermWidget.load(new Command() {
public void execute() {
AceEditor.load(new Command() {
public void execute() {
ensureStylesInjected();
String view = Window.Location.getParameter("view");
if (VCSApplication.NAME.equals(view)) {
RStudioGinjector.INSTANCE.getVCSApplication().go(RootLayoutPanel.get(), dismissProgressAnimation);
} else if (HTMLPreviewApplication.NAME.equals(view)) {
RStudioGinjector.INSTANCE.getHTMLPreviewApplication().go(RootLayoutPanel.get(), dismissProgressAnimation);
} else if (ShinyApplicationSatellite.NAME.equals(view)) {
RStudioGinjector.INSTANCE.getShinyApplicationSatellite().go(RootLayoutPanel.get(), dismissProgressAnimation);
} else if (RmdOutputSatellite.NAME.equals(view)) {
RStudioGinjector.INSTANCE.getRmdOutputSatellite().go(RootLayoutPanel.get(), dismissProgressAnimation);
} else if (view != null && view.startsWith(SourceSatellite.NAME_PREFIX)) {
SourceSatellite satellite = new SourceSatellite(view);
satellite.go(RootLayoutPanel.get(), dismissProgressAnimation);
} else if (view != null && view.startsWith(ChunkSatellite.NAME_PREFIX)) {
ChunkSatellite satellite = new ChunkSatellite(view);
satellite.go(RootLayoutPanel.get(), dismissProgressAnimation);
} else {
RStudioGinjector.INSTANCE.getApplication().go(RootLayoutPanel.get(), dismissProgressAnimation);
}
}
});
}
});
}
};
GWT.runAsync(runCallback);
}
Aggregations