use of org.rstudio.core.client.command.CommandHandler 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);
}
});
}
});
}
});
}
Aggregations