Implement PatchSetSelectBox2

Implemented a new version of PatchSetSelectBox. Used
InlineHyperlink with actual hrefs so that they can be
opened in new tabs / windows.

The download link hasn't been implemented yet.

Change-Id: I2da78663f0fbd6a6713129dff945b2a161570430
This commit is contained in:
Michael Zhou
2013-07-31 16:43:18 -07:00
parent 3fe44e489d
commit f7d6301e8b
11 changed files with 281 additions and 78 deletions

View File

@@ -169,7 +169,7 @@ class Header extends Composite {
if (info != null) {
final String url = url(info);
link.setTargetHistoryToken(url);
link.setTitle(getFileName(info.path()));
link.setTitle(FileInfo.getFileName(info.path()));
keys.add(new KeyCommand(0, key, help) {
@Override
public void onKeyPress(KeyPressEvent event) {
@@ -187,14 +187,6 @@ class Header extends Composite {
}
}
private static String getFileName(String path) {
String fileName = Patch.COMMIT_MSG.equals(path)
? Util.C.commitMessage()
: path;
int s = fileName.lastIndexOf('/');
return s >= 0 ? fileName.substring(s + 1) : fileName;
}
boolean hasPrev() {
return hasPrev;
}