@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); }
private void display(JsArray<ChangeList> result) { if (!mine && !hasChanges(result)) { // When no results are returned and the data is not for the // current user, the target user is presumed to not exist. Gerrit.display(getToken(), new NotFoundScreen()); return; } ChangeList out = result.get(0); ChangeList in = result.get(1); ChangeList done = result.get(2); if (mine) { setWindowTitle(Util.C.myDashboardTitle()); setPageTitle(Util.C.myDashboardTitle()); } else { // The server doesn't tell us who the dashboard is for. Try to guess // by looking at a change started by the owner and extract the name. String name = guessName(out); if (name == null) { name = guessName(done); } if (name != null) { setWindowTitle(name); setPageTitle(Util.M.accountDashboardTitle(name)); } else { setWindowTitle(Util.C.unknownDashboardTitle()); setWindowTitle(Util.C.unknownDashboardTitle()); } } Collections.sort(Natives.asList(out), outComparator()); table.updateColumnsForLabels(out, in, done); outgoing.display(out); incoming.display(in); closed.display(done); table.finishDisplay(); }