Author: dazarov
Date: 2009-12-16 07:47:44 -0500 (Wed, 16 Dec 2009)
New Revision: 19299
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMethodParticipant.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/refactoring/ELReferencesRenameTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5289
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java 2009-12-16
10:27:56 UTC (rev 19298)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java 2009-12-16
12:47:44 UTC (rev 19299)
@@ -198,8 +198,9 @@
if(javaElement != null){
for(ELReference reference : references){
+ int offset = reference.getStartPosition();
for(ELExpression operand : reference.getEl()){
- int offset = operand.getStartPosition();
+
for (ELResolver resolver : resolvers) {
if (!(resolver instanceof ELCompletionEngine))
continue;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2009-12-16 10:27:56 UTC (rev
19298)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2009-12-16 12:47:44 UTC (rev
19299)
@@ -437,7 +437,6 @@
<with variable="element">
<or>
<instanceof value="org.eclipse.jdt.core.IMethod"/>
- <instanceof value="org.eclipse.jdt.core.IType"/>
</or>
</with>
</enablement>
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMethodParticipant.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMethodParticipant.java 2009-12-16
10:27:56 UTC (rev 19298)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMethodParticipant.java 2009-12-16
12:47:44 UTC (rev 19299)
@@ -22,7 +22,6 @@
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
@@ -100,20 +99,6 @@
searcher = new SeamRenameMethodSearcher((IFile)method.getResource(), oldName);
added = false;
return true;
- }else if(element instanceof IType){
- IType type = (IType)element;
- status = new RefactoringStatus();
-
- rootChange = new
CompositeChange(JsfUIMessages.RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES);
-
- this.element = type;
-
- oldName = type.getElementName();
-
- newName = RefactorSearcher.getPropertyName(type, getArguments().getNewName());
- searcher = new SeamRenameMethodSearcher((IFile)type.getResource(), oldName);
- added = false;
- return true;
}
return false;
}
@@ -134,20 +119,6 @@
searcher = new SeamRenameMethodSearcher((IFile)method.getResource(), oldName);
added = false;
return true;
- }else if(element instanceof IType){
- IType type = (IType)element;
- status = new RefactoringStatus();
-
- rootChange = new
CompositeChange(JsfUIMessages.RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES);
-
- this.element = type;
-
- oldName = type.getElementName();
-
- this.newName = newName;
- searcher = new SeamRenameMethodSearcher((IFile)type.getResource(), oldName);
- added = false;
- return true;
}
return false;
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/refactoring/ELReferencesRenameTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/refactoring/ELReferencesRenameTest.java 2009-12-16
10:27:56 UTC (rev 19298)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/refactoring/ELReferencesRenameTest.java 2009-12-16
12:47:44 UTC (rev 19299)
@@ -45,25 +45,6 @@
renameELReferences(method, "alias", list);
}
-
- public void testRenameClass() throws CoreException {
- ArrayList<TestChangeStructure> list = new
ArrayList<TestChangeStructure>();
-
-
- TestChangeStructure structure = new TestChangeStructure(jsfProject,
"/WebContent/pages/hello.jsp");
- TestTextChange change = new TestTextChange(348, 4, "user");
- structure.addTextChange(change);
- list.add(structure);
-
- structure = new TestChangeStructure(jsfProject,
"/WebContent/pages/inputUserName.jsp");
- change = new TestTextChange(494, 4, "user");
- structure.addTextChange(change);
- list.add(structure);
-
- IType type = getJavaType(jsfProject, "demo.User");
-
- renameELReferences(type, "person", list);
- }
private void renameELReferences(IJavaElement element, String newName,
List<TestChangeStructure> changeList) throws CoreException{
JobUtils.waitForIdle();