@@ -656,6 +656,16 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
656
656
return workspace?.name
657
657
}
658
658
659
+ override fun getComparator (): Comparator <WorkspaceAgentModel >? {
660
+ return Comparator { a, b ->
661
+ if (a == = b) 0
662
+ if (a == null ) - 1
663
+ if (b == null ) 1
664
+
665
+ a.name.compareTo(b.name, ignoreCase = true )
666
+ }
667
+ }
668
+
659
669
override fun getRenderer (item : WorkspaceAgentModel ? ): TableCellRenderer {
660
670
return object : DefaultTableCellRenderer () {
661
671
override fun getTableCellRendererComponent (table : JTable , value : Any , isSelected : Boolean , hasFocus : Boolean , row : Int , column : Int ): Component {
@@ -676,6 +686,16 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
676
686
return workspace?.templateName
677
687
}
678
688
689
+ override fun getComparator (): java.util.Comparator <WorkspaceAgentModel >? {
690
+ return Comparator { a, b ->
691
+ if (a == = b) 0
692
+ if (a == null ) - 1
693
+ if (b == null ) 1
694
+
695
+ a.templateName.compareTo(b.templateName, ignoreCase = true )
696
+ }
697
+ }
698
+
679
699
override fun getRenderer (item : WorkspaceAgentModel ? ): TableCellRenderer {
680
700
val simpleH3 = JBFont .h3()
681
701
@@ -729,6 +749,16 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
729
749
return workspace?.agentStatus?.label
730
750
}
731
751
752
+ override fun getComparator (): java.util.Comparator <WorkspaceAgentModel >? {
753
+ return Comparator { a, b ->
754
+ if (a == = b) 0
755
+ if (a == null ) - 1
756
+ if (b == null ) 1
757
+
758
+ a.agentStatus.label.compareTo(b.agentStatus.label, ignoreCase = true )
759
+ }
760
+ }
761
+
732
762
override fun getRenderer (item : WorkspaceAgentModel ? ): TableCellRenderer {
733
763
return object : DefaultTableCellRenderer () {
734
764
override fun getTableCellRendererComponent (table : JTable , value : Any , isSelected : Boolean , hasFocus : Boolean , row : Int , column : Int ): Component {
0 commit comments