use of com.google.gwt.event.dom.client.ClickHandler 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.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.
the class Gerrit method whoAmI.
private static void whoAmI(boolean canLogOut) {
AccountInfo account = getUserAccount();
final UserPopupPanel userPopup = new UserPopupPanel(account, canLogOut, true);
final FlowPanel userSummaryPanel = new FlowPanel();
class PopupHandler implements KeyDownHandler, ClickHandler {
private void showHidePopup() {
if (userPopup.isShowing() && userPopup.isVisible()) {
userPopup.hide();
} else {
userPopup.showRelativeTo(userSummaryPanel);
}
}
@Override
public void onClick(ClickEvent event) {
showHidePopup();
}
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
showHidePopup();
event.preventDefault();
}
}
}
final PopupHandler popupHandler = new PopupHandler();
final InlineLabel l = new InlineLabel(FormatUtil.name(account));
l.setStyleName(RESOURCES.css().menuBarUserName());
final AvatarImage avatar = new AvatarImage(account, 26, false);
avatar.setStyleName(RESOURCES.css().menuBarUserNameAvatar());
userSummaryPanel.setStyleName(RESOURCES.css().menuBarUserNamePanel());
userSummaryPanel.add(l);
userSummaryPanel.add(avatar);
// "BLACK DOWN-POINTING SMALL TRIANGLE"
userSummaryPanel.add(new InlineLabel(" ▾"));
userPopup.addAutoHidePartner(userSummaryPanel.getElement());
FocusPanel fp = new FocusPanel(userSummaryPanel);
fp.setStyleName(RESOURCES.css().menuBarUserNameFocusPanel());
fp.addKeyDownHandler(popupHandler);
fp.addClickHandler(popupHandler);
menuRight.add(fp);
}
use of com.google.gwt.event.dom.client.ClickHandler 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.gwt.event.dom.client.ClickHandler 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.gwt.event.dom.client.ClickHandler 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