private void explainTrailingSpaces(
     @NotNull @EditorSettingsExternalizable.StripTrailingSpaces String stripTrailingSpaces) {
   if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE.equals(stripTrailingSpaces)) {
     myStripTrailingSpacesExplanationLabel.setVisible(false);
     return;
   }
   myStripTrailingSpacesExplanationLabel.setVisible(true);
   boolean isVirtualSpace = myCbVirtualSpace.isSelected();
   String text;
   String virtSpaceText = myCbVirtualSpace.getText();
   if (isVirtualSpace) {
     text =
         "Trailing spaces will be trimmed even in the line under caret.<br>To disable trimming in that line uncheck the '<b>"
             + virtSpaceText
             + "</b>' above.";
   } else {
     text =
         "Trailing spaces will <b><font color=red>NOT</font></b> be trimmed in the line under caret.<br>To enable trimming in that line too check the '<b>"
             + virtSpaceText
             + "</b>' above.";
   }
   myStripTrailingSpacesExplanationLabel.setText(XmlStringUtil.wrapInHtml(text));
 }
  /**
   * Saves all configuration settings when the "Save" button is pressed.
   *
   * @param e the <tt>ActionEvent</tt> that notified us of the button action
   */
  public void actionPerformed(ActionEvent e) {
    JButton button = (JButton) e.getSource();

    if (button.equals(saveButton)) {
      Iterator<ChatRoomConfigurationFormField> configurationSet = configForm.getConfigurationSet();

      while (configurationSet.hasNext()) {
        ChatRoomConfigurationFormField formField = configurationSet.next();

        // If the field is of type fixed the user could not change it,
        // so we skip it.
        if (formField.getType().equals(ChatRoomConfigurationFormField.TYPE_TEXT_FIXED)) continue;

        JComponent c = uiFieldsTable.get(formField.getName());

        if (c instanceof JTextComponent) {
          String newValue = ((JTextComponent) c).getText();

          if (formField.getType().equals(ChatRoomConfigurationFormField.TYPE_ID_MULTI)) {
            // extract values
            StringTokenizer idTokens =
                new StringTokenizer(newValue, System.getProperty("line.separator"));
            while (idTokens.hasMoreTokens()) {
              formField.addValue(idTokens.nextToken());
            }
          } else formField.addValue(newValue);
        } else if (c instanceof AbstractButton) {
          boolean isSelected = ((AbstractButton) c).isSelected();

          formField.addValue(isSelected);
        } else if (c instanceof JComboBox) {
          Object selectedObject = ((JComboBox) c).getSelectedItem();

          formField.addValue(selectedObject);
        } else if (c instanceof JPanel) {
          Component[] components = c.getComponents();

          for (Component comp : components) {
            if (!(comp instanceof JCheckBox)) continue;

            JCheckBox checkBox = (JCheckBox) comp;

            formField.addValue(checkBox.getText());
          }
        }
      }

      new Thread() {
        @Override
        public void run() {
          try {
            configForm.submit();
          } catch (Exception e) {
            new ErrorDialog(
                    ChatRoomConfigurationWindow.this,
                    GuiActivator.getResources().getI18NString("service.gui.ERROR"),
                    GuiActivator.getResources()
                        .getI18NString("service.gui.CHAT_ROOM_CONFIGURATION_SUBMIT_FAILED"),
                    e)
                .showDialog();
          }
        }
      }.start();
    }

    this.dispose();
  }