use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class NewAgreementScreen method renderSelf.
private void renderSelf() {
current = null;
agreementGroup.setVisible(false);
finalGroup.setVisible(false);
radios.clear();
final SmallHeading hdr = new SmallHeading();
if (available.isEmpty()) {
hdr.setText(Util.C.newAgreementNoneAvailable());
} else {
hdr.setText(Util.C.newAgreementSelectTypeHeading());
}
radios.add(hdr);
for (final AgreementInfo cla : available) {
final RadioButton r = new RadioButton("cla_id", cla.name());
r.addStyleName(Gerrit.RESOURCES.css().contributorAgreementButton());
radios.add(r);
if (mySigned.contains(cla.name())) {
r.setEnabled(false);
final Label l = new Label(Util.C.newAgreementAlreadySubmitted());
l.setStyleName(Gerrit.RESOURCES.css().contributorAgreementAlreadySubmitted());
radios.add(l);
} else {
r.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
showCLA(cla);
}
});
}
if (cla.description() != null && !cla.description().equals("")) {
final Label l = new Label(cla.description());
l.setStyleName(Gerrit.RESOURCES.css().contributorAgreementShortDescription());
radios.add(l);
}
}
}
use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class RegisterScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
setPageTitle(Util.C.welcomeToGerritCodeReview());
final FlowPanel formBody = new FlowPanel();
final FlowPanel contactGroup = new FlowPanel();
contactGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
contactGroup.add(new SmallHeading(Util.C.welcomeReviewContact()));
final HTML whereFrom = new HTML(Util.C.welcomeContactFrom());
whereFrom.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
contactGroup.add(whereFrom);
contactGroup.add(new ContactPanelShort() {
@Override
protected void display(AccountInfo account) {
super.display(account);
if ("".equals(nameTxt.getText())) {
// No name? Encourage the user to provide us something.
//
nameTxt.setFocus(true);
save.setEnabled(true);
}
}
});
formBody.add(contactGroup);
if (Gerrit.getUserAccount().username() == null && Gerrit.info().auth().canEdit(AccountFieldName.USER_NAME)) {
final FlowPanel fp = new FlowPanel();
fp.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
fp.add(new SmallHeading(Util.C.welcomeUsernameHeading()));
final Grid userInfo = new Grid(1, 2);
final CellFormatter fmt = userInfo.getCellFormatter();
userInfo.setStyleName(Gerrit.RESOURCES.css().infoBlock());
userInfo.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
fp.add(userInfo);
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().bottomheader());
UsernameField field = new UsernameField();
if (LocaleInfo.getCurrentLocale().isRTL()) {
userInfo.setText(0, 1, Util.C.userName());
userInfo.setWidget(0, 0, field);
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().header());
} else {
userInfo.setText(0, 0, Util.C.userName());
userInfo.setWidget(0, 1, field);
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
}
formBody.add(fp);
}
if (Gerrit.info().hasSshd()) {
final FlowPanel sshKeyGroup = new FlowPanel();
sshKeyGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
sshKeyGroup.add(new SmallHeading(Util.C.welcomeSshKeyHeading()));
final HTML whySshKey = new HTML(Util.C.welcomeSshKeyText());
whySshKey.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
sshKeyGroup.add(whySshKey);
sshKeyGroup.add(new SshPanel() {
{
setKeyTableVisible(false);
}
});
formBody.add(sshKeyGroup);
}
final FlowPanel choices = new FlowPanel();
choices.setStyleName(Gerrit.RESOURCES.css().registerScreenNextLinks());
if (Gerrit.info().auth().useContributorAgreements()) {
final FlowPanel agreementGroup = new FlowPanel();
agreementGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
agreementGroup.add(new SmallHeading(Util.C.welcomeAgreementHeading()));
final HTML whyAgreement = new HTML(Util.C.welcomeAgreementText());
whyAgreement.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
agreementGroup.add(whyAgreement);
choices.add(new InlineHyperlink(Util.C.newAgreement(), PageLinks.SETTINGS_NEW_AGREEMENT));
choices.add(new InlineHyperlink(Util.C.welcomeAgreementLater(), nextToken));
formBody.add(agreementGroup);
} else {
choices.add(new InlineHyperlink(Util.C.welcomeContinue(), nextToken));
}
formBody.add(choices);
final FormPanel form = new FormPanel();
form.add(formBody);
add(form);
}
use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class AccountGroupInfoScreen method initOwner.
private void initOwner() {
final VerticalPanel ownerPanel = new VerticalPanel();
ownerPanel.setStyleName(Gerrit.RESOURCES.css().groupOwnerPanel());
ownerPanel.add(new SmallHeading(AdminConstants.I.headingOwner()));
final AccountGroupSuggestOracle accountGroupOracle = new AccountGroupSuggestOracle();
ownerTxt = new RemoteSuggestBox(accountGroupOracle);
ownerTxt.setStyleName(Gerrit.RESOURCES.css().groupOwnerTextBox());
ownerTxt.setVisibleLength(60);
ownerPanel.add(ownerTxt);
saveOwner = new Button(AdminConstants.I.buttonChangeGroupOwner());
saveOwner.setEnabled(false);
saveOwner.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
final String newOwner = ownerTxt.getText().trim();
if (newOwner.length() > 0) {
AccountGroup.UUID ownerUuid = accountGroupOracle.getUUID(newOwner);
String ownerId = ownerUuid != null ? ownerUuid.get() : newOwner;
GroupApi.setGroupOwner(getGroupUUID(), ownerId, new GerritCallback<GroupInfo>() {
@Override
public void onSuccess(final GroupInfo result) {
updateOwnerGroup(result);
saveOwner.setEnabled(false);
}
});
}
}
});
ownerPanel.add(saveOwner);
add(ownerPanel);
}
use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class AccountGroupMembersScreen method initIncludeList.
private void initIncludeList() {
accountGroupSuggestOracle = new AccountGroupSuggestOracle();
addIncludeBox = new AddMemberBox(AdminConstants.I.buttonAddIncludedGroup(), AdminConstants.I.defaultAccountGroupName(), accountGroupSuggestOracle);
addIncludeBox.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doAddNewInclude();
}
});
includes = new IncludeTable();
includes.addStyleName(Gerrit.RESOURCES.css().groupIncludesTable());
delInclude = new Button(AdminConstants.I.buttonDeleteIncludedGroup());
delInclude.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
includes.deleteChecked();
}
});
includePanel = new FlowPanel();
includePanel.add(new SmallHeading(AdminConstants.I.headingIncludedGroups()));
includePanel.add(addIncludeBox);
includePanel.add(includes);
includePanel.add(delInclude);
add(includePanel);
}
use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class AccountGroupMembersScreen method initMemberList.
private void initMemberList() {
addMemberBox = new AddMemberBox(AdminConstants.I.buttonAddGroupMember(), AdminConstants.I.defaultAccountName(), new AccountSuggestOracle());
addMemberBox.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doAddNewMember();
}
});
members = new MemberTable();
members.addStyleName(Gerrit.RESOURCES.css().groupMembersTable());
delMember = new Button(AdminConstants.I.buttonDeleteGroupMembers());
delMember.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
members.deleteChecked();
}
});
memberPanel = new FlowPanel();
memberPanel.add(new SmallHeading(AdminConstants.I.headingMembers()));
memberPanel.add(addMemberBox);
memberPanel.add(members);
memberPanel.add(delMember);
add(memberPanel);
}
Aggregations