Search in sources :

Example 26 with HorizontalPanel

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

the class CppCompletionSignatureTip method addPagingWidget.

private void addPagingWidget() {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setStyleName(RES.styles().pagingWidget());
    Image upImage = new Image(new ImageResource2x(RES.upArrow2x()));
    upImage.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            setTextIndex(currentTextIndex_ - 1);
            docDisplay_.setFocus(true);
        }
    });
    panel.add(upImage);
    pagingLabel_ = new Label();
    panel.add(pagingLabel_);
    Image downImage = new Image(new ImageResource2x(RES.downArrow2x()));
    downImage.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            setTextIndex(currentTextIndex_ + 1);
            docDisplay_.setFocus(true);
        }
    });
    panel.add(downImage);
    panel.add(downImage);
    addLeftWidget(panel);
}
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) Label(com.google.gwt.user.client.ui.Label) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Image(com.google.gwt.user.client.ui.Image)

Example 27 with HorizontalPanel

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

the class Generator method onModuleLoad.

@Override
public void onModuleLoad() {
    loadGenerators();
    setupLeftPanel();
    topPanel.getElement().setId("leftpanel");
    Widget leftPanel = topPanel;
    HorizontalPanel mainPanel = new HorizontalPanel();
    mainPanel.add(leftPanel);
    SimplePanel div2 = new SimplePanel();
    div2.add(result);
    div2.getElement().setId("innerresult");
    SimplePanel div = new SimplePanel();
    div.add(div2);
    div.getElement().setId("imageresult");
    urlResult.getElement().setId("urlresult");
    rawTextResult.getElement().setId("rawtextresult");
    rawTextResult.setCharacterWidth(50);
    rawTextResult.setVisibleLines(8);
    downloadText.getElement().setId("downloadText");
    rightPanel.add(div);
    rightPanel.add(downloadText);
    rightPanel.add(urlResult);
    rightPanel.add(rawTextResult);
    mainPanel.add(rightPanel);
    mainPanel.getElement().setId("mainpanel");
    RootPanel.get("ui").add(mainPanel);
    setWidget(1);
    invalidateBarcode();
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) SimplePanel(com.google.gwt.user.client.ui.SimplePanel)

Example 28 with HorizontalPanel

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

the class ProjectBranchesScreen method onInitUI.

@Override
protected void onInitUI() {
    super.onInitUI();
    initPageHeader();
    prev = PagingHyperlink.createPrev();
    prev.setVisible(false);
    next = PagingHyperlink.createNext();
    next.setVisible(false);
    addPanel = new FlowPanel();
    final Grid addGrid = new Grid(2, 2);
    addGrid.setStyleName(Gerrit.RESOURCES.css().addBranch());
    final int texBoxLength = 50;
    nameTxtBox = new HintTextBox();
    nameTxtBox.setVisibleLength(texBoxLength);
    nameTxtBox.setHintText(AdminConstants.I.defaultBranchName());
    nameTxtBox.addKeyPressHandler(new KeyPressHandler() {

        @Override
        public void onKeyPress(KeyPressEvent event) {
            if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
                doAddNewBranch();
            }
        }
    });
    addGrid.setText(0, 0, AdminConstants.I.columnBranchName() + ":");
    addGrid.setWidget(0, 1, nameTxtBox);
    irevTxtBox = new HintTextBox();
    irevTxtBox.setVisibleLength(texBoxLength);
    irevTxtBox.setHintText(AdminConstants.I.defaultRevisionSpec());
    irevTxtBox.addKeyPressHandler(new KeyPressHandler() {

        @Override
        public void onKeyPress(KeyPressEvent event) {
            if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
                doAddNewBranch();
            }
        }
    });
    addGrid.setText(1, 0, AdminConstants.I.initialRevision() + ":");
    addGrid.setWidget(1, 1, irevTxtBox);
    addBranch = new Button(AdminConstants.I.buttonAddBranch());
    addBranch.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            doAddNewBranch();
        }
    });
    addPanel.add(addGrid);
    addPanel.add(addBranch);
    branchTable = new BranchesTable();
    delBranch = new Button(AdminConstants.I.buttonDeleteBranch());
    delBranch.setStyleName(Gerrit.RESOURCES.css().branchTableDeleteButton());
    delBranch.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            branchTable.deleteChecked();
        }
    });
    HorizontalPanel buttons = new HorizontalPanel();
    buttons.setStyleName(Gerrit.RESOURCES.css().branchTablePrevNextLinks());
    buttons.add(delBranch);
    buttons.add(prev);
    buttons.add(next);
    add(branchTable);
    add(buttons);
    add(addPanel);
}
Also used : HintTextBox(com.google.gerrit.client.ui.HintTextBox) KeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) KeyPressEvent(com.google.gwt.event.dom.client.KeyPressEvent) ActionButton(com.google.gerrit.client.actions.ActionButton) Button(com.google.gwt.user.client.ui.Button) Grid(com.google.gwt.user.client.ui.Grid) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel)

Example 29 with HorizontalPanel

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

the class ProjectInfoScreen method renderListBox.

