Class ConfigurationDialog

java.lang.Object
org.languagetool.gui.ConfigurationDialog
All Implemented Interfaces:
ActionListener, EventListener

public class ConfigurationDialog extends Object implements ActionListener
Dialog that offers the available rules so they can be turned on/off individually.
  • Field Details

    • NO_SELECTED_LANGUAGE

      private static final String NO_SELECTED_LANGUAGE
      See Also:
    • ACTION_COMMAND_OK

      private static final String ACTION_COMMAND_OK
      See Also:
    • ACTION_COMMAND_CANCEL

      private static final String ACTION_COMMAND_CANCEL
      See Also:
    • MAX_PORT

      private static final int MAX_PORT
      See Also:
    • SHIFT1

      private static final int SHIFT1
      See Also:
    • SHIFT2

      private static final int SHIFT2
      See Also:
    • SHIFT3

      private static final int SHIFT3
      See Also:
    • messages

      private final ResourceBundle messages
    • original

      private final Configuration original
    • config

      private final Configuration config
    • owner

      private final Frame owner
    • insideOffice

      private final boolean insideOffice
    • ltImage

      private final Image ltImage
    • dialogTitle

      private String dialogTitle
    • configChanged

      private boolean configChanged
    • profileChanged

      private boolean profileChanged
    • restartShow

      private boolean restartShow
    • firstSelection

      private boolean firstSelection
    • dialog

      private JDialog dialog
    • serverCheckbox

      private JCheckBox serverCheckbox
    • serverPortField

      private JTextField serverPortField
    • configTree

      private JTree[] configTree
    • rootNode

      private DefaultMutableTreeNode[] rootNode
    • serverSettingsCheckbox

      private JCheckBox serverSettingsCheckbox
    • disabledRulesPanel

      private JPanel disabledRulesPanel
    • enabledRulesPanel

      private JPanel enabledRulesPanel
    • extraPanels

      private final List<JPanel> extraPanels
    • configurableRules

      private final List<Rule> configurableRules
    • category

      private String category
    • rule

      private Rule rule
  • Constructor Details

    • ConfigurationDialog

      public ConfigurationDialog(Frame owner, boolean insideOffice, Configuration config)
    • ConfigurationDialog

      public ConfigurationDialog(Frame owner, boolean insideOffice, Image ltImage, String title, Configuration config)
  • Method Details

    • addExtraPanel

      void addExtraPanel(JPanel panel)
      Add extra JPanel to this dialog. If the panel implements , this dialog will call SavablePanel.save() after the user clicks OK.
      Parameters:
      panel - the JPanel to be added to this dialog
      Since:
      3.4
    • createTree

      private DefaultMutableTreeNode createTree(List<Rule> rules, boolean isStyle, String tabName, DefaultMutableTreeNode root)
    • getEnabledState

      private boolean getEnabledState(Rule rule)
    • show

      public boolean show(List<Rule> rules)
    • close

      public void close()
    • showPanel

      public boolean showPanel(List<Rule> rules)
    • createNonOfficeElements

      private void createNonOfficeElements(GridBagConstraints cons, JPanel portPanel)
    • addOfficeLanguageElements

      private void addOfficeLanguageElements(GridBagConstraints cons, JPanel portPanel)
    • addOfficeTextruleElements

      private void addOfficeTextruleElements(GridBagConstraints cons, JPanel portPanel)
    • getOfficeTechnicalElements

      private JPanel getOfficeTechnicalElements()
    • createOfficeElements

      private void createOfficeElements(GridBagConstraints cons, JPanel portPanel)
    • showRemoteServerHint

      private int showRemoteServerHint(Component component, boolean otherServer)
    • getTreeModel

      @NotNull private DefaultTreeModel getTreeModel(DefaultMutableTreeNode rootNode, List<Rule> rules)
    • getMouseAdapter

      @NotNull private MouseAdapter getMouseAdapter()
    • getTreeButtonPanel

      @NotNull private JPanel getTreeButtonPanel(int num)
    • getProfilePanel

      @NotNull private JPanel getProfilePanel(List<Rule> rules)
    • addColonToMessageString

      private String addColonToMessageString(String message)
    • getMotherTonguePanel

      @NotNull private JPanel getMotherTonguePanel(GridBagConstraints cons)
    • getNgramPanel

      private JPanel getNgramPanel()
    • addNgramPanel

      private void addNgramPanel(GridBagConstraints cons, JPanel panel)
    • getPossibleLanguages

      private String[] getPossibleLanguages(boolean addNoSeletion)
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • getLanguageForLocalizedName

      @Nullable private Language getLanguageForLocalizedName(String languageName)
      Get the Language object for the given localized language name.
      Parameters:
      languageName - e.g. English or German (case is significant)
      Returns:
      a Language object or null if the language could not be found
    • updateRulesTrees

      private void updateRulesTrees(List<Rule> rules)
      Update display of rules tree
    • updateProfileRules

      private void updateProfileRules(List<Rule> rules)
      Update display of profile rules
    • getChangedRulesPanel

      private JPanel getChangedRulesPanel(List<Rule> rules, boolean enabledRules, JPanel panel)
      Panel to select disabled default rules
      Since:
      5.4
    • getUnderlineTypes

      private String[] getUnderlineTypes()
    • getUnderlineType

      private int getUnderlineType(String category, String ruleId)
    • setUnderlineType

      private void setUnderlineType(int index, String category, String ruleId)
    • getUnderlineColorPanel

      JPanel getUnderlineColorPanel(List<Rule> rules)
      Panel to choose underline Colors
      Since:
      4.2
    • getRuleOptionsPanel

      @NotNull private JPanel getRuleOptionsPanel(int num)
      Panel to choose underline Colors and rule options (if exists)
      Since:
      5.3
    • getOfficeAiElements

      private JPanel getOfficeAiElements()