Search in sources :

Example 86 with Label

use of com.google.gwt.user.client.ui.Label 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 87 with Label

use of com.google.gwt.user.client.ui.Label 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)

Example 88 with Label

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

the class GroupListScreen method initPageHeader.

private void initPageHeader() {
    final HorizontalPanel hp = new HorizontalPanel();
    hp.setStyleName(Gerrit.RESOURCES.css().projectFilterPanel());
    final Label filterLabel = new Label(AdminConstants.I.projectFilter());
    filterLabel.setStyleName(Gerrit.RESOURCES.css().projectFilterLabel());
    hp.add(filterLabel);
    filterTxt = new NpTextBox();
    filterTxt.setValue(match);
    filterTxt.addKeyUpHandler(new KeyUpHandler() {

        @Override
        public void onKeyUp(KeyUpEvent event) {
            Query q = new Query(filterTxt.getValue()).open(event.getNativeKeyCode() == KeyCodes.KEY_ENTER);
            if (match.equals(q.qMatch)) {
                q.start(start);
            }
            if (q.open || !match.equals(q.qMatch)) {
                if (query == null) {
                    q.run();
                }
                query = q;
            }
        }
    });
    hp.add(filterTxt);
    add(hp);
}
Also used : KeyUpEvent(com.google.gwt.event.dom.client.KeyUpEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) KeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox)

Example 89 with Label

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

the class ProjectListPopup method createWidgets.

private void createWidgets(final String popupText, final String currentPageLink) {
    filterPanel = new HorizontalPanel();
    filterPanel.setStyleName(Gerrit.RESOURCES.css().projectFilterPanel());
    final Label filterLabel = new Label(com.google.gerrit.client.admin.AdminConstants.I.projectFilter());
    filterLabel.setStyleName(Gerrit.RESOURCES.css().projectFilterLabel());
    filterPanel.add(filterLabel);
    filterTxt = new NpTextBox();
    filterTxt.addKeyUpHandler(new KeyUpHandler() {

        @Override
        public void onKeyUp(KeyUpEvent event) {
            Query q = new Query(filterTxt.getValue());
            if (!match.equals(q.qMatch)) {
                if (query == null) {
                    q.run();
                }
                query = q;
            }
        }
    });
    filterPanel.add(filterTxt);
    projectsTab = new HighlightingProjectsTable() {

        @Override
        protected void movePointerTo(final int row, final boolean scroll) {
            super.movePointerTo(row, scroll);
            onMovePointerTo(getRowItem(row).name());
        }

        @Override
        protected void onOpenRow(final int row) {
            super.onOpenRow(row);
            openRow(getRowItem(row).name());
        }
    };
    projectsTab.setSavePointerId(currentPageLink);
    closeTop = createCloseButton();
    closeBottom = createCloseButton();
    popup = new DialogBox();
    popup.setModal(false);
    popup.setText(popupText);
}
Also used : KeyUpEvent(com.google.gwt.event.dom.client.KeyUpEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) KeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox) DialogBox(com.google.gwt.user.client.ui.DialogBox)

Aggregations

Label (com.google.gwt.user.client.ui.Label)89 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)19 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)15 Test (org.junit.Test)11 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)10 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)10 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)9 TextBox (com.google.gwt.user.client.ui.TextBox)9 Image (com.google.gwt.user.client.ui.Image)8 CheckBox (com.google.gwt.user.client.ui.CheckBox)7 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)7 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)7 JsArrayString (com.google.gwt.core.client.JsArrayString)5 Element (com.google.gwt.dom.client.Element)5 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)5 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)5 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 Grid (com.google.gwt.user.client.ui.Grid)5 HTML (com.google.gwt.user.client.ui.HTML)4