Author: dazarov
Date: 2009-04-09 11:01:26 -0400 (Thu, 09 Apr 2009)
New Revision: 14641
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077 added support different forms of annotations
(@Name("name") or @Name(value="name"))
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-09
14:58:37 UTC (rev 14640)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-04-09
15:01:26 UTC (rev 14641)
@@ -364,7 +364,10 @@
CompositeChange root = new CompositeChange("Rename Seam Component");
TextFileChange change = new TextFileChange(file.getName(), file);
- TextEdit edit = new ReplaceEdit(annotation.getSourceRange().getOffset(),
annotation.getSourceRange().getLength(),
"@"+annotation.getElementName()+"(\""+newName+"\")");
+
+ String annotationText = annotation.getSource().replace(component.getName(), newName);
+
+ TextEdit edit = new ReplaceEdit(annotation.getSourceRange().getOffset(),
annotation.getSourceRange().getLength(), annotationText);
change.setEdit(edit);
root.add(change);
root.addAll(changes.toArray(new Change[0]));