mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Set initial focus on options tree in configure code style on selected fragment dialog
This commit is contained in:
+11
-1
@@ -39,6 +39,7 @@ class CodeFragmentCodeStyleSettingsPanel extends TabbedLanguageCodeStylePanel {
|
||||
|
||||
private final CodeStyleSettingsCodeFragmentFilter.CodeStyleSettingsToShow mySettingsToShow;
|
||||
private final SelectedTextFormatter mySelectedTextFormatter;
|
||||
private SpacesPanelWithoutPreview mySpacesPanel;
|
||||
|
||||
public CodeFragmentCodeStyleSettingsPanel(@NotNull CodeStyleSettings settings,
|
||||
@NotNull CodeStyleSettingsCodeFragmentFilter.CodeStyleSettingsToShow settingsToShow,
|
||||
@@ -63,11 +64,16 @@ class CodeFragmentCodeStyleSettingsPanel extends TabbedLanguageCodeStylePanel {
|
||||
|
||||
@Override
|
||||
protected void initTabs(CodeStyleSettings settings) {
|
||||
addTab(new SpacesPanelWithoutPreview(settings));
|
||||
mySpacesPanel = new SpacesPanelWithoutPreview(settings);
|
||||
addTab(mySpacesPanel);
|
||||
addTab(new WrappingAndBracesPanelWithoutPreview(settings));
|
||||
reset(getSettings());
|
||||
}
|
||||
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
return mySpacesPanel.getPreferredFocusedComponent();
|
||||
}
|
||||
|
||||
public static CodeStyleSettingsCodeFragmentFilter.CodeStyleSettingsToShow calcSettingNamesToShow(CodeStyleSettingsCodeFragmentFilter filter) {
|
||||
return filter.getFieldNamesAffectingCodeFragment(SPACING_SETTINGS, WRAPPING_AND_BRACES_SETTINGS);
|
||||
}
|
||||
@@ -129,6 +135,10 @@ class CodeFragmentCodeStyleSettingsPanel extends TabbedLanguageCodeStylePanel {
|
||||
protected String getPreviewText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
return myOptionsTree;
|
||||
}
|
||||
}
|
||||
|
||||
private class WrappingAndBracesPanelWithoutPreview extends MyWrappingAndBracesPanel {
|
||||
|
||||
+6
@@ -121,6 +121,12 @@ public class ConfigureCodeStyleOnSelectedFragment implements IntentionAction {
|
||||
init();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
return myTabbedLanguagePanel.getPreferredFocusedComponent();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected JComponent createCenterPanel() {
|
||||
|
||||
Reference in New Issue
Block a user