Merge "Icon for showing changes for a project in the Projects->List screen"

This commit is contained in:
Edwin Kempin 2012-11-13 05:29:40 -08:00 committed by Gerrit Code Review
commit 7669e7813c
5 changed files with 24 additions and 2 deletions

View File

@ -42,4 +42,7 @@ public interface GerritResources extends ClientBundle {
@Source("downloadIcon.png")
public ImageResource downloadIcon();
@Source("queryProjectLink.png")
public ImageResource queryProjectLink();
}

View File

@ -107,6 +107,7 @@ public interface AdminConstants extends Constants {
String projectAdminTabGeneral();
String projectAdminTabBranches();
String projectAdminTabAccess();
String projectListQueryLink();
String plugins();
String pluginEnabled();

View File

@ -87,6 +87,7 @@ createProjectTitle = Create Project
projectAdminTabGeneral = General
projectAdminTabBranches = Branches
projectAdminTabAccess = Access
projectListQueryLink = Search for changes on this project
plugins = Plugins
pluginEnabled = Enabled

View File

@ -20,12 +20,16 @@ import com.google.gerrit.client.GitwebLink;
import com.google.gerrit.client.projects.ProjectInfo;
import com.google.gerrit.client.projects.ProjectMap;
import com.google.gerrit.client.rpc.ScreenLoadCallback;
import com.google.gerrit.client.ui.Hyperlink;
import com.google.gerrit.client.ui.InlineHyperlink;
import com.google.gerrit.client.ui.ProjectsTable;
import com.google.gerrit.client.ui.Screen;
import com.google.gerrit.common.PageLinks;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Widget;
public class ProjectListScreen extends Screen {
private ProjectsTable projects;
@ -78,7 +82,10 @@ public class ProjectListScreen extends Screen {
@Override
protected void populate(final int row, final ProjectInfo k) {
table.setWidget(row, 1, new Hyperlink(k.name(), link(k)));
FlowPanel fp = new FlowPanel();
fp.add(createSearchLink(k.name()));
fp.add(new InlineHyperlink(k.name(), link(k)));
table.setWidget(row, 1, fp);
table.setText(row, 2, k.description());
GitwebLink l = Gerrit.getGitwebLink();
if (l != null) {
@ -88,6 +95,16 @@ public class ProjectListScreen extends Screen {
setRowItem(row, k);
}
private Widget createSearchLink(String projectName) {
Image image = new Image(Gerrit.RESOURCES.queryProjectLink());
InlineHyperlink h = new InlineHyperlink(" ", PageLinks.toChangeQuery("project:" + projectName));
h.setTitle(Util.C.projectListQueryLink());
DOM.insertBefore(h.getElement(), image.getElement(),
DOM.getFirstChild(h.getElement()));
return h;
}
};
projects.setSavePointerId(PageLinks.ADMIN_PROJECTS);

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B