From f696f7cd36957edcf9fe885fe01decbc697c1724 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Tue, 18 Jan 2011 10:28:23 +0000
Subject: [PATCH] LMS-1949 Extensions to SimpleTableModelBuilder to simplify
 adding headers and columns from jython.

SVN: 19461
---
 .../shared/util/SimpleTableModelBuilder.java  | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/SimpleTableModelBuilder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/SimpleTableModelBuilder.java
index 4254eab1a16..0ecce45dcd8 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/SimpleTableModelBuilder.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/SimpleTableModelBuilder.java
@@ -238,6 +238,27 @@ public class SimpleTableModelBuilder
         return DataTypeCode.VARCHAR;
     }
 
+    public SimpleTableModelBuilder addFullHeader(String... titles)
+    {
+        for (String title : titles)
+        {
+            addHeader(title);
+        }
+
+        return this;
+    }
+
+    public SimpleTableModelBuilder addFullRow(String... values)
+    {
+        List<ISerializableComparable> rowValues = new ArrayList<ISerializableComparable>();
+        for (String value : values)
+        {
+            rowValues.add(SimpleTableModelBuilder.asText(value));
+        }
+        addRow(rowValues);
+        return this;
+    }
+
     public String tryGetMessage()
     {
         return messageOrNull;
-- 
GitLab