class LanguageComboBoxModel extends DefaultComboBoxModel<LanguageAdapter> {

  private LanguageComboBoxModel() {
    super();
  }

  static LanguageComboBoxModel create(ResourceBundle messages,
          String extLangSuffix, boolean includeHidden,
          List<Language> external, LanguageAdapter first) {<FILL_FUNCTION_BODY>}
}


    LanguageComparator comparator = new LanguageComparator(messages, extLangSuffix);
    LanguageComboBoxModel model = new LanguageComboBoxModel();

    if (first != null) {
      //e.g. an option like "System Default"
      model.addElement(first);
    }
    if (external != null) {
      // do not sort the original list
      ArrayList<Language> ext = new ArrayList<>(external);
      Collections.sort(ext, comparator);
      for (Language l : ext) {
        model.addElement(new LanguageAdapter(l));
      }
    }
    // the original list is unmodifiable
    ArrayList<Language> internal = new ArrayList<>(Languages.get());
    Collections.sort(internal, comparator);
    for (Language l : internal) {
      if (includeHidden || !l.isHiddenFromGui()) {
        model.addElement(new LanguageAdapter(l));
      }
    }
    return model;
  
<methods>public void <init>() ,public void <init>(org.languagetool.gui.LanguageAdapter[]) ,public void <init>(Vector<org.languagetool.gui.LanguageAdapter>) ,public void addAll(Collection<? extends org.languagetool.gui.LanguageAdapter>) ,public void addAll(int, Collection<? extends org.languagetool.gui.LanguageAdapter>) ,public void addElement(org.languagetool.gui.LanguageAdapter) ,public org.languagetool.gui.LanguageAdapter getElementAt(int) ,public int getIndexOf(java.lang.Object) ,public java.lang.Object getSelectedItem() ,public int getSize() ,public void insertElementAt(org.languagetool.gui.LanguageAdapter, int) ,public void removeAllElements() ,public void removeElement(java.lang.Object) ,public void removeElementAt(int) ,public void setSelectedItem(java.lang.Object) <variables>Vector<org.languagetool.gui.LanguageAdapter> objects,java.lang.Object selectedObject