Simplify spellchecker settings: flatten tabs

GitOrigin-RevId: 9eb156fc6251f01203698f50497720ee7476414c
This commit is contained in:
Olga Strizhenko
2020-06-10 20:31:04 +03:00
committed by intellij-monorepo-bot
parent 8af634808d
commit ad030d4304
3 changed files with 51 additions and 66 deletions
@@ -59,4 +59,4 @@ max.number.of.corrections=Maximum number of suggestions
use.single.dictionary=Use single dictionary for saving words
advanced.settings=Advanced settings
settings.tab.dictionaries=Dictionaries
settings.tab.accepted.words=Accepted Words
settings.tab.accepted.words=Accepted Words:
@@ -37,7 +37,8 @@
<properties/>
<border type="none"/>
<children>
<tabbedpane id="b70bc" class="com.intellij.ui.components.JBTabbedPane">
<grid id="b6b2d" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
@@ -46,84 +47,64 @@
<properties/>
<border type="none"/>
<children>
<grid id="b6b2d" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="607a1" binding="myPanelForCustomDictionaries" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title-resource-bundle="messages/SpellCheckerBundle" title-key="settings.tab.dictionaries"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="14ed7" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent"/>
</clientProperties>
<border type="none"/>
<children>
<grid id="607a1" binding="myPanelForCustomDictionaries" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<component id="52e36" class="com.intellij.ui.components.JBCheckBox" binding="myUseSingleDictionary">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<name value=""/>
<text resource-bundle="messages/SpellCheckerBundle" key="use.single.dictionary"/>
</properties>
</component>
<component id="bdb05" class="com.intellij.openapi.ui.ComboBox" binding="myDictionariesComboBox">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="14ed7" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
</component>
<hspacer id="37326">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent"/>
</clientProperties>
<border type="none"/>
<children>
<component id="52e36" class="com.intellij.ui.components.JBCheckBox" binding="myUseSingleDictionary">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<name value=""/>
<text resource-bundle="messages/SpellCheckerBundle" key="use.single.dictionary"/>
</properties>
</component>
<component id="bdb05" class="com.intellij.openapi.ui.ComboBox" binding="myDictionariesComboBox">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<hspacer id="37326">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
<vspacer id="53870">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</hspacer>
</children>
</grid>
<grid id="ba93e" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<vspacer id="53870">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<grid id="425d4" binding="myPanelForAcceptedWords" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title-resource-bundle="messages/SpellCheckerBundle" title-key="settings.tab.accepted.words"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="425d4" binding="panelForAcceptedWords" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
<children/>
</grid>
</children>
</tabbedpane>
</grid>
</children>
</grid>
</children>
@@ -23,7 +23,6 @@ import com.intellij.spellchecker.util.Strings;
import com.intellij.ui.*;
import com.intellij.ui.components.JBCheckBox;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
@@ -39,12 +38,14 @@ import static com.intellij.openapi.extensions.PluginId.getId;
import static com.intellij.spellchecker.SpellCheckerManager.DictionaryLevel.APP;
import static com.intellij.spellchecker.SpellCheckerManager.DictionaryLevel.PROJECT;
import static com.intellij.spellchecker.SpellCheckerManager.getBundledDictionaries;
import static com.intellij.ui.IdeBorderFactory.createTitledBorder;
import static com.intellij.util.ui.JBUI.insetsTop;
import static javax.swing.event.HyperlinkEvent.EventType.ACTIVATED;
public class SpellCheckerSettingsPane implements Disposable {
private JPanel root;
private JPanel linkContainer;
private JPanel panelForAcceptedWords;
private JPanel myPanelForAcceptedWords;
private JPanel myPanelForCustomDictionaries;
private JBCheckBox myUseSingleDictionary;
private ComboBox<String> myDictionariesComboBox;
@@ -92,8 +93,11 @@ public class SpellCheckerSettingsPane implements Disposable {
myDictionariesPanel = new CustomDictionariesPanel(settings, project, manager);
myPanelForCustomDictionaries.setBorder(
IdeBorderFactory.createTitledBorder(SpellCheckerBundle.message("add.dictionary.description", getHunspellDescription()),
false, JBUI.insetsTop(8)).setShowLine(false));
createTitledBorder(SpellCheckerBundle.message("add.dictionary.description", getHunspellDescription()),
false, insetsTop(8)).setShowLine(false));
myPanelForAcceptedWords
.setBorder(createTitledBorder(SpellCheckerBundle.message("settings.tab.accepted.words"), false, insetsTop(8)).setShowLine(false));
myPanelForCustomDictionaries.setLayout(new BorderLayout());
myPanelForCustomDictionaries.add(myDictionariesPanel, BorderLayout.CENTER);
@@ -130,8 +134,8 @@ public class SpellCheckerSettingsPane implements Disposable {
wordsPanel = new WordsPanel(manager);
panelForAcceptedWords.setLayout(new BorderLayout());
panelForAcceptedWords.add(wordsPanel, BorderLayout.CENTER);
myPanelForAcceptedWords.setLayout(new BorderLayout());
myPanelForAcceptedWords.add(wordsPanel, BorderLayout.CENTER);
}
private static String getHunspellDescription() {