use of com.google.gerrit.client.ui.HintTextBox in project gerrit by GerritCodeReview.
the class MyWatchedProjectsScreen method createWidgets.
protected void createWidgets() {
nameBox = new RemoteSuggestBox(new ProjectNameSuggestOracle());
nameBox.setVisibleLength(50);
nameBox.setHintText(Util.C.defaultProjectName());
nameBox.addSelectionHandler(new SelectionHandler<String>() {
@Override
public void onSelection(SelectionEvent<String> event) {
doAddNew();
}
});
filterTxt = new HintTextBox();
filterTxt.setVisibleLength(50);
filterTxt.setHintText(Util.C.defaultFilter());
filterTxt.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNew();
}
}
});
addNew = new Button(Util.C.buttonWatchProject());
addNew.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doAddNew();
}
});
browse = new Button(Util.C.buttonBrowseProjects());
browse.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
// under page header
int top = grid.getAbsoluteTop() - 50;
// Try to place it to the right of everything else, but not
// right justified
int left = 5 + Math.max(grid.getAbsoluteLeft() + grid.getOffsetWidth(), watchesTab.getAbsoluteLeft() + watchesTab.getOffsetWidth());
projectsPopup.setPreferredCoordinates(top, left);
projectsPopup.displayPopup();
}
});
watchesTab = new MyWatchesTable();
delSel = new Button(Util.C.buttonDeleteSshKey());
delSel.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
watchesTab.deleteChecked();
}
});
}
use of com.google.gerrit.client.ui.HintTextBox in project gerrit by GerritCodeReview.
the class ProjectTagsScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
initPageHeader();
prev = PagingHyperlink.createPrev();
prev.setVisible(false);
next = PagingHyperlink.createNext();
next.setVisible(false);
addPanel = new FlowPanel();
Grid addGrid = new Grid(2, 2);
addGrid.setStyleName(Gerrit.RESOURCES.css().addBranch());
int texBoxLength = 50;
nameTxtBox = new HintTextBox();
nameTxtBox.setVisibleLength(texBoxLength);
nameTxtBox.setHintText(AdminConstants.I.defaultTagName());
nameTxtBox.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNewTag();
}
}
});
addGrid.setText(0, 0, AdminConstants.I.columnTagName() + ":");
addGrid.setWidget(0, 1, nameTxtBox);
irevTxtBox = new HintTextBox();
irevTxtBox.setVisibleLength(texBoxLength);
irevTxtBox.setHintText(AdminConstants.I.defaultRevisionSpec());
irevTxtBox.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNewTag();
}
}
});
addGrid.setText(1, 0, AdminConstants.I.initialRevision() + ":");
addGrid.setWidget(1, 1, irevTxtBox);
addTag = new Button(AdminConstants.I.buttonAddTag());
addTag.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
doAddNewTag();
}
});
addPanel.add(addGrid);
addPanel.add(addTag);
tagTable = new TagsTable();
delTag = new Button(AdminConstants.I.buttonDeleteTag());
delTag.setStyleName(Gerrit.RESOURCES.css().branchTableDeleteButton());
delTag.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
tagTable.deleteChecked();
}
});
HorizontalPanel buttons = new HorizontalPanel();
buttons.setStyleName(Gerrit.RESOURCES.css().branchTablePrevNextLinks());
buttons.add(delTag);
buttons.add(prev);
buttons.add(next);
add(tagTable);
add(buttons);
add(addPanel);
}
use of com.google.gerrit.client.ui.HintTextBox in project gerrit by GerritCodeReview.
the class ProjectBranchesScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
initPageHeader();
prev = PagingHyperlink.createPrev();
prev.setVisible(false);
next = PagingHyperlink.createNext();
next.setVisible(false);
addPanel = new FlowPanel();
final Grid addGrid = new Grid(2, 2);
addGrid.setStyleName(Gerrit.RESOURCES.css().addBranch());
final int texBoxLength = 50;
nameTxtBox = new HintTextBox();
nameTxtBox.setVisibleLength(texBoxLength);
nameTxtBox.setHintText(AdminConstants.I.defaultBranchName());
nameTxtBox.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNewBranch();
}
}
});
addGrid.setText(0, 0, AdminConstants.I.columnBranchName() + ":");
addGrid.setWidget(0, 1, nameTxtBox);
irevTxtBox = new HintTextBox();
irevTxtBox.setVisibleLength(texBoxLength);
irevTxtBox.setHintText(AdminConstants.I.defaultRevisionSpec());
irevTxtBox.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNewBranch();
}
}
});
addGrid.setText(1, 0, AdminConstants.I.initialRevision() + ":");
addGrid.setWidget(1, 1, irevTxtBox);
addBranch = new Button(AdminConstants.I.buttonAddBranch());
addBranch.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doAddNewBranch();
}
});
addPanel.add(addGrid);
addPanel.add(addBranch);
branchTable = new BranchesTable();
delBranch = new Button(AdminConstants.I.buttonDeleteBranch());
delBranch.setStyleName(Gerrit.RESOURCES.css().branchTableDeleteButton());
delBranch.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
branchTable.deleteChecked();
}
});
HorizontalPanel buttons = new HorizontalPanel();
buttons.setStyleName(Gerrit.RESOURCES.css().branchTablePrevNextLinks());
buttons.add(delBranch);
buttons.add(prev);
buttons.add(next);
add(branchTable);
add(buttons);
add(addPanel);
}
Aggregations