use of com.intellij.lang.properties.xml.XmlProperty in project intellij-community by JetBrains.
the class ResourceBundlePropertiesUpdateManager method deletePropertyIfExist.
public void deletePropertyIfExist(String key, PropertiesFile file) {
final IProperty property = file.findPropertyByKey(key);
if (property != null && myKeysOrder != null) {
boolean keyExistInOtherPropertiesFiles = false;
for (PropertiesFile propertiesFile : myResourceBundle.getPropertiesFiles()) {
if (!propertiesFile.equals(file) && propertiesFile.findPropertyByKey(key) != null) {
keyExistInOtherPropertiesFiles = true;
break;
}
}
if (!keyExistInOtherPropertiesFiles) {
myKeysOrder.remove(key);
}
}
if (property != null) {
PsiElement anElement = property.getPsiElement();
if (anElement instanceof PomTargetPsiElement) {
final PomTarget xmlProperty = ((PomTargetPsiElement) anElement).getTarget();
LOG.assertTrue(xmlProperty instanceof XmlProperty);
anElement = ((XmlProperty) xmlProperty).getNavigationElement();
}
anElement.delete();
}
}
Aggregations