ZipFormatter: Do not wrap columns on whitespaces
Change-Id: Ifb07b80d0f73881064d1665904c68a75f8475038
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/xdocs/formatter/HtmlBuilder.java b/src/main/java/com/googlesource/gerrit/plugins/xdocs/formatter/HtmlBuilder.java
index c971df5..c55944a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/xdocs/formatter/HtmlBuilder.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/xdocs/formatter/HtmlBuilder.java
@@ -67,6 +67,10 @@
return open("table");
}
+ public HtmlBuilder openTable(String styleName) {
+ return open("table", styleName);
+ }
+
public HtmlBuilder closeTable() {
return close("table");
}
@@ -100,6 +104,16 @@
return this;
}
+ public HtmlBuilder open(String tag, String styleName) {
+ html.append("<")
+ .append(tag)
+ .append(" ")
+ .append("class=")
+ .append(styleName)
+ .append(">");
+ return this;
+ }
+
public HtmlBuilder close(String tag) {
html.append("</").append(tag).append(">");
return this;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/xdocs/formatter/ZipFormatter.java b/src/main/java/com/googlesource/gerrit/plugins/xdocs/formatter/ZipFormatter.java
index d1a843e..257ee9e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/xdocs/formatter/ZipFormatter.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/xdocs/formatter/ZipFormatter.java
@@ -48,7 +48,7 @@
.openHead()
.closeHead()
.openBody()
- .openTable()
+ .openTable("xdoc-zip-table")
.appendCellHeader("name")
.appendCellHeader("size")
.appendCellHeader("last modified");
diff --git a/src/main/resources/com/googlesource/gerrit/plugins/xdocs/formatter/zip.css b/src/main/resources/com/googlesource/gerrit/plugins/xdocs/formatter/zip.css
new file mode 100644
index 0000000..1ffd8f2
--- /dev/null
+++ b/src/main/resources/com/googlesource/gerrit/plugins/xdocs/formatter/zip.css
@@ -0,0 +1,18 @@
+/* Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+.xdoc-zip-table td {
+ white-space: nowrap;
+}