attributeName = getSelectedAttributeName(textSelection);
}
if (node != null && attributeName != null) {
// start Spring IDE's own bean id refactoring
RenameIdType idType = null;
if ("bean".equals(node.getLocalName()) && "http://www.springframework.org/schema/beans".equals(node.getNamespaceURI())
&& "id".equals(attributeName)) {
idType = RenameIdType.BEAN;
} else if ("advice".equals(node.getLocalName()) && "http://www.springframework.org/schema/tx".equals(node.getNamespaceURI())
&& "id".equals(attributeName)) {
idType = RenameIdType.ADVICE;
} else if ("pointcut".equals(node.getLocalName()) && "http://www.springframework.org/schema/aop".equals(node.getNamespaceURI())
&& "id".equals(attributeName)) {
idType = RenameIdType.POINTCUT;
}
if (idType != null) {
RenameIdRefactoring refactoring = new RenameIdRefactoring();
refactoring.setType(idType);
refactoring.setNode((IDOMNode) node);
refactoring.setBeanId(BeansEditorUtils.getAttribute(node,
"id"));
refactoring.setFile(getConfigFile(event));
refactoring.setOffset(textSelection.getOffset());
RenameIdRefactoringWizard wizard = new RenameIdRefactoringWizard(
refactoring, "Rename " + idType.getType() + " id");
run(wizard, BeansUIPlugin.getActiveWorkbenchShell(),
"Rename " + idType.getType() + " id");
} else {
processAction(event, document, textSelection);
}
}
}