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 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 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);
}
use of com.google.gwt.core.client.RunAsyncCallback in project activityinfo by bedatadriven.
the class LocalController method loadSynchronizerImpl.
private void loadSynchronizerImpl(final AsyncCallback<Synchronizer> callback) {
Log.trace("loadSynchronizerImpl() starting...");
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onFailure(Throwable throwable) {
Log.trace("loadSynchronizerImpl() failed");
callback.onFailure(throwable);
}
@Override
public void onSuccess() {
Log.trace("loadSynchronizerImpl() succeeded");
Synchronizer impl = null;
try {
impl = synchronizerProvider.get();
} catch (Exception caught) {
Log.error("SynchronizationImpl constructor threw exception", caught);
callback.onFailure(caught);
return;
}
callback.onSuccess(impl);
}
});
}
use of com.google.gwt.core.client.RunAsyncCallback in project activityinfo by bedatadriven.
the class FormPageLoader method load.
@Override
public void load(final PageId pageId, final PageState pageState, final AsyncCallback<Page> callback) {
BaseStylesheet.INSTANCE.ensureInjected();
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onSuccess() {
if (pageState instanceof ResourcePlace) {
ResourcePlace resourcePlace = (ResourcePlace) pageState;
ResourcePage page = new ResourcePage(eventBus, resourceLocator, resourcePlace.getPageId(), stateProvider);
page.navigate(pageState);
callback.onSuccess(page);
}
}
@Override
public void onFailure(Throwable throwable) {
callback.onFailure(throwable);
}
});
}
Aggregations