private ListBox renderListBox(LabeledWidgetsGrid g, ConfigParameterInfo param) {
    if (param.permittedValues() == null) {
        return null;
    }
    ListBox listBox = new ListBox();
    if (param.inheritable()) {
        listBox.addItem(AdminMessages.I.pluginProjectInheritedListValue(param.inheritedValue()));
        if (param.configuredValue() == null) {
            listBox.setSelectedIndex(0);
        }
        for (int i = 0; i < param.permittedValues().length(); i++) {
            String pv = param.permittedValues().get(i);
            listBox.addItem(pv);
            if (pv.equals(param.configuredValue())) {
                listBox.setSelectedIndex(i + 1);
            }
        }
    } else {
        for (int i = 0; i < param.permittedValues().length(); i++) {
            String pv = param.permittedValues().get(i);
            listBox.addItem(pv);
            if (pv.equals(param.value())) {
                listBox.setSelectedIndex(i);
            }
        }
    }
    if (param.editable()) {
        saveEnabler.listenTo(listBox);
        addWidget(g, listBox, param);
    } else {
        listBox.setEnabled(false);
        if (param.inheritable() && listBox.getSelectedIndex() != 0) {
            // the inherited value is not selected,
            // since the listBox is disabled the inherited value cannot be
            // seen and we have to display it explicitly
            Label inheritedLabel = new Label(AdminMessages.I.pluginProjectInheritedValue(param.inheritedValue()));
            inheritedLabel.setStyleName(Gerrit.RESOURCES.css().pluginProjectConfigInheritedValue());
            HorizontalPanel p = new HorizontalPanel();
            p.add(listBox);
            p.add(inheritedLabel);
            addWidget(g, p, param);
        } else {
            addWidget(g, listBox, param);
        }
    }
    return listBox;
}
Also used : Label(com.google.gwt.user.client.ui.Label) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ListBox(com.google.gwt.user.client.ui.ListBox) GerritUiExtensionPoint(com.google.gerrit.client.GerritUiExtensionPoint)

Example 30 with HorizontalPanel

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

the class ProjectInfoScreen method initProjectOptions.

private void initProjectOptions() {
    grid.addHeader(new SmallHeading(AdminConstants.I.headingProjectOptions()));
    state = new ListBox();
    for (ProjectState stateValue : ProjectState.values()) {
        state.addItem(Util.toLongString(stateValue), stateValue.name());
    }
    saveEnabler.listenTo(state);
    grid.add(AdminConstants.I.headingProjectState(), state);
    submitType = new ListBox();
    for (final SubmitType type : SubmitType.values()) {
        submitType.addItem(Util.toLongString(type), type.name());
    }
    submitType.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            setEnabledForUseContentMerge();
        }
    });
    saveEnabler.listenTo(submitType);
    grid.add(AdminConstants.I.headingProjectSubmitType(), submitType);
    contentMerge = newInheritedBooleanBox();
    saveEnabler.listenTo(contentMerge);
    grid.add(AdminConstants.I.useContentMerge(), contentMerge);
    newChangeForAllNotInTarget = newInheritedBooleanBox();
    saveEnabler.listenTo(newChangeForAllNotInTarget);
    grid.add(AdminConstants.I.createNewChangeForAllNotInTarget(), newChangeForAllNotInTarget);
    requireChangeID = newInheritedBooleanBox();
    saveEnabler.listenTo(requireChangeID);
    grid.addHtml(AdminConstants.I.requireChangeID(), requireChangeID);
    if (Gerrit.info().receive().enableSignedPush()) {
        enableSignedPush = newInheritedBooleanBox();
        saveEnabler.listenTo(enableSignedPush);
        grid.add(AdminConstants.I.enableSignedPush(), enableSignedPush);
        requireSignedPush = newInheritedBooleanBox();
        saveEnabler.listenTo(requireSignedPush);
        grid.add(AdminConstants.I.requireSignedPush(), requireSignedPush);
    }
    rejectImplicitMerges = newInheritedBooleanBox();
    saveEnabler.listenTo(rejectImplicitMerges);
    grid.addHtml(AdminConstants.I.rejectImplicitMerges(), rejectImplicitMerges);
    enableReviewerByEmail = newInheritedBooleanBox();
    saveEnabler.listenTo(enableReviewerByEmail);
    grid.addHtml(AdminConstants.I.enableReviewerByEmail(), enableReviewerByEmail);
    maxObjectSizeLimit = new NpTextBox();
    saveEnabler.listenTo(maxObjectSizeLimit);
    effectiveMaxObjectSizeLimit = new Label();
    effectiveMaxObjectSizeLimit.setStyleName(Gerrit.RESOURCES.css().maxObjectSizeLimitEffectiveLabel());
    HorizontalPanel p = new HorizontalPanel();
    p.add(maxObjectSizeLimit);
    p.add(effectiveMaxObjectSizeLimit);
    grid.addHtml(AdminConstants.I.headingMaxObjectSizeLimit(), p);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Label(com.google.gwt.user.client.ui.Label) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ProjectState(com.google.gerrit.extensions.client.ProjectState) SubmitType(com.google.gerrit.extensions.client.SubmitType) ListBox(com.google.gwt.user.client.ui.ListBox) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox)

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