use 'locked' filed as table column but
change the text on the fly using preprocessrow

Signed-off-by: Julius Gawlas <[email protected]>
---
 frontend/client/src/autotest/afe/HostTable.java |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/frontend/client/src/autotest/afe/HostTable.java 
b/frontend/client/src/autotest/afe/HostTable.java
index 65019bc..a55652e 100644
--- a/frontend/client/src/autotest/afe/HostTable.java
+++ b/frontend/client/src/autotest/afe/HostTable.java
@@ -11,9 +11,11 @@ public class HostTable extends DynamicTable {
        private final int MAX_LABELS_COLUMN_WIDTH = 40;
        
     protected static final String[][] HOST_COLUMNS = {
-        {"hostname", "Hostname"}, {"platform", "Platform"}, 
-        {HostDataSource.OTHER_LABELS, "Other labels"}, {"status", "Status"}, 
-        {HostDataSource.LOCKED_TEXT, "Locked"},
+        {"hostname", "Hostname"}, 
+        {"platform", "Platform"}, 
+        {HostDataSource.OTHER_LABELS, "Other labels"}, 
+        {"status", "Status"}, 
+        {"locked", "Locked"},
     };
     
     public HostTable(DataSource dataSource) {
@@ -32,5 +34,7 @@ public class HostTable extends DynamicTable {
                        host.put(HostDataSource.OTHER_LABELS, 
                                        new 
JSONString(Utils.splitIntoLines(otherLabels, MAX_LABELS_COLUMN_WIDTH)));
        }
-    }
+        if ( host.containsKey(HostDataSource.LOCKED_TEXT) )
+            host.put("locked", host.get(HostDataSource.LOCKED_TEXT));
+    }    
 }
-- 
1.7.7.6

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to