Search in sources :

Example 1 with NpTextArea

use of com.google.gwtexpui.globalkey.client.NpTextArea in project gerrit by GerritCodeReview.

the class ProjectInfoScreen method initDescription.

private void initDescription() {
    final VerticalPanel vp = new VerticalPanel();
    vp.add(new SmallHeading(AdminConstants.I.headingDescription()));
    descTxt = new NpTextArea();
    descTxt.setVisibleLines(6);
    descTxt.setCharacterWidth(60);
    vp.add(descTxt);
    add(vp);
    saveEnabler = new OnEditEnabler(saveProject);
    saveEnabler.listenTo(descTxt);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) NpTextArea(com.google.gwtexpui.globalkey.client.NpTextArea) OnEditEnabler(com.google.gerrit.client.ui.OnEditEnabler)

Example 2 with NpTextArea

use of com.google.gwtexpui.globalkey.client.NpTextArea in project gerrit by GerritCodeReview.

the class AccountGroupInfoScreen method initDescription.

private void initDescription() {
    final VerticalPanel vp = new VerticalPanel();
    vp.setStyleName(Gerrit.RESOURCES.css().groupDescriptionPanel());
    vp.add(new SmallHeading(AdminConstants.I.headingDescription()));
    descTxt = new NpTextArea();
    descTxt.setVisibleLines(6);
    descTxt.setCharacterWidth(60);
    vp.add(descTxt);
    saveDesc = new Button(AdminConstants.I.buttonSaveDescription());
    saveDesc.setEnabled(false);
    saveDesc.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            final String txt = descTxt.getText().trim();
            GroupApi.setGroupDescription(getGroupUUID(), txt, new GerritCallback<VoidResult>() {

                @Override
                public void onSuccess(final VoidResult result) {
                    saveDesc.setEnabled(false);
                }
            });
        }
    });
    vp.add(saveDesc);
    add(vp);
}
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) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) NpTextArea(com.google.gwtexpui.globalkey.client.NpTextArea)

Aggregations

SmallHeading (com.google.gerrit.client.ui.SmallHeading)2 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)2 NpTextArea (com.google.gwtexpui.globalkey.client.NpTextArea)2 VoidResult (com.google.gerrit.client.VoidResult)1 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)1 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Button (com.google.gwt.user.client.ui.Button)1