void select() {
   DownloadCommandPanel parent = (DownloadCommandPanel) getParent();
   for (Widget w : parent) {
     if (w != this && w instanceof DownloadCommandLink) {
       w.removeStyleName(Gerrit.RESOURCES.css().downloadLink_Active());
     }
   }
   parent.setCurrentCommand(this);
   addStyleName(Gerrit.RESOURCES.css().downloadLink_Active());
 }
Example #2
0
 private void row(Grid grid, int row, String name, Widget field) {
   final CellFormatter fmt = grid.getCellFormatter();
   if (LocaleInfo.getCurrentLocale().isRTL()) {
     grid.setText(row, 1, name);
     grid.setWidget(row, 0, field);
     fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().header());
   } else {
     grid.setText(row, 0, name);
     grid.setWidget(row, 1, field);
     fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().header());
   }
 }
  @Override
  protected void onInitUI() {
    super.onInitUI();
    table =
        new ChangeTable2() {
          {
            keysNavigation.add(
                new KeyCommand(0, 'R', Util.C.keyReloadSearch()) {
                  @Override
                  public void onKeyPress(final KeyPressEvent event) {
                    Gerrit.display(getToken());
                  }
                });
          }
        };
    table.addStyleName(Gerrit.RESOURCES.css().accountDashboard());

    outgoing = new ChangeTable2.Section();
    incoming = new ChangeTable2.Section();
    closed = new ChangeTable2.Section();

    outgoing.setTitleText(Util.C.outgoingReviews());
    incoming.setTitleText(Util.C.incomingReviews());
    incoming.setHighlightUnreviewed(mine);
    closed.setTitleText(Util.C.recentlyClosed());

    table.addSection(outgoing);
    table.addSection(incoming);
    table.addSection(closed);
    add(table);
    table.setSavePointerId("owner:" + ownerId);
  }
    void addOne(final AgreementInfo info, final String k) {
      final int row = table.getRowCount();
      table.insertRow(row);
      applyDataRowStyle(row);

      final ContributorAgreement cla = info.agreements.get(k);
      final String statusName;
      if (cla == null) {
        statusName = Util.C.agreementStatus_EXPIRED();
      } else {
        statusName = Util.C.agreementStatus_VERIFIED();
      }
      table.setText(row, 1, statusName);

      if (cla == null) {
        table.setText(row, 2, "");
        table.setText(row, 3, "");
      } else {
        final String url = cla.getAgreementUrl();
        if (url != null && url.length() > 0) {
          final Anchor a = new Anchor(cla.getName(), url);
          a.setTarget("_blank");
          table.setWidget(row, 2, a);
        } else {
          table.setText(row, 2, cla.getName());
        }
        table.setText(row, 3, cla.getDescription());
      }
      final FlexCellFormatter fmt = table.getFlexCellFormatter();
      for (int c = 1; c < 4; c++) {
        fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
      }

      setRowItem(row, cla);
    }
 public DownloadCommandLink(DownloadCommand cmdType, String text) {
   super(text);
   this.cmdType = cmdType;
   setStyleName(Gerrit.RESOURCES.css().downloadLink());
   Roles.getTabRole().set(getElement());
   addClickHandler(this);
 }
  public void loadTable(final IncludedInDetail detail) {
    int row = 0;
    table.resizeRows(detail.getBranches().size() + 1);
    table.addStyleName(Gerrit.RESOURCES.css().changeTable());
    final CellFormatter fmt = table.getCellFormatter();
    fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().dataHeader());
    table.setText(row, 0, Util.C.includedInTableBranch());

    for (final String branch : detail.getBranches()) {
      fmt.addStyleName(++row, 0, Gerrit.RESOURCES.css().dataCell());
      fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().leftMostCell());
      table.setText(row, 0, branch);
    }

    if (!detail.getTags().isEmpty()) {
      table.resizeRows(table.getRowCount() + 2 + detail.getTags().size());
      row++;
      fmt.addStyleName(++row, 0, Gerrit.RESOURCES.css().dataHeader());
      table.setText(row, 0, Util.C.includedInTableTag());

      for (final String tag : detail.getTags()) {
        fmt.addStyleName(++row, 0, Gerrit.RESOURCES.css().dataCell());
        fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().leftMostCell());
        table.setText(row, 0, tag);
      }
    }

    table.setVisible(true);
    loaded = true;
  }
    AgreementTable() {
      table.setWidth("");
      table.setText(0, 1, Util.C.agreementStatus());
      table.setText(0, 2, Util.C.agreementName());
      table.setText(0, 3, Util.C.agreementDescription());

      final FlexCellFormatter fmt = table.getFlexCellFormatter();
      for (int c = 1; c < 4; c++) {
        fmt.addStyleName(0, c, Gerrit.RESOURCES.css().dataHeader());
      }
    }
  private AccountLinkPanel(AccountInfo ai, Function<String, String> nameToQuery) {
    addStyleName(Gerrit.RESOURCES.css().accountLinkPanel());

    InlineHyperlink l =
        new InlineHyperlink(FormatUtil.name(ai), nameToQuery.apply(name(ai))) {
          @Override
          public void go() {
            Gerrit.display(getTargetHistoryToken());
          }
        };
    l.setTitle(FormatUtil.nameEmail(ai));

    add(new AvatarImage(ai));
    add(l);
  }
 public CommitMessageBlock() {
   description = new HTML();
   description.setStyleName(Gerrit.RESOURCES.css().changeScreenDescription());
   initWidget(description);
 }
Example #10
0
  @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);
  }