private boolean hasNewOrMissingSubstitutions() { for (int i= 0; i < fSubstitutions.length; i++) { NLSSubstitution curr= fSubstitutions[i]; if (curr.getInitialState() == NLSSubstitution.INTERNALIZED) { return true; } if (curr.getInitialState() == NLSSubstitution.EXTERNALIZED && curr.getInitialValue() == null) { return true; } } return false; }
@Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (!fFilterCheckBox.getSelection()) { return true; } NLSSubstitution curr= (NLSSubstitution) element; return (curr.getInitialState() == NLSSubstitution.INTERNALIZED) || (curr.getInitialState() == NLSSubstitution.EXTERNALIZED && curr.getInitialValue() == null); } });
private boolean hasNewOrMissingSubstitutions() { for (int i= 0; i < fSubstitutions.length; i++) { NLSSubstitution curr= fSubstitutions[i]; if (curr.getInitialState() == NLSSubstitution.INTERNALIZED) { return true; } if (curr.getInitialState() == NLSSubstitution.EXTERNALIZED && curr.getInitialValue() == null) { return true; } } return false; }
private boolean hasNewOrMissingSubstitutions() { for (int i= 0; i < fSubstitutions.length; i++) { NLSSubstitution curr= fSubstitutions[i]; if (curr.getInitialState() == NLSSubstitution.INTERNALIZED) { return true; } if (curr.getInitialState() == NLSSubstitution.EXTERNALIZED && curr.getInitialValue() == null) { return true; } } return false; }
@Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (!fFilterCheckBox.getSelection()) { return true; } NLSSubstitution curr= (NLSSubstitution) element; return (curr.getInitialState() == NLSSubstitution.INTERNALIZED) || (curr.getInitialState() == NLSSubstitution.EXTERNALIZED && curr.getInitialValue() == null); } });
/** * Maps the old keys to a substitutions. If a substitution is not in the map then it is a duplicate. * * @param substitutions the substitutions to add to the map * @return the map containing the substitutions */ static HashMap<String, NLSSubstitution> getOldKeyToSubstitutionMap(NLSSubstitution[] substitutions) { HashMap<String, NLSSubstitution> keyToSubstMap= new HashMap<>(substitutions.length); // find all duplicates for (int i= 0; i < substitutions.length; i++) { NLSSubstitution curr= substitutions[i]; if (curr.getInitialState() == NLSSubstitution.EXTERNALIZED) { String key= curr.getInitialKey(); if (key != null) { NLSSubstitution fav= keyToSubstMap.get(key); if (fav == null || (fav.hasStateChanged() && !curr.hasStateChanged())) { keyToSubstMap.put(key, curr); // store if first or if stored will not be externalized anymore } } } } return keyToSubstMap; }
/** * Maps the old keys to a substitutions. If a substitution is not in the map then it is a duplicate. */ static HashMap getOldKeyToSubstitutionMap(NLSSubstitution[] substitutions) { HashMap keyToSubstMap= new HashMap(substitutions.length); // find all duplicates for (int i= 0; i < substitutions.length; i++) { NLSSubstitution curr= substitutions[i]; if (curr.getInitialState() == NLSSubstitution.EXTERNALIZED) { String key= curr.getInitialKey(); if (key != null) { NLSSubstitution fav= (NLSSubstitution) keyToSubstMap.get(key); if (fav == null || (fav.hasStateChanged() && !curr.hasStateChanged())) { keyToSubstMap.put(key, curr); // store if first or if stored will not be externalized anymore } } } } return keyToSubstMap; }
/** * Maps the old keys to a substitutions. If a substitution is not in the map then it is a duplicate. * * @param substitutions the substitutions to add to the map * @return the map containing the substitutions */ static HashMap<String, NLSSubstitution> getOldKeyToSubstitutionMap(NLSSubstitution[] substitutions) { HashMap<String, NLSSubstitution> keyToSubstMap= new HashMap<>(substitutions.length); // find all duplicates for (int i= 0; i < substitutions.length; i++) { NLSSubstitution curr= substitutions[i]; if (curr.getInitialState() == NLSSubstitution.EXTERNALIZED) { String key= curr.getInitialKey(); if (key != null) { NLSSubstitution fav= keyToSubstMap.get(key); if (fav == null || (fav.hasStateChanged() && !curr.hasStateChanged())) { keyToSubstMap.put(key, curr); // store if first or if stored will not be externalized anymore } } } } return keyToSubstMap; }
static boolean doRemove(NLSSubstitution substitution, Map<String, NLSSubstitution> newKeyToSubstMap, Map<String, NLSSubstitution> oldKeyToSubstMap) { if (substitution.getInitialState() != NLSSubstitution.EXTERNALIZED || substitution.getInitialKey() == null) { return false; // was not in property file before } if (oldKeyToSubstMap.get(substitution.getInitialKey()) != substitution) { return false; // not the owner of this key } if (substitution.hasStateChanged()) { return true; // was externalized, but not anymore } else { if (substitution.hasPropertyFileChange() && newKeyToSubstMap.get(substitution.getKey()) != substitution) { return true; // has been changed to an already existing } } return false; }
static boolean doRemove(NLSSubstitution substitution, Map<String, NLSSubstitution> newKeyToSubstMap, Map<String, NLSSubstitution> oldKeyToSubstMap) { if (substitution.getInitialState() != NLSSubstitution.EXTERNALIZED || substitution.getInitialKey() == null) { return false; // was not in property file before } if (oldKeyToSubstMap.get(substitution.getInitialKey()) != substitution) { return false; // not the owner of this key } if (substitution.hasStateChanged()) { return true; // was externalized, but not anymore } else { if (substitution.hasPropertyFileChange() && newKeyToSubstMap.get(substitution.getKey()) != substitution) { return true; // has been changed to an already existing } } return false; }
static boolean doRemove(NLSSubstitution substitution, Map newKeyToSubstMap, Map oldKeyToSubstMap) { if (substitution.getInitialState() != NLSSubstitution.EXTERNALIZED || substitution.getInitialKey() == null) { return false; // was not in property file before } if (oldKeyToSubstMap.get(substitution.getInitialKey()) != substitution) { return false; // not the owner of this key } if (substitution.hasStateChanged()) { return true; // was externalized, but not anymore } else { if (substitution.hasPropertyFileChange() && newKeyToSubstMap.get(substitution.getKey()) != substitution) { return true; // has been changed to an already existing } } return false; }
if (substitution.hasStateChanged()) { if (newState == NLSSubstitution.EXTERNALIZED) { if (substitution.getInitialState() == NLSSubstitution.INTERNALIZED) { sourceModification.addNLS(substitution, change, accessorClassName); } else if (substitution.getInitialState() == NLSSubstitution.IGNORED) { sourceModification.addAccessor(substitution, change, accessorClassName); if (substitution.getInitialState() == NLSSubstitution.IGNORED) { sourceModification.deleteTag(substitution, change); if (substitution.isValueRename()) { sourceModification.replaceValue(substitution, change); } else if (substitution.getInitialState() == NLSSubstitution.EXTERNALIZED) { sourceModification.deleteAccessor(substitution, change, cu); if (!isEclipseNLS) if (substitution.getInitialState() == NLSSubstitution.INTERNALIZED) { sourceModification.addNLS(substitution, change, accessorClassName); if (substitution.isValueRename()) { if (substitution.getInitialState() == NLSSubstitution.EXTERNALIZED) { sourceModification.deleteAccessor(substitution, change, cu);
if (substitution.getInitialState() == NLSSubstitution.INTERNALIZED) { sourceModification.addNLS(substitution, change, accessorClassName); } else if (substitution.getInitialState() == NLSSubstitution.IGNORED) { sourceModification.addAccessor(substitution, change, accessorClassName); if (substitution.getInitialState() == NLSSubstitution.IGNORED) { sourceModification.deleteTag(substitution, change); if (substitution.isValueRename()) { sourceModification.replaceValue(substitution, change); } else if (substitution.getInitialState() == NLSSubstitution.EXTERNALIZED) { sourceModification.deleteAccessor(substitution, change, cu); if (!isEclipseNLS) if (substitution.getInitialState() == NLSSubstitution.INTERNALIZED) { sourceModification.addNLS(substitution, change, null); if (substitution.isValueRename()) { if (substitution.getInitialState() == NLSSubstitution.EXTERNALIZED) { sourceModification.deleteAccessor(substitution, change, cu);
if (substitution.getInitialState() == NLSSubstitution.INTERNALIZED) { sourceModification.addNLS(substitution, change, accessorClassName); } else if (substitution.getInitialState() == NLSSubstitution.IGNORED) { sourceModification.addAccessor(substitution, change, accessorClassName); if (substitution.getInitialState() == NLSSubstitution.IGNORED) { sourceModification.deleteTag(substitution, change); if (substitution.isValueRename()) { sourceModification.replaceValue(substitution, change); } else if (substitution.getInitialState() == NLSSubstitution.EXTERNALIZED) { sourceModification.deleteAccessor(substitution, change, cu); if (!isEclipseNLS) if (substitution.getInitialState() == NLSSubstitution.INTERNALIZED) { sourceModification.addNLS(substitution, change, null); if (substitution.isValueRename()) { if (substitution.getInitialState() == NLSSubstitution.EXTERNALIZED) { sourceModification.deleteAccessor(substitution, change, cu);