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);
}
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);
}
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);
}
Aggregations