Author: dazarov
Date: 2009-04-14 05:24:00 -0400 (Tue, 14 Apr 2009)
New Revision: 14730
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
Log:
Added <factory name="<oldName>" /> -> <factory
name="<newName>" />
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-04-14
09:10:36 UTC (rev 14729)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-04-14
09:24:00 UTC (rev 14730)
@@ -83,7 +83,8 @@
private static final String PROPERTIES_EXT = "properties";
private static final String COMPONENTS_FILE = "components.xml";
private static final String COMPONENT_NODE = "component";
- private static final String NAME_NODE = "name";
+ private static final String FACTORY_NODE = "factory";
+ private static final String NAME_ATTRIBUTE = "name";
private IFile file;
private ISeamComponent component;
@@ -257,9 +258,11 @@
private void scanChildComponent(IFile file, Node parent) {
NodeList children = parent.getChildNodes();
- for(int i=0; i<children.getLength(); i++) {
+ for (int i = 0; i < children.getLength(); i++) {
Node curentValidatedNode = children.item(i);
- if(Node.ELEMENT_NODE == curentValidatedNode.getNodeType() &&
curentValidatedNode.getNodeName().equals(COMPONENT_NODE)) {
+ if (Node.ELEMENT_NODE == curentValidatedNode.getNodeType()
+ && (curentValidatedNode.getNodeName().equals(COMPONENT_NODE)
+ || curentValidatedNode.getNodeName().equals(FACTORY_NODE))) {
scanComponentNode(file, curentValidatedNode);
}
scanChildComponent(file, curentValidatedNode);
@@ -267,7 +270,7 @@
}
private void scanComponentNode(IFile file, Node node) {
- Node nameNode = node.getAttributes().getNamedItem("name");
+ Node nameNode = node.getAttributes().getNamedItem(NAME_ATTRIBUTE);
if(nameNode != null){
if(nameNode.getNodeValue().equals(component.getName())){
IStructuredDocumentRegion region =
((IDOMNode)node).getFirstStructuredDocumentRegion();