use of com.google.gwt.user.client.ui.RootLayoutPanel 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.user.client.ui.RootLayoutPanel in project rstudio by rstudio.
the class RStudio method showProgress.
private Command showProgress() {
final Label background = new Label();
background.getElement().getStyle().setZIndex(1000);
background.getElement().getStyle().setBackgroundColor("#e1e2e5");
final RootLayoutPanel rootPanel = RootLayoutPanel.get();
rootPanel.add(background);
rootPanel.setWidgetTopBottom(background, 0, Style.Unit.PX, 0, Style.Unit.PX);
rootPanel.setWidgetLeftRight(background, 0, Style.Unit.PX, 0, Style.Unit.PX);
String progressUrl = ProgressImages.createLargeGray().getUrl();
StringBuilder str = new StringBuilder();
str.append("<img src=\"");
str.append(progressUrl);
str.append("\"");
if (BrowseCap.devicePixelRatio() > 1.0)
str.append("width=24 height=24");
str.append("/>");
final SimplePanel progressPanel = new SimplePanel();
final Element div = progressPanel.getElement();
div.setInnerHTML(str.toString());
div.getStyle().setWidth(100, Style.Unit.PCT);
div.getStyle().setMarginTop(200, Style.Unit.PX);
div.getStyle().setProperty("textAlign", "center");
div.getStyle().setZIndex(1000);
ElementIds.assignElementId(div, ElementIds.LOADING_SPINNER);
rootPanel.add(progressPanel);
return new Command() {
public void execute() {
try {
rootPanel.remove(progressPanel);
rootPanel.remove(background);
} catch (Exception e) {
Debug.log(e.toString());
}
}
};
}
Aggregations