Class SelectLanguagePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class SelectLanguagePanel extends JPanel
A generic reusable panel for selecting a language. Also, supports a filter to limit languages that are displayed.
See Also:
  • Constructor Details

    • SelectLanguagePanel

      public SelectLanguagePanel(LanguageService service)
      Constructs a new panel.
      Parameters:
      service - the language service to use to retrieve the languages
  • Method Details

    • main

      public static void main(String[] args)
    • setShowVersion

      public void setShowVersion(boolean enable)
      Allows language versions to appear appended to name
      Parameters:
      enable -
    • setSelectedLanguage

      public void setSelectedLanguage(LanguageID languageID)
      Selects the language with the specified language ID.
      Parameters:
      languageID - the ID of language to select
    • setSelectedLanguage

      public void setSelectedLanguage(Language lang)
    • setLanguageService

      public void setLanguageService(LanguageService service)
    • dispose

      public void dispose()
    • update

      public void update()
      Update the panel. Requests a new list of languages from the language service and updates the table.
    • getSelectedLanguage

      public Language getSelectedLanguage()
      Returns the selected language, or null if no language is selected.
      Returns:
      the selected language, or null if no language is selected.
    • setFilter

      public int setFilter(String filter)
      Sets the filter string.
      Parameters:
      filter - the string to filter on
      Returns:
      the number of languages that matched the filter
    • selectHighestPriorityLanguage

      public void selectHighestPriorityLanguage()
      Select the highest priority language being displayed. If more than one language has the highest priority, then the first one will be used.