Search in sources :

Example 1 with LayoutPanel

use of com.google.gwt.user.client.ui.LayoutPanel in project rstudio by rstudio.

the class PackagesPane method createMainWidget.

@Override
protected Widget createMainWidget() {
    packagesDataProvider_ = new ListDataProvider<PackageInfo>();
    packagesTableContainer_ = new LayoutPanel();
    return packagesTableContainer_;
}
Also used : PackageInfo(org.rstudio.studio.client.workbench.views.packages.model.PackageInfo) LayoutPanel(com.google.gwt.user.client.ui.LayoutPanel)

Example 2 with LayoutPanel

use of com.google.gwt.user.client.ui.LayoutPanel in project rstudio by rstudio.

the class FullscreenPopupPanel method addCloseButton.

private void addCloseButton(NineUpBorder border) {
    Image closeIcon = new Image(new ImageResource2x(RES.close2x()));
    closeIcon.getElement().getStyle().setCursor(Style.Cursor.POINTER);
    closeIcon.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            close();
        }
    });
    LayoutPanel layoutPanel = border.getLayoutPanel();
    layoutPanel.add(closeIcon);
    layoutPanel.setWidgetTopHeight(closeIcon, 15, Unit.PX, closeIcon.getHeight(), Unit.PX);
    layoutPanel.setWidgetRightWidth(closeIcon, 27, Unit.PX, closeIcon.getWidth(), Unit.PX);
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Image(com.google.gwt.user.client.ui.Image) LayoutPanel(com.google.gwt.user.client.ui.LayoutPanel)

Example 3 with LayoutPanel

use of com.google.gwt.user.client.ui.LayoutPanel in project rstudio by rstudio.

the class FullscreenPopupPanel method addTitleWidget.

private void addTitleWidget(NineUpBorder border, Widget titleWidget) {
    LayoutPanel layoutPanel = border.getLayoutPanel();
    layoutPanel.add(titleWidget);
    layoutPanel.setWidgetTopHeight(titleWidget, 13, Unit.PX, 21, Unit.PX);
    layoutPanel.setWidgetLeftRight(titleWidget, 27, Unit.PX, 27 + RES.close2x().getWidth() + 15, Unit.PX);
}
Also used : LayoutPanel(com.google.gwt.user.client.ui.LayoutPanel)

Example 4 with LayoutPanel

use of com.google.gwt.user.client.ui.LayoutPanel in project rstudio by rstudio.

the class Wizard method createMainWidget.

