Search in sources :

Example 11 with NpTextBox

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

the class AccountGroupInfoScreen method initName.

private void initName() {
    final VerticalPanel groupNamePanel = new VerticalPanel();
    groupNamePanel.setStyleName(Gerrit.RESOURCES.css().groupNamePanel());
    groupNameTxt = new NpTextBox();
    groupNameTxt.setStyleName(Gerrit.RESOURCES.css().groupNameTextBox());
    groupNameTxt.setVisibleLength(60);
    groupNamePanel.add(groupNameTxt);
    saveName = new Button(AdminConstants.I.buttonRenameGroup());
    saveName.setEnabled(false);
    saveName.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            final String newName = groupNameTxt.getText().trim();
            GroupApi.renameGroup(getGroupUUID(), newName, new GerritCallback<com.google.gerrit.client.VoidResult>() {

                @Override
                public void onSuccess(final com.google.gerrit.client.VoidResult result) {
                    saveName.setEnabled(false);
                    setPageTitle(AdminMessages.I.group(newName));
                    groupNameTxt.setText(newName);
                    if (getGroupUUID().equals(getOwnerGroupUUID())) {
                        ownerTxt.setText(newName);
                    }
                }
            });
        }
    });
    groupNamePanel.add(saveName);
    add(groupNamePanel);
}
Also used : VoidResult(com.google.gerrit.client.VoidResult) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox) GerritCallback(com.google.gerrit.client.rpc.GerritCallback) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(com.google.gwt.user.client.ui.Button)

Example 12 with NpTextBox

use of com.google.gwtexpui.globalkey.client.NpTextBox 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 13 with NpTextBox

use of com.google.gwtexpui.globalkey.client.NpTextBox 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

NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)13 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)7 Label (com.google.gwt.user.client.ui.Label)7 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)6 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)5 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 Button (com.google.gwt.user.client.ui.Button)5 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)4 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)4 SmallHeading (com.google.gerrit.client.ui.SmallHeading)3 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)3 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)2 NativeString (com.google.gerrit.client.rpc.NativeString)2 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)2 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)2 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)2 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)2 KeyPressHandler (com.google.gwt.event.dom.client.KeyPressHandler)2 Event (com.google.gwt.user.client.Event)2