private static void addInsertEdits(TextChange textChange, NLSSubstitution[] substitutions, Map<String, NLSSubstitution> newKeyToSubstMap, Map<String, NLSSubstitution> oldKeyToSubstMap, PropertyFileDocumentModel model) { ArrayList<KeyValuePair> keyValuePairsToAdd= new ArrayList<>(); for (int i= 0; i < substitutions.length; i++) { NLSSubstitution substitution= substitutions[i]; if (doInsert(substitution, newKeyToSubstMap, oldKeyToSubstMap)) { String value= PropertyFileDocumentModel.escape(substitution.getValueNonEmpty(), true) + model.getLineDelimiter(); String key= PropertyFileDocumentModel.escape(substitution.getKey(), false); keyValuePairsToAdd.add(new KeyValuePair(key, value)); } } if (keyValuePairsToAdd.size() > 0) { model.insert(keyValuePairsToAdd.toArray(new KeyValuePair[keyValuePairsToAdd.size()]), textChange); } }
private static void addInsertEdits(TextChange textChange, NLSSubstitution[] substitutions, Map<String, NLSSubstitution> newKeyToSubstMap, Map<String, NLSSubstitution> oldKeyToSubstMap, PropertyFileDocumentModel model) { ArrayList<KeyValuePair> keyValuePairsToAdd= new ArrayList<>(); for (int i= 0; i < substitutions.length; i++) { NLSSubstitution substitution= substitutions[i]; if (doInsert(substitution, newKeyToSubstMap, oldKeyToSubstMap)) { String value= PropertyFileDocumentModel.escape(substitution.getValueNonEmpty(), true) + model.getLineDelimiter(); String key= PropertyFileDocumentModel.escape(substitution.getKey(), false); keyValuePairsToAdd.add(new KeyValuePair(key, value)); } } if (keyValuePairsToAdd.size() > 0) { model.insert(keyValuePairsToAdd.toArray(new KeyValuePair[keyValuePairsToAdd.size()]), textChange); } }
private static void addInsertEdits(TextChange textChange, NLSSubstitution[] substitutions, Map newKeyToSubstMap, Map oldKeyToSubstMap, PropertyFileDocumentModel model) { for (int i= 0; i < substitutions.length; i++) { NLSSubstitution substitution= substitutions[i]; if (doInsert(substitution, newKeyToSubstMap, oldKeyToSubstMap)) { String value= substitution.getValueNonEmpty(); KeyValuePair curr= new KeyValuePair(substitution.getKey(), value); InsertEdit insert= model.insert(curr); String message= Messages.format(NLSMessages.NLSPropertyFileModifier_add_entry, curr.getKey()); TextChangeCompatibility.addTextEdit(textChange, message, insert); } } }
if (NLSPropertyFileModifier.doInsert(substitution, newKeyToSubstMap, oldKeyToSubstMap)) { sourceModification.addKey(substitution, change);
if (NLSPropertyFileModifier.doInsert(substitution, newKeyToSubstMap, oldKeyToSubstMap)) { sourceModification.addKey(substitution, change);
if (NLSPropertyFileModifier.doInsert(substitution, newKeyToSubstMap, oldKeyToSubstMap)) { sourceModification.addKey(substitution, change);