since this is not supported display message informing the user instead of throwing exception
Signed-off-by: Julius Gawlas <[email protected]> --- .../src/autotest/afe/ProfileSelectHostTable.java | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/frontend/client/src/autotest/afe/ProfileSelectHostTable.java b/frontend/client/src/autotest/afe/ProfileSelectHostTable.java index ab88135..e774421 100644 --- a/frontend/client/src/autotest/afe/ProfileSelectHostTable.java +++ b/frontend/client/src/autotest/afe/ProfileSelectHostTable.java @@ -2,15 +2,18 @@ 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 ProfileSelectHostTable extends HostTable { protected static final String[][] HOST_COLUMNS_PROFILE; + protected static int profileColumn; static { ArrayList<String[]> list = new ArrayList<String[]>(Arrays.asList(HOST_COLUMNS)); + profileColumn = HOST_COLUMNS.length; list.add(new String[] {"current_profile", "Selected Profile"}); HOST_COLUMNS_PROFILE = list.toArray(new String[0][0]); } @@ -18,4 +21,15 @@ public class ProfileSelectHostTable extends HostTable { public ProfileSelectHostTable(DataSource dataSource) { super(HOST_COLUMNS_PROFILE, dataSource); } + + @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
