since thes are derived columns they are not handled
by default sorting mechanism - instead inform the user
that columns are not sortable

Signed-off-by: Julius Gawlas <[email protected]>
---
 .../src/autotest/afe/SelectableHostTable.java      |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/frontend/client/src/autotest/afe/SelectableHostTable.java 
b/frontend/client/src/autotest/afe/SelectableHostTable.java
index 535ce96..46b229b 100644
--- a/frontend/client/src/autotest/afe/SelectableHostTable.java
+++ b/frontend/client/src/autotest/afe/SelectableHostTable.java
@@ -1,13 +1,15 @@
 package autotest.afe;
 
 import autotest.common.table.DataSource;
-import autotest.common.table.DynamicTable;
+import autotest.common.ui.NotifyManager;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 
 public class SelectableHostTable extends HostTable {
     protected static final String[][] HOST_COLUMNS_SELECT;
+    private final int PLATFORM_COLUMN = 2;
+    private final int LABELS_COLUMN = 3;
 
     static {
         ArrayList<String[]> list = new 
ArrayList<String[]>(Arrays.asList(HOST_COLUMNS));
@@ -22,4 +24,14 @@ public class SelectableHostTable extends HostTable {
     public SelectableHostTable(String[][] columns, DataSource dataSource) {
         super(columns, dataSource);
     }
+    
+    @Override
+    protected void onCellClicked(int row, int cell, boolean isRightClick) {
+        if (row == headerRow && (cell == PLATFORM_COLUMN || cell == 
LABELS_COLUMN) ) { 
+            // prevent sorting error on derived columns
+            NotifyManager.getInstance().showMessage("Sorting is not supported 
for this column.");
+            return;
+        }
+        super.onCellClicked(row, cell, isRightClick);
+    }
 }
-- 
1.7.7.6

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

Reply via email to