use of com.google.gerrit.client.projects.TagInfo in project gerrit by GerritCodeReview.
the class ProjectTagsScreen method doAddNewTag.
private void doAddNewTag() {
String tagName = nameTxtBox.getText().trim();
if (tagName.isEmpty()) {
nameTxtBox.setFocus(true);
return;
}
String rev = irevTxtBox.getText().trim();
if (rev.isEmpty()) {
irevTxtBox.setText("HEAD");
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
irevTxtBox.selectAll();
irevTxtBox.setFocus(true);
}
});
return;
}
addTag.setEnabled(false);
ProjectApi.createTag(getProjectKey(), tagName, rev, new GerritCallback<TagInfo>() {
@Override
public void onSuccess(TagInfo tag) {
showAddedTag(tag);
nameTxtBox.setText("");
irevTxtBox.setText("");
query = new Query(match).start(start).run();
}
@Override
public void onFailure(Throwable caught) {
addTag.setEnabled(true);
selectAllAndFocus(nameTxtBox);
new ErrorDialog(caught.getMessage()).center();
}
});
}
Aggregations