Search in sources :

Example 6 with HorizontalPanel

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

the class PreferencesDialogPaneBase method checkBoxWithHelp.

protected HorizontalPanel checkBoxWithHelp(CheckBox checkBox, String topic) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.add(checkBox);
    HelpButton helpButton = new HelpButton(topic, false);
    Style helpStyle = helpButton.getElement().getStyle();
    helpStyle.setMarginTop(1, Unit.PX);
    helpStyle.setMarginLeft(6, Unit.PX);
    panel.add(helpButton);
    return panel;
}
Also used : HelpButton(org.rstudio.core.client.widget.HelpButton) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Style(com.google.gwt.dom.client.Style)

Example 7 with HorizontalPanel

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

the class FileBrowserWidget method createTopWidget.

// Private methods ---------------------------------------------------------
private Widget createTopWidget() {
    String nameLabel = host_.getFilenameLabel();
    if (nameLabel == null)
        return null;
    HorizontalPanel filenamePanel = new HorizontalPanel();
    FileDialogStyles styles = FileDialogResources.INSTANCE.styles();
    filenamePanel.setStylePrimaryName(styles.filenamePanel());
    filenamePanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    Label filenameLabel = new Label(nameLabel + ":", false);
    filenameLabel.setStylePrimaryName(styles.filenameLabel());
    filenamePanel.add(filenameLabel);
    filename_ = new TextBox();
    if (initialFilename_ != null)
        filename_.setText(initialFilename_);
    filename_.setStylePrimaryName(styles.filename());
    filenamePanel.add(filename_);
    filenamePanel.setCellWidth(filename_, "100%");
    ftm_ = new FocusTransitionManager();
    ftm_.add(filename_, directory_);
    return filenamePanel;
}
Also used : HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) FocusTransitionManager(org.rstudio.core.client.FocusTransitionManager) TextBox(com.google.gwt.user.client.ui.TextBox)

Example 8 with HorizontalPanel

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

the class MinimizedModuleTabLayoutPanel method setTabs.

public void setTabs(String[] tabNames) {
    HorizontalPanel horiz = (HorizontalPanel) getExtraWidget();
    horiz.clear();
    ThemeStyles styles = ThemeResources.INSTANCE.themeStyles();
    for (int i = 0; i < tabNames.length; i++) {
        String tabName = tabNames[i];
        if (tabName == null)
            continue;
        ModuleTabLayoutPanel.ModuleTab tab = new ModuleTabLayoutPanel.ModuleTab(tabName, styles, false);
        tab.addStyleName("gwt-TabLayoutPanelTab");
        final Integer thisIndex = i;
        tab.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                event.preventDefault();
                SelectionEvent.fire(MinimizedModuleTabLayoutPanel.this, thisIndex);
            }
        });
        horiz.add(tab);
    }
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ThemeStyles(org.rstudio.core.client.theme.res.ThemeStyles)

Example 9 with HorizontalPanel

use of com.google.gwt.user.client.ui.HorizontalPanel in project gerrit by GerritCodeReview.

the class MyProfileScreen method onInitUI.

@Override
protected void onInitUI() {
    super.onInitUI();
    HorizontalPanel h = new HorizontalPanel();
    add(h);
    if (Gerrit.info().plugin().hasAvatars()) {
        VerticalPanel v = new VerticalPanel();
        v.addStyleName(Gerrit.RESOURCES.css().avatarInfoPanel());
        h.add(v);
        avatar = new AvatarImage();
        v.add(avatar);
        changeAvatar = new Anchor(Util.C.changeAvatar(), "", "_blank");
        changeAvatar.setVisible(false);
        v.add(changeAvatar);
    }
    if (LocaleInfo.getCurrentLocale().isRTL()) {
        labelIdx = 1;
        fieldIdx = 0;
    } else {
        labelIdx = 0;
        fieldIdx = 1;
    }
    info = new Grid((Gerrit.info().auth().siteHasUsernames() ? 1 : 0) + 4, 2);
    info.setStyleName(Gerrit.RESOURCES.css().infoBlock());
    info.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
    h.add(info);
    int row = 0;
    if (Gerrit.info().auth().siteHasUsernames()) {
        infoRow(row++, Util.C.userName());
    }
    infoRow(row++, Util.C.fullName());
    infoRow(row++, Util.C.preferredEmail());
    infoRow(row++, Util.C.registeredOn());
    infoRow(row++, Util.C.accountId());
    final CellFormatter fmt = info.getCellFormatter();
    fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
    fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
    fmt.addStyleName(row - 1, 0, Gerrit.RESOURCES.css().bottomheader());
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Anchor(com.google.gwt.user.client.ui.Anchor) Grid(com.google.gwt.user.client.ui.Grid) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) AvatarImage(com.google.gerrit.client.AvatarImage) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter) GerritUiExtensionPoint(com.google.gerrit.client.GerritUiExtensionPoint)

Example 10 with HorizontalPanel

use of com.google.gwt.user.client.ui.HorizontalPanel in project gerrit by GerritCodeReview.

the class MyWatchedProjectsScreen method onInitUI.

@Override
protected void onInitUI() {
    super.onInitUI();
    createWidgets();
    /* top table */
    grid = new Grid(2, 2);
    grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
    grid.setText(0, 0, Util.C.watchedProjectName());
    final HorizontalPanel hp = new HorizontalPanel();
    hp.add(nameBox);
    hp.add(browse);
    grid.setWidget(0, 1, hp);
    grid.setText(1, 0, Util.C.watchedProjectFilter());
    grid.setWidget(1, 1, filterTxt);
    final CellFormatter fmt = grid.getCellFormatter();
    fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
    fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
    fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
    fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().header());
    fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
    final FlowPanel fp = new FlowPanel();
    fp.setStyleName(Gerrit.RESOURCES.css().addWatchPanel());
    fp.add(grid);
    fp.add(addNew);
    add(fp);
    /* bottom table */
    add(watchesTab);
    add(delSel);
    /* popup */
    projectsPopup = new ProjectListPopup() {

        @Override
        protected void onMovePointerTo(String projectName) {
            // prevent user input from being overwritten by simply poping up
            if (!projectsPopup.isPoppingUp() || "".equals(nameBox.getText())) {
                nameBox.setText(projectName);
            }
        }

        @Override
        protected void openRow(String projectName) {
            nameBox.setText(projectName);
            doAddNew();
        }
    };
    projectsPopup.initPopup(Util.C.projects(), PageLinks.SETTINGS_PROJECTS);
}
Also used : Grid(com.google.gwt.user.client.ui.Grid) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter) ProjectListPopup(com.google.gerrit.client.ui.ProjectListPopup)

Aggregations

HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)37 Label (com.google.gwt.user.client.ui.Label)19 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)9 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)9 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)9 Image (com.google.gwt.user.client.ui.Image)7 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)7 TextBox (com.google.gwt.user.client.ui.TextBox)6 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)4 Grid (com.google.gwt.user.client.ui.Grid)4 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)4 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)3 Anchor (com.google.gwt.user.client.ui.Anchor)3 CheckBox (com.google.gwt.user.client.ui.CheckBox)3 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)3 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)2 RestApi (com.google.gerrit.client.rpc.RestApi)2 HintTextBox (com.google.gerrit.client.ui.HintTextBox)2