@@ -39,6 +39,7 @@ import kotlinx.coroutines.cancel
3939import kotlinx.coroutines.launch
4040import java.awt.Dimension
4141import javax.swing.JComponent
42+ import javax.swing.JLabel
4243import javax.swing.event.DocumentEvent
4344
4445class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections , Disposable {
@@ -62,36 +63,42 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Dis
6263 label(CoderGatewayBundle .message(" gateway.connector.recentconnections.title" )).applyToComponent {
6364 font = JBFont .h3().asBold()
6465 }
65- label(" " ).resizableColumn().horizontalAlign(HorizontalAlign .FILL )
66- searchBar = cell(SearchTextField (false )).applyToComponent {
67- minimumSize = Dimension (350 , - 1 )
68- textEditor.border = JBUI .Borders .empty(2 , 5 , 2 , 0 )
69- addDocumentListener(object : DocumentAdapter () {
70- override fun textChanged (e : DocumentEvent ) {
71- val toSearchFor = this @applyToComponent.text
72- val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ? : false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ? : false }
73- updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
74- }
75- })
76- }.component
66+ panel {
67+ indent {
68+ row {
69+ cell(JLabel ()).resizableColumn().horizontalAlign(HorizontalAlign .FILL )
70+ searchBar = cell(SearchTextField (false )).resizableColumn().horizontalAlign(HorizontalAlign .FILL ).applyToComponent {
71+ minimumSize = Dimension (350 , - 1 )
72+ textEditor.border = JBUI .Borders .empty(2 , 5 , 2 , 0 )
73+ addDocumentListener(object : DocumentAdapter () {
74+ override fun textChanged (e : DocumentEvent ) {
75+ val toSearchFor = this @applyToComponent.text
76+ val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ? : false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ? : false }
77+ updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
78+ }
79+ })
80+ }.component
7781
78- actionButton(
79- object : DumbAwareAction (CoderGatewayBundle .message(" gateway.connector.recentconnections.new.wizard.button.tooltip" ), null , AllIcons .General .Add ) {
80- override fun actionPerformed (e : AnActionEvent ) {
81- rootPanel.apply {
82- removeAll()
83- addToCenter(CoderGatewayConnectorWizardWrapperView {
84- rootPanel.apply {
85- removeAll()
86- addToCenter(contentPanel)
87- updateUI()
82+ actionButton(
83+ object : DumbAwareAction (CoderGatewayBundle .message(" gateway.connector.recentconnections.new.wizard.button.tooltip" ), null , AllIcons .General .Add ) {
84+ override fun actionPerformed (e : AnActionEvent ) {
85+ rootPanel.apply {
86+ removeAll()
87+ addToCenter(CoderGatewayConnectorWizardWrapperView {
88+ rootPanel.apply {
89+ removeAll()
90+ addToCenter(contentPanel)
91+ updateUI()
92+ }
93+ }.component)
94+ updateUI()
95+ }
8896 }
89- }.component)
90- updateUI()
91- }
97+ },
98+ ).gap(RightGap .SMALL )
9299 }
93- },
94- ).gap( RightGap . SMALL )
100+ }
101+ }
95102 }.bottomGap(BottomGap .MEDIUM )
96103 separator(background = WelcomeScreenUIManager .getSeparatorColor())
97104 row {
0 commit comments