@Override
 public void profileSelectionChanged(final Optional<MutableProfile> profile) {
   okButton.setEnabled(model.isSaveAllowed());
   deleteProfile.setEnabled(model.getSelectedProfile().isPresent());
   if (profile.isPresent()) {
     final int index = profilesModel.indexOf(profile.get());
     selectionModel.setLeadSelectionIndex(index);
   } else {
     selectionModel.setLeadSelectionIndex(-1);
   }
   addNickname.setEnabled(model.getSelectedProfile().isPresent());
   editNickname.setEnabled(model.getSelectedProfile().isPresent());
   addHighlight.setEnabled(model.getSelectedProfile().isPresent());
   editHighlight.setEnabled(model.getSelectedProfile().isPresent());
   name.setEnabled(model.getSelectedProfile().isPresent());
   name.setText(model.getSelectedProfileName().orElse(""));
   nicknames.setEnabled(model.getSelectedProfile().isPresent());
   nicknamesModel.clear();
   nicknamesModel.addAll(model.getSelectedProfileNicknames().orElse(Lists.newArrayList()));
   highlights.setEnabled(model.getSelectedProfile().isPresent());
   highlightsModel.clear();
   highlightsModel.addAll(model.getSelectedProfileHighlights().orElse(Lists.newArrayList()));
   realname.setEnabled(model.getSelectedProfile().isPresent());
   realname.setText(model.getSelectedProfileRealname().orElse(""));
   ident.setEnabled(model.getSelectedProfile().isPresent());
   ident.setText(model.getSelectedProfileIdent().orElse(""));
 }
 private void setupProfileRealname(final JTextField realname) {
   realname.setEnabled(model.getSelectedProfileRealname().isPresent());
   realname.setText(model.getSelectedProfileRealname().orElse(""));
   realname
       .getDocument()
       .addDocumentListener(
           new ConsumerDocumentListener(
               s -> {
                 if (model.getSelectedProfile().isPresent()) {
                   model.setSelectedProfileRealname(Optional.of(s));
                 }
               }));
 }
 private void setupProfileIdent(final JTextField ident) {
   ident.setEnabled(model.getSelectedProfileIdent().isPresent());
   ident.setText(model.getSelectedProfileIdent().orElse(""));
   ident
       .getDocument()
       .addDocumentListener(
           new ConsumerDocumentListener(
               s -> {
                 if (model.getSelectedProfile().isPresent()) {
                   model.setSelectedProfileIdent(Optional.of(s));
                 }
               }));
 }
 private void setupDeleteProfile(final JButton deleteProfile) {
   deleteProfile.setEnabled(model.getSelectedProfile().isPresent());
   deleteProfile.addActionListener(
       l -> model.getSelectedProfile().ifPresent(model::removeProfile));
 }