Author: dazarov
Date: 2009-10-21 09:19:47 -0400 (Wed, 21 Oct 2009)
New Revision: 18203
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5063
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-10-21
12:58:34 UTC (rev 18202)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-10-21
13:19:47 UTC (rev 18203)
@@ -30,7 +30,6 @@
import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.seam.core.ISeamComponent;
-import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -38,7 +37,7 @@
public abstract class SeamRefactorSearcher extends RefactorSearcher {
private SeamProjectsSet projectsSet;
- private ISeamComponent component;
+ protected ISeamComponent seamComponent;
public SeamRefactorSearcher(IFile file, String name){
super(file, name);
@@ -52,7 +51,7 @@
public SeamRefactorSearcher(IFile file, String name, ISeamComponent component){
this(file, name);
- this.component = component;
+ this.seamComponent = component;
}
protected IProject[] getProjects(){
@@ -83,33 +82,33 @@
protected void checkMatch(IFile file, ELExpression operand, int offset, int length){
if(javaElement != null && operand != null)
resolve(file, operand, offset-getOffset((ELInvocationExpression)operand));
- else if(component != null && operand != null)
+ else if(seamComponent != null && operand != null)
resolveComponentsReferences(file, operand,
offset-getOffset((ELInvocationExpression)operand));
else
match(file, offset, length);
}
protected void updateEnvironment(IProject project){
- if(component == null)
+ if(seamComponent == null)
return;
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
if(seamProject == null)
return;
- ISeamComponent oldComponent = component;
+ ISeamComponent oldComponent = seamComponent;
if(oldComponent.getJavaDeclaration() != null){
- component = getComponent(seamProject, oldComponent.getName(),
(IFile)oldComponent.getJavaDeclaration().getResource());
+ seamComponent = getComponent(seamProject, oldComponent.getName(),
(IFile)oldComponent.getJavaDeclaration().getResource());
}else{
for(ISeamXmlComponentDeclaration xDecl : oldComponent.getXmlDeclarations()){
- component = getComponent(seamProject, oldComponent.getName(),
(IFile)xDecl.getResource());
- if(component != null)
+ seamComponent = getComponent(seamProject, oldComponent.getName(),
(IFile)xDecl.getResource());
+ if(seamComponent != null)
return;
}
}
- if(component == null)
- component = oldComponent;
+ if(seamComponent == null)
+ seamComponent = oldComponent;
}
private ISeamComponent getComponent(ISeamProject seamProject, String name, IFile file){
@@ -141,7 +140,7 @@
ELResolution resolution = resolver.resolve(context, operand);
- List<ELSegment> segments = resolution.findSegmentsByVariable(component);
+ List<ELSegment> segments = resolution.findSegmentsByVariable(seamComponent);
for(ELSegment segment : segments){
match(file, offset+segment.getSourceReference().getStartPosition(),
segment.getSourceReference().getLength());
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-10-21
12:58:34 UTC (rev 18202)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-10-21
13:19:47 UTC (rev 18203)
@@ -443,7 +443,7 @@
class SeamSearcher extends SeamRefactorSearcher{
public SeamSearcher(IFile declarationFile, String oldName){
- super(declarationFile, oldName, component);
+ super(declarationFile, oldName/*, component*/);
}
@Override
@@ -457,7 +457,7 @@
}
protected ELInvocationExpression findComponentReference(ELInvocationExpression
invocationExpression){
- if(component != null)
+ if(seamComponent != null)
return invocationExpression;
ELInvocationExpression invExp = invocationExpression;