@Override
protected Widget createMainWidget() {
    WizardResources res = WizardResources.INSTANCE;
    WizardResources.Styles styles = res.styles();
    VerticalPanel mainWidget = new VerticalPanel();
    mainWidget.addStyleName(getMainWidgetStyle());
    headerPanel_ = new LayoutPanel();
    headerPanel_.addStyleName(styles.headerPanel());
    // layout constants
    final int kTopMargin = 5;
    final int kLeftMargin = 8;
    final int kCaptionWidth = 400;
    final int kCaptionHeight = 30;
    final int kPageUILeftMargin = 123;
    // first page caption
    subCaptionLabel_ = new Label(firstPage_.getPageCaption());
    subCaptionLabel_.addStyleName(styles.headerLabel());
    headerPanel_.add(subCaptionLabel_);
    headerPanel_.setWidgetLeftWidth(subCaptionLabel_, kTopMargin, Unit.PX, kCaptionWidth, Unit.PX);
    headerPanel_.setWidgetTopHeight(subCaptionLabel_, kLeftMargin, Unit.PX, kCaptionHeight, Unit.PX);
    // second page back button
    ImageResource bkImg = res.wizardBackButton();
    backButton_ = new Label("Back");
    backButton_.addStyleName(styles.wizardBackButton());
    backButton_.addStyleName(ThemeResources.INSTANCE.themeStyles().handCursor());
    headerPanel_.add(backButton_);
    headerPanel_.setWidgetLeftWidth(backButton_, kTopMargin - 2, Unit.PX, bkImg.getWidth(), Unit.PX);
    headerPanel_.setWidgetTopHeight(backButton_, kTopMargin - 2, Unit.PX, bkImg.getHeight(), Unit.PX);
    backButton_.setVisible(false);
    backButton_.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            goBack();
        }
    });
    // second page caption label
    pageCaptionLabel_ = new Label();
    pageCaptionLabel_.addStyleName(styles.headerLabel());
    headerPanel_.add(pageCaptionLabel_);
    headerPanel_.setWidgetLeftWidth(pageCaptionLabel_, kPageUILeftMargin, Unit.PX, kCaptionWidth, Unit.PX);
    headerPanel_.setWidgetTopHeight(pageCaptionLabel_, kLeftMargin, Unit.PX, kCaptionHeight, Unit.PX);
    pageCaptionLabel_.setVisible(false);
    mainWidget.add(headerPanel_);
    // main body panel for transitions
    bodyPanel_ = new LayoutPanel();
    ArrayList<String> wizardBodyStyles = getWizardBodyStyles();
    for (String styleName : wizardBodyStyles) bodyPanel_.addStyleName(styleName);
    bodyPanel_.getElement().getStyle().setProperty("overflowX", "hidden");
    mainWidget.add(bodyPanel_);
    // add first page (and all sub-pages recursively)
    addAndInitializePage(firstPage_, true);
    setNextButtonState(firstPage_);
    return mainWidget;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ImageResource(com.google.gwt.resources.client.ImageResource) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Label(com.google.gwt.user.client.ui.Label) LayoutPanel(com.google.gwt.user.client.ui.LayoutPanel)

Example 5 with LayoutPanel

use of com.google.gwt.user.client.ui.LayoutPanel in project rstudio by rstudio.

the class PlotsPane method createMainWidget.

@Override
protected Widget createMainWidget() {
    panel_ = new LayoutPanel();
    panel_.setSize("100%", "100%");
    frame_ = new ImageFrame();
    frame_.setStyleName("rstudio-HelpFrame");
    frame_.setMarginWidth(0);
    frame_.setMarginHeight(0);
    frame_.setUrl("about:blank");
    frame_.setSize("100%", "100%");
    ElementIds.assignElementId(frame_.getElement(), ElementIds.PLOT_IMAGE_FRAME);
    panel_.add(frame_);
    panel_.setWidgetTopBottom(frame_, 0, Unit.PX, 0, Unit.PX);
    panel_.setWidgetLeftRight(frame_, 0, Unit.PX, 0, Unit.PX);
    // Stops mouse events from being routed to the iframe, which would
    // interfere with dragging the workbench pane sizer. also provide
    // a widget container where adornments can be added on top fo the
    // plots panel (e.g. manipulator button)
    plotsSurface_ = new FlowPanel();
    plotsSurface_.setSize("100%", "100%");
    panel_.add(plotsSurface_);
    panel_.setWidgetTopBottom(plotsSurface_, 0, Unit.PX, 0, Unit.PX);
    panel_.setWidgetLeftRight(plotsSurface_, 0, Unit.PX, 0, Unit.PX);
    // return the panel
    return panel_;
}
Also used : ImageFrame(org.rstudio.core.client.widget.ImageFrame) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) LayoutPanel(com.google.gwt.user.client.ui.LayoutPanel)

Aggregations

LayoutPanel (com.google.gwt.user.client.ui.LayoutPanel)5 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 ImageResource (com.google.gwt.resources.client.ImageResource)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 Image (com.google.gwt.user.client.ui.Image)1 Label (com.google.gwt.user.client.ui.Label)1 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)1 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)1 ImageFrame (org.rstudio.core.client.widget.ImageFrame)1 PackageInfo (org.rstudio.studio.client.workbench.views.packages.model.PackageInfo)1