public void writeExternalUtil(
      @NotNull Element element, @NotNull OptionsAndConfirmations optionsAndConfirmations)
      throws WriteExternalException {
    final Map<String, VcsShowOptionsSettingImpl> options = optionsAndConfirmations.getOptions();
    final Map<String, VcsShowConfirmationOptionImpl> confirmations =
        optionsAndConfirmations.getConfirmations();

    for (VcsShowOptionsSettingImpl setting : options.values()) {
      if (!Registry.is("saving.state.in.new.format.is.allowed", false) || !setting.getValue()) {
        Element settingElement = new Element(OPTIONS_SETTING);
        element.addContent(settingElement);
        settingElement.setAttribute(VALUE_ATTTIBUTE, Boolean.toString(setting.getValue()));
        settingElement.setAttribute(ID_ATTRIBUTE, setting.getDisplayName());
      }
    }

    for (VcsShowConfirmationOptionImpl setting : confirmations.values()) {
      if (!Registry.is("saving.state.in.new.format.is.allowed", false)
          || setting.getValue() != VcsShowConfirmationOption.Value.SHOW_CONFIRMATION) {
        final Element settingElement = new Element(CONFIRMATIONS_SETTING);
        element.addContent(settingElement);
        settingElement.setAttribute(VALUE_ATTTIBUTE, setting.getValue().toString());
        settingElement.setAttribute(ID_ATTRIBUTE, setting.getDisplayName());
      }
    }
  }
コード例 #2
0
 @Override
 @NotNull
 public VcsShowConfirmationOption getStandardConfirmation(
     @NotNull VcsConfiguration.StandardConfirmation option, AbstractVcs vcs) {
   final VcsShowConfirmationOptionImpl result = getConfirmation(option);
   if (vcs != null) {
     result.addApplicableVcs(vcs);
   }
   return result;
 }