Search in sources :

Example 6 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.

the class CreateGroupScreen method addCreateGroupPanel.

private void addCreateGroupPanel() {
    VerticalPanel addPanel = new VerticalPanel();
    addPanel.setStyleName(Gerrit.RESOURCES.css().addSshKeyPanel());
    addPanel.add(new SmallHeading(AdminConstants.I.headingCreateGroup()));
    addTxt = new NpTextBox() {

        @Override
        public void onBrowserEvent(Event event) {
            super.onBrowserEvent(event);
            if (event.getTypeInt() == Event.ONPASTE) {
                Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                    @Override
                    public void execute() {
                        if (addTxt.getValue().trim().length() != 0) {
                            addNew.setEnabled(true);
                        }
                    }
                });
            }
        }
    };
    addTxt.sinkEvents(Event.ONPASTE);
    addTxt.setVisibleLength(60);
    addTxt.addKeyPressHandler(new KeyPressHandler() {

        @Override
        public void onKeyPress(KeyPressEvent event) {
            if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
                doCreateGroup();
            }
        }
    });
    addPanel.add(addTxt);
    addNew = new Button(AdminConstants.I.buttonCreateGroup());
    addNew.setEnabled(false);
    addNew.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            doCreateGroup();
        }
    });
    addPanel.add(addNew);
    add(addPanel);
    new OnEditEnabler(addNew, addTxt);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) KeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ScheduledCommand(com.google.gwt.core.client.Scheduler.ScheduledCommand) KeyPressEvent(com.google.gwt.event.dom.client.KeyPressEvent) Button(com.google.gwt.user.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Event(com.google.gwt.user.client.Event) KeyPressEvent(com.google.gwt.event.dom.client.KeyPressEvent) OnEditEnabler(com.google.gerrit.client.ui.OnEditEnabler) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox)

Example 7 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.

the class AccountGroupAuditLogScreen method onInitUI.

@Override
protected void onInitUI() {
    super.onInitUI();
    add(new SmallHeading(AdminConstants.I.headingAuditLog()));
    auditEventTable = new AuditEventTable();
    add(auditEventTable);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading)

Example 8 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.

the class AccountGroupInfoScreen method initGroupOptions.

private void initGroupOptions() {
    final VerticalPanel groupOptionsPanel = new VerticalPanel();
    final VerticalPanel vp = new VerticalPanel();
    vp.setStyleName(Gerrit.RESOURCES.css().groupOptionsPanel());
    vp.add(new SmallHeading(AdminConstants.I.headingGroupOptions()));
    visibleToAllCheckBox = new CheckBox(AdminConstants.I.isVisibleToAll());
    vp.add(visibleToAllCheckBox);
    groupOptionsPanel.add(vp);
    saveGroupOptions = new Button(AdminConstants.I.buttonSaveGroupOptions());
    saveGroupOptions.setEnabled(false);
    saveGroupOptions.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            GroupApi.setGroupOptions(getGroupUUID(), visibleToAllCheckBox.getValue(), new GerritCallback<VoidResult>() {

                @Override
                public void onSuccess(final VoidResult result) {
                    saveGroupOptions.setEnabled(false);
                }
            });
        }
    });
    groupOptionsPanel.add(saveGroupOptions);
    add(groupOptionsPanel);
    final OnEditEnabler enabler = new OnEditEnabler(saveGroupOptions);
    enabler.listenTo(visibleToAllCheckBox);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) GerritCallback(com.google.gerrit.client.rpc.GerritCallback) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) VoidResult(com.google.gerrit.client.VoidResult) Button(com.google.gwt.user.client.ui.Button) CheckBox(com.google.gwt.user.client.ui.CheckBox) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) OnEditEnabler(com.google.gerrit.client.ui.OnEditEnabler)

Example 9 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.

the class ProjectInfoScreen method initAgreements.

private void initAgreements() {
    grid.addHeader(new SmallHeading(AdminConstants.I.headingAgreements()));
    contributorAgreements = newInheritedBooleanBox();
    if (Gerrit.info().auth().useContributorAgreements()) {
        saveEnabler.listenTo(contributorAgreements);
        grid.add(AdminConstants.I.useContributorAgreements(), contributorAgreements);
    }
    signedOffBy = newInheritedBooleanBox();
    saveEnabler.listenTo(signedOffBy);
    grid.addHtml(AdminConstants.I.useSignedOffBy(), signedOffBy);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading)

Example 10 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.

the class ProjectInfoScreen method initPluginOptions.

private void initPluginOptions(ConfigInfo info) {
    pluginOptionsPanel.clear();
    pluginConfigWidgets = new HashMap<>();
    for (String pluginName : info.pluginConfig().keySet()) {
        Map<String, HasEnabled> widgetMap = new HashMap<>();
        pluginConfigWidgets.put(pluginName, widgetMap);
        LabeledWidgetsGrid g = new LabeledWidgetsGrid();
        g.addHeader(new SmallHeading(AdminMessages.I.pluginProjectOptionsTitle(pluginName)));
        pluginOptionsPanel.add(g);
        NativeMap<ConfigParameterInfo> pluginConfig = info.pluginConfig(pluginName);
        pluginConfig.copyKeysIntoChildren("name");
        for (ConfigParameterInfo param : Natives.asList(pluginConfig.values())) {
            HasEnabled w;
            switch(param.type()) {
                case "STRING":
                case "INT":
                case "LONG":
                    w = renderTextBox(g, param);
                    break;
                case "BOOLEAN":
                    w = renderCheckBox(g, param);
                    break;
                case "LIST":
                    w = renderListBox(g, param);
                    break;
                case "ARRAY":
                    w = renderStringListPanel(g, param);
                    break;
                default:
                    throw new UnsupportedOperationException("unsupported widget type");
            }
            if (param.editable()) {
                widgetMap.put(param.name(), w);
            } else {
                w.setEnabled(false);
            }
        }
    }
    enableForm();
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) HasEnabled(com.google.gwt.user.client.ui.HasEnabled) HashMap(java.util.HashMap) ConfigParameterInfo(com.google.gerrit.client.projects.ConfigInfo.ConfigParameterInfo)

Aggregations

SmallHeading (com.google.gerrit.client.ui.SmallHeading)17 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)8 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)8 Button (com.google.gwt.user.client.ui.Button)7 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)7 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)6 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)4 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)3 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)3 VoidResult (com.google.gerrit.client.VoidResult)2 AccountGroupSuggestOracle (com.google.gerrit.client.ui.AccountGroupSuggestOracle)2 AddMemberBox (com.google.gerrit.client.ui.AddMemberBox)2 FormPanel (com.google.gwt.user.client.ui.FormPanel)2 HTML (com.google.gwt.user.client.ui.HTML)2 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)2 Label (com.google.gwt.user.client.ui.Label)2 RadioButton (com.google.gwt.user.client.ui.RadioButton)2 NpTextArea (com.google.gwtexpui.globalkey.client.NpTextArea)2 ActionButton (com.google.gerrit.client.actions.ActionButton)1 AccountInfo (com.google.gerrit.client.info.AccountInfo)1