Skip to content

Commit 831fdec

Browse files
committed
Reset sorting if possible when hiding the current sorting column
1 parent 4b50472 commit 831fdec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/swing/ProfilerColumnModel.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import java.util.Map;
5454
import java.util.Properties;
5555
import java.util.Set;
56+
import javax.swing.SortOrder;
5657
import javax.swing.table.DefaultTableColumnModel;
5758
import javax.swing.table.TableColumn;
5859

@@ -259,7 +260,9 @@ void hideColumn(TableColumn column, ProfilerTable table) {
259260
if (sortColumn == column.getModelIndex()) {
260261
int newSortColumn = table.convertColumnIndexToView(sortColumn);
261262
newSortColumn = getPreviousVisibleColumn(newSortColumn);
262-
sorter.setSortColumn(getColumn(newSortColumn).getModelIndex());
263+
int modelIndex = getColumn(newSortColumn).getModelIndex();
264+
if (!sorter.allowsThreeStateColumns()) sorter.setSortColumn(modelIndex);
265+
else sorter.setSortColumn(modelIndex, SortOrder.UNSORTED);
263266
}
264267
}
265268
}

0 commit comments

Comments
 (0)