private static void addChanges(TextChange textChange, NLSSubstitution[] substitutions) throws CoreException { PropertyFileDocumentModel model= new PropertyFileDocumentModel(textChange.getCurrentDocument(new NullProgressMonitor())); Map<String, NLSSubstitution> newKeyToSubstMap= getNewKeyToSubstitutionMap(substitutions); Map<String, NLSSubstitution> oldKeyToSubstMap= getOldKeyToSubstitutionMap(substitutions); addInsertEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); addRemoveEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); addReplaceEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); }
private static void addChanges(TextChange textChange, NLSSubstitution[] substitutions) throws CoreException { PropertyFileDocumentModel model= new PropertyFileDocumentModel(textChange.getCurrentDocument(new NullProgressMonitor())); Map newKeyToSubstMap= getNewKeyToSubstitutionMap(substitutions); Map oldKeyToSubstMap= getOldKeyToSubstitutionMap(substitutions); addInsertEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); addRemoveEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); addReplaceEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); }
private static void addChanges(TextChange textChange, NLSSubstitution[] substitutions) throws CoreException { PropertyFileDocumentModel model= new PropertyFileDocumentModel(textChange.getCurrentDocument(new NullProgressMonitor())); Map<String, NLSSubstitution> newKeyToSubstMap= getNewKeyToSubstitutionMap(substitutions); Map<String, NLSSubstitution> oldKeyToSubstMap= getOldKeyToSubstitutionMap(substitutions); addInsertEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); addRemoveEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); addReplaceEdits(textChange, substitutions, newKeyToSubstMap, oldKeyToSubstMap, model); }
public static Change removeKeys(IPath propertyFilePath, List<String> keys) throws CoreException { String name= Messages.format(NLSMessages.NLSPropertyFileModifier_remove_from_property_file, BasicElementLabels.getPathLabel(propertyFilePath, false)); TextChange textChange= new TextFileChange(name, getPropertyFile(propertyFilePath)); textChange.setTextType("properties"); //$NON-NLS-1$ PropertyFileDocumentModel model= new PropertyFileDocumentModel(textChange.getCurrentDocument(new NullProgressMonitor())); for (Iterator<String> iterator= keys.iterator(); iterator.hasNext();) { String key= iterator.next(); TextEdit edit= model.remove(key); if (edit != null) { TextChangeCompatibility.addTextEdit(textChange, Messages.format(NLSMessages.NLSPropertyFileModifier_remove_entry, BasicElementLabels.getJavaElementName(key)), edit); } } return textChange; }
public static Change removeKeys(IPath propertyFilePath, List<String> keys) throws CoreException { String name= Messages.format(NLSMessages.NLSPropertyFileModifier_remove_from_property_file, BasicElementLabels.getPathLabel(propertyFilePath, false)); TextChange textChange= new TextFileChange(name, getPropertyFile(propertyFilePath)); textChange.setTextType("properties"); //$NON-NLS-1$ PropertyFileDocumentModel model= new PropertyFileDocumentModel(textChange.getCurrentDocument(new NullProgressMonitor())); for (Iterator<String> iterator= keys.iterator(); iterator.hasNext();) { String key= iterator.next(); TextEdit edit= model.remove(key); if (edit != null) { TextChangeCompatibility.addTextEdit(textChange, Messages.format(NLSMessages.NLSPropertyFileModifier_remove_entry, BasicElementLabels.getJavaElementName(key)), edit); } } return textChange; }
PropertyFileDocumentModel model= new PropertyFileDocumentModel(document);
PropertyFileDocumentModel model= new PropertyFileDocumentModel(document);