instead tell user that column is not sortable

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

diff --git 
a/frontend/client/src/autotest/afe/SelectableProfileStaticHostTable.java 
b/frontend/client/src/autotest/afe/SelectableProfileStaticHostTable.java
index c98ea3d..d2ea756 100644
--- a/frontend/client/src/autotest/afe/SelectableProfileStaticHostTable.java
+++ b/frontend/client/src/autotest/afe/SelectableProfileStaticHostTable.java
@@ -2,13 +2,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 SelectableProfileStaticHostTable extends SelectableHostTable {
     protected static final String[][] HOST_COLUMNS_SELECT_PROFILE;
-
+    protected static final int profileColumn = HOST_COLUMNS_SELECT.length;
+    
     static {
         ArrayList<String[]> list = new 
ArrayList<String[]>(Arrays.asList(HOST_COLUMNS_SELECT));
         list.add(new String[] {"current_profile", "Current Profile"});
@@ -22,4 +24,15 @@ public class SelectableProfileStaticHostTable extends 
SelectableHostTable {
     protected boolean isProfileColumn(int column) {
         return false;
     }
+    
+    @Override
+    protected void onCellClicked(int row, int cell, boolean isRightClick) {
+        if (row == headerRow && cell == profileColumn) { 
+            // 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