Search in sources :

Example 1 with RequestLogVisualization

use of org.rstudio.studio.client.application.ui.RequestLogVisualization 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);
                        }
                    });
                }
            });
        }
    });
}
Also used : AppCommand(org.rstudio.core.client.command.AppCommand) RequestLogVisualization(org.rstudio.studio.client.application.ui.RequestLogVisualization) RunAsyncCallback(com.google.gwt.core.client.RunAsyncCallback) CommandHandler(org.rstudio.core.client.command.CommandHandler) RootLayoutPanel(com.google.gwt.user.client.ui.RootLayoutPanel)

Aggregations

RunAsyncCallback (com.google.gwt.core.client.RunAsyncCallback)1 RootLayoutPanel (com.google.gwt.user.client.ui.RootLayoutPanel)1 AppCommand (org.rstudio.core.client.command.AppCommand)1 CommandHandler (org.rstudio.core.client.command.CommandHandler)1 RequestLogVisualization (org.rstudio.studio.client.application.ui.RequestLogVisualization)1