public LanguagePanel(LanguageDescription lang, Preferences prefs) {
      setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
      this.prefs = prefs;

      languagePicker.setEditable(false);
      add(buildBoxPanel());

      Set<String> correctOrder = new LinkedHashSet<>();
      for (ColorProfile profile : lang.defaultProfiles()) {
        languagePicker.addItem(new ProfileItem(profile, null));
        for (String n : profile.keySet()) {
          correctOrder.add(n);
        }
      }
      try {
        for (String scheme : prefs.childrenNames()) {
          Preferences schemeNode = prefs.node(scheme);
          ColorProfile prof =
              propertiesToColorProfile(prefsReadProperties(schemeNode), correctOrder);
          languagePicker.addItem(new ProfileItem(prof, schemeNode));
        }
      } catch (BackingStoreException e) {
        e.printStackTrace();
      }

      languagePicker.addItemListener(this);
      addLangButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
          addClicked();
        }
      });
      delLangButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
          deleteClicked();
        }
      });

      if (languagePicker.getItemCount() > 0) {
        displayCard((ProfileItem) languagePicker.getSelectedItem());
      }
    }