Skip to content

Commit 861a705

Browse files
committed
feat: #6 Improve field navigation in confluence server connection dialog.
1 parent 3943e8a commit 861a705

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugins/confluence/src/main/java/com/github/vogoltsov/vp/plugins/confluence/dialog/ConfluenceServerConnectionDialog.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import javax.swing.SwingConstants;
2323
import java.awt.GridBagConstraints;
2424
import java.awt.GridBagLayout;
25+
import java.awt.event.ActionEvent;
2526
import java.net.MalformedURLException;
2627
import java.net.URL;
2728
import java.util.Optional;
@@ -91,6 +92,7 @@ public boolean verify(JComponent input) {
9192
this.connectButton.setEnabled(!this.confluenceServerUrlField.getText().isEmpty());
9293
}
9394
);
95+
this.confluenceServerUrlField.addActionListener(e -> this.usernameField.requestFocus());
9496
contentsPanel.add(this.confluenceServerUrlField, gbc);
9597
}
9698
// new row
@@ -139,6 +141,7 @@ public boolean verify(JComponent input) {
139141
this.usernameField.getDocument().addDocumentListener(
140142
(DocumentListenerAdapter) e -> this.passwordField.setEnabled(!this.usernameField.getText().isEmpty())
141143
);
144+
this.usernameField.addActionListener(e -> this.passwordField.requestFocus());
142145
contentsPanel.add(this.usernameField, gbc);
143146
}
144147
// new row
@@ -155,6 +158,7 @@ public boolean verify(JComponent input) {
155158
// input
156159
gbc.gridx++;
157160
this.passwordField = new JPasswordField(10);
161+
this.passwordField.addActionListener(e -> this.connectButton.doClick());
158162
this.passwordField.setEnabled(false);
159163
contentsPanel.add(this.passwordField, gbc);
160164
}

0 commit comments

Comments
 (0)