private boolean willModifyPropertyFile() { NLSSubstitution[] subs= fSubstitutions; for (int i= 0; i < subs.length; i++) { NLSSubstitution substitution= subs[i]; if (substitution.hasPropertyFileChange()) { return true; } } return false; }
private boolean willModifyPropertyFile() { NLSSubstitution[] subs= fSubstitutions; for (int i= 0; i < subs.length; i++) { NLSSubstitution substitution= subs[i]; if (substitution.hasPropertyFileChange()) { return true; } } return false; }
private boolean willModifyPropertyFile() { NLSSubstitution[] subs= fSubstitutions; for (int i= 0; i < subs.length; i++) { NLSSubstitution substitution= subs[i]; if (substitution.hasPropertyFileChange()) { return true; } } return false; }
private boolean containsElementsWithChange(IStructuredSelection selection) { for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { NLSSubstitution substitution= (NLSSubstitution) iter.next(); if (substitution.hasPropertyFileChange() || substitution.hasSourceChange()) { return true; } } return false; }
private boolean containsElementsWithChange(IStructuredSelection selection) { for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { NLSSubstitution substitution= (NLSSubstitution) iter.next(); if (substitution.hasPropertyFileChange() || substitution.hasSourceChange()) { return true; } } return false; }
/** * Maps the new keys to a substitutions. If a substitution is not in the map then it is a duplicate. */ static HashMap getNewKeyToSubstitutionMap(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.getState() == NLSSubstitution.EXTERNALIZED) { NLSSubstitution val= (NLSSubstitution) keyToSubstMap.get(curr.getKey()); if (val == null || (val.hasPropertyFileChange() && !curr.hasPropertyFileChange())) { keyToSubstMap.put(curr.getKey(), curr); // store if first or if stored in new and we are existing } } } return keyToSubstMap; }
private boolean containsElementsWithChange(IStructuredSelection selection) { for (Iterator iter= selection.iterator(); iter.hasNext();) { NLSSubstitution substitution= (NLSSubstitution) iter.next(); if (substitution.hasPropertyFileChange() || substitution.hasSourceChange()) { return true; } } return false; }
@Override public Font getFont(Object element) { if (element instanceof NLSSubstitution) { NLSSubstitution substitution= (NLSSubstitution) element; if (substitution.hasPropertyFileChange() || substitution.hasSourceChange()) { return fFontRegistry.getBold(JFaceResources.DIALOG_FONT); } } return null; }
/** * Maps the new 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> getNewKeyToSubstitutionMap(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.getState() == NLSSubstitution.EXTERNALIZED) { NLSSubstitution val= keyToSubstMap.get(curr.getKey()); if (val == null || (val.hasPropertyFileChange() && !curr.hasPropertyFileChange())) { keyToSubstMap.put(curr.getKey(), curr); // store if first or if stored in new and we are existing } } } return keyToSubstMap; }
/** * Maps the new 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> getNewKeyToSubstitutionMap(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.getState() == NLSSubstitution.EXTERNALIZED) { NLSSubstitution val= keyToSubstMap.get(curr.getKey()); if (val == null || (val.hasPropertyFileChange() && !curr.hasPropertyFileChange())) { keyToSubstMap.put(curr.getKey(), curr); // store if first or if stored in new and we are existing } } } return keyToSubstMap; }
@Override public Font getFont(Object element) { if (element instanceof NLSSubstitution) { NLSSubstitution substitution= (NLSSubstitution) element; if (substitution.hasPropertyFileChange() || substitution.hasSourceChange()) { return fFontRegistry.getBold(JFaceResources.DIALOG_FONT); } } return null; }
public Font getFont(Object element) { if (element instanceof NLSSubstitution) { NLSSubstitution substitution= (NLSSubstitution) element; if (substitution.hasPropertyFileChange() || substitution.hasSourceChange()) { return fFontRegistry.getBold(JFaceResources.DIALOG_FONT); } } return null; }
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; }