Search in sources :

Example 1 with CopyableLabel

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;
}
Also used : CopyableLabel(com.google.gwtexpui.clippy.client.CopyableLabel)

Example 2 with CopyableLabel

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();
    }
}
Also used : TableRowElement(com.google.gwt.dom.client.TableRowElement) TableRowElement(com.google.gwt.dom.client.TableRowElement) Element(com.google.gwt.dom.client.Element) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) CommitInfo(com.google.gerrit.client.info.ChangeInfo.CommitInfo) CopyableLabel(com.google.gwtexpui.clippy.client.CopyableLabel)

Example 3 with CopyableLabel

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);
}
Also used : Grid(com.google.gwt.user.client.ui.Grid) Label(com.google.gwt.user.client.ui.Label) CopyableLabel(com.google.gwtexpui.clippy.client.CopyableLabel) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) CopyableLabel(com.google.gwtexpui.clippy.client.CopyableLabel) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter)

Example 4 with CopyableLabel

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);
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(com.google.gwt.user.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Grid(com.google.gwt.user.client.ui.Grid) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) NativeString(com.google.gerrit.client.rpc.NativeString) CopyableLabel(com.google.gwtexpui.clippy.client.CopyableLabel) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter)

Example 5 with CopyableLabel

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);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) CopyableLabel(com.google.gwtexpui.clippy.client.CopyableLabel)

Aggregations

CopyableLabel (com.google.gwtexpui.clippy.client.CopyableLabel)6 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)3 Grid (com.google.gwt.user.client.ui.Grid)2 CellFormatter (com.google.gwt.user.client.ui.HTMLTable.CellFormatter)2 CommitInfo (com.google.gerrit.client.info.ChangeInfo.CommitInfo)1 FetchInfo (com.google.gerrit.client.info.ChangeInfo.FetchInfo)1 NativeString (com.google.gerrit.client.rpc.NativeString)1 SmallHeading (com.google.gerrit.client.ui.SmallHeading)1 Element (com.google.gwt.dom.client.Element)1 TableRowElement (com.google.gwt.dom.client.TableRowElement)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Anchor (com.google.gwt.user.client.ui.Anchor)1 Button (com.google.gwt.user.client.ui.Button)1 Label (com.google.gwt.user.client.ui.Label)1 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)1