use of com.google.gwtexpui.clippy.client.CopyableLabel in project gerrit by GerritCodeReview.
the class CommitBox method getCommitLabel.
private CopyableLabel getCommitLabel(CommitInfo c) {
CopyableLabel copyLabel;
copyLabel = new CopyableLabel(c.commit());
copyLabel.setTitle(c.subject());
copyLabel.setStyleName(style.clippy());
return copyLabel;
}
use of com.google.gwtexpui.clippy.client.CopyableLabel in project gerrit by GerritCodeReview.
the class CommitBox method setParents.
private void setParents(JsArray<CommitInfo> commits) {
setVisible(firstParent, true);
TableRowElement next = firstParent;
TableRowElement previous = null;
for (CommitInfo c : Natives.asList(commits)) {
if (next == firstParent) {
CopyableLabel copyLabel = getCommitLabel(c);
parentCommits.add(copyLabel);
setWebLinks(parentWebLinks, c);
} else {
next.appendChild(DOM.createTD());
Element td1 = DOM.createTD();
td1.appendChild(getCommitLabel(c).getElement());
next.appendChild(td1);
FlowPanel linksPanel = new FlowPanel();
linksPanel.addStyleName(style.parentWebLink());
setWebLinks(linksPanel, c);
Element td2 = DOM.createTD();
td2.appendChild(linksPanel.getElement());
next.appendChild(td2);
previous.getParentElement().insertAfter(next, previous);
}
previous = next;
next = DOM.createTR().cast();
}
}
use of com.google.gwtexpui.clippy.client.CopyableLabel in project gerrit by GerritCodeReview.
the class MyOAuthTokenScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
tokenLabel = new CopyableLabel("");
tokenLabel.addStyleName(Gerrit.RESOURCES.css().oauthToken());
expiresLabel = new Label("");
expiresLabel.addStyleName(Gerrit.RESOURCES.css().oauthExpires());
grid = new Grid(2, 2);
grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
grid.addStyleName(Gerrit.RESOURCES.css().oauthInfoBlock());
add(grid);
expiredNote = new Label(Util.C.labelOAuthExpired());
expiredNote.setVisible(false);
add(expiredNote);
row(grid, 0, Util.C.labelOAuthToken(), tokenLabel);
row(grid, 1, Util.C.labelOAuthExpires(), expiresLabel);
CellFormatter fmt = grid.getCellFormatter();
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
flow = new FlowPanel();
flow.setStyleName(Gerrit.RESOURCES.css().oauthPanel());
add(flow);
Label netrcLabel = new Label(Util.C.labelOAuthNetRCEntry());
netrcLabel.setStyleName(Gerrit.RESOURCES.css().oauthPanelNetRCHeading());
flow.add(netrcLabel);
netrcValue = new CopyableLabel("");
netrcValue.setStyleName(Gerrit.RESOURCES.css().oauthPanelNetRCEntry());
flow.add(netrcValue);
Label cookieLabel = new Label(Util.C.labelOAuthGitCookie());
cookieLabel.setStyleName(Gerrit.RESOURCES.css().oauthPanelCookieHeading());
flow.add(cookieLabel);
cookieValue = new CopyableLabel("");
cookieValue.setStyleName(Gerrit.RESOURCES.css().oauthPanelCookieEntry());
flow.add(cookieValue);
}
use of com.google.gwtexpui.clippy.client.CopyableLabel in project gerrit by GerritCodeReview.
the class MyPasswordScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
String url = Gerrit.info().auth().httpPasswordUrl();
if (url != null) {
Anchor link = new Anchor();
link.setText(Util.C.linkObtainPassword());
link.setHref(url);
link.setTarget("_blank");
add(link);
return;
}
password = new CopyableLabel("(click 'generate' to revoke an old password)");
password.addStyleName(Gerrit.RESOURCES.css().accountPassword());
generatePassword = new Button(Util.C.buttonGeneratePassword());
generatePassword.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
doGeneratePassword();
}
});
final Grid userInfo = new Grid(2, 2);
final CellFormatter fmt = userInfo.getCellFormatter();
userInfo.setStyleName(Gerrit.RESOURCES.css().infoBlock());
userInfo.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
add(userInfo);
row(userInfo, 0, Util.C.userName(), new UsernameField());
row(userInfo, 1, Util.C.password(), password);
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
final FlowPanel buttons = new FlowPanel();
buttons.add(generatePassword);
add(buttons);
}
use of com.google.gwtexpui.clippy.client.CopyableLabel in project gerrit by GerritCodeReview.
the class AccountGroupInfoScreen method initUUID.
private void initUUID() {
final VerticalPanel groupUUIDPanel = new VerticalPanel();
groupUUIDPanel.setStyleName(Gerrit.RESOURCES.css().groupUUIDPanel());
groupUUIDPanel.add(new SmallHeading(AdminConstants.I.headingGroupUUID()));
groupUUIDLabel = new CopyableLabel("");
groupUUIDPanel.add(groupUUIDLabel);
add(groupUUIDPanel);
}
Aggregations