if ("property".equals(child.getLocalName()) && BeansEditorUtils.hasAttribute(child, "name")) {
String propertyName = BeansEditorUtils.getAttribute(child, "name");
if (methodName.equals(propertyName)) {
List<IType> types = BeansEditorUtils.getClassNamesOfBean(file, node);
if (types.contains(((IMethod) element).getDeclaringType())) {
AttrImpl attr = (AttrImpl) child.getAttributes().getNamedItem("name");
int offset = attr.getValueRegionStartOffset() + 1;
if (offset >= 0) {
result.add(new ReplaceEdit(offset, propertyName.length(), newName));
}
}
}
}
}
// p-namespace references to the properties that belong to the changed method
if (node.hasAttributes()) {
String attributeNameStart = "p:";
String optionalAttributeNameEnd = "-ref";
NamedNodeMap attributes = node.getAttributes();
int attributeCount = attributes.getLength();
for (int i = 0; i < attributeCount; i++) {
AttrImpl attribute = (AttrImpl) attributes.item(i);
String attributeName = attribute.getNodeName();
if (attributeName != null && attributeName.startsWith(attributeNameStart)) {
if (attributeName.equals(attributeNameStart + methodName)
|| attributeName.equals(attributeNameStart + methodName + optionalAttributeNameEnd)) {
List<IType> types = BeansEditorUtils.getClassNamesOfBean(file, node);
if (types.contains(((IMethod) element).getDeclaringType())) {
int offset = attribute.getNameRegionStartOffset() + attributeNameStart.length();
result.add(new ReplaceEdit(offset, methodName.length(), newName));
}
}
}
}