GP-4227 fixed several focus traversal issues

This commit is contained in:
ghidragon 2024-01-29 16:22:50 -05:00
parent 59972bb9f1
commit 3d333c071b
18 changed files with 1448 additions and 150 deletions

View file

@ -46,8 +46,8 @@ public class StatusBar extends JPanel {
private static final Border STATUS_BORDER = BorderFactory.createCompoundBorder(
BorderFactory.createLoweredBevelBorder(), BorderFactory.createEmptyBorder(1, 2, 1, 2));
private static final Border STATUS_ITEM_BORDER = BorderFactory.createCompoundBorder(
BorderFactory.createEmptyBorder(0, 3, 0, 0), STATUS_BORDER);
private static final Border STATUS_ITEM_BORDER = BorderFactory
.createCompoundBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0), STATUS_BORDER);
private static final int STATUS_BAR_GAP = 3;
private static final int MESSAGE_QUEUE_MAX_SIZE = 10;
@ -124,6 +124,14 @@ public class StatusBar extends JPanel {
button.addActionListener(e -> callback.run());
button.setToolTipText("Press to show the primary application window");
// We currently don't support components outside of DockingComponents (Except for
// JTabbedPanes) getting focus. If this button were to get focus via keyboard traversal, the
// DockingWindowManager would "fix" the focus and put it back to the last DockingComponent,
// effectively creating a dead end for keyboard traversal.
// Also, the button being focusable could possibly be confusing since this button is about
// changing focus to the front-end.
button.setFocusable(false);
homeButtonPanel.add(button);
}
@ -256,7 +264,8 @@ public class StatusBar extends JPanel {
}
private void addMessageToQueue(String message) {
if (message != null && message.trim().length() != 0) {
if (message != null && message.trim()
.length() != 0) {
if (message.endsWith("\n")) {
message = message.substring(0, message.length() - 1);
}