mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-199540: request focus on tab switching
This commit is contained in:
+3
@@ -359,12 +359,15 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable, Con
|
||||
private void onTabChanged() {
|
||||
applyEditor(myCurrentTab.getSelectedTemplate());
|
||||
|
||||
FileTemplateTab tab = myCurrentTab;
|
||||
final int selectedIndex = myTabbedPane.getSelectedIndex();
|
||||
if (0 <= selectedIndex && selectedIndex < myTabs.length) {
|
||||
myCurrentTab = myTabs[selectedIndex];
|
||||
}
|
||||
((CardLayout)myLeftPanel.getLayout()).show(myLeftPanel, myCurrentTab.getTitle());
|
||||
onListSelectionChanged();
|
||||
// request focus to a list (or tree) later to avoid moving focus to the tabbed pane
|
||||
if (tab != myCurrentTab) EventQueue.invokeLater(myCurrentTab.getComponent()::requestFocus);
|
||||
}
|
||||
|
||||
private void onListSelectionChanged() {
|
||||
|
||||
Reference in New Issue
Block a user