Author: dazarov
Date: 2009-10-06 09:17:59 -0400 (Tue, 06 Oct 2009)
New Revision: 17926
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
Log:
Updated: Warning "This component has declaration from jar file" appears if
declaration from jar file has component's name
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-06
13:07:25 UTC (rev 17925)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-10-06
13:17:59 UTC (rev 17926)
@@ -304,15 +304,21 @@
protected void checkDeclarations(ISeamComponent component) throws CoreException{
if(component.getJavaDeclaration() != null){
- if(coreHelper.isJar(component.getJavaDeclaration()))
- status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR,
new String[]{component.getName(),
component.getJavaDeclaration().getResource().getFullPath().toString()}));
+ if(coreHelper.isJar(component.getJavaDeclaration())){
+ ITextSourceReference location =
((SeamComponentDeclaration)component.getJavaDeclaration()).getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ if(location == null || location.getStartPosition() != 0 || location.getLength() !=
0)
+ status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR,
new String[]{component.getName(),
component.getJavaDeclaration().getResource().getFullPath().toString()}));
+ }
}
Set<ISeamXmlComponentDeclaration> xmlDecls = component.getXmlDeclarations();
for(ISeamXmlComponentDeclaration xmlDecl : xmlDecls){
- if(coreHelper.isJar(xmlDecl))
- status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR,
new String[]{component.getName(), xmlDecl.getResource().getFullPath().toString()}));
+ if(coreHelper.isJar(xmlDecl)){
+ ITextSourceReference location =
((SeamComponentDeclaration)xmlDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ if(location == null || location.getStartPosition() != 0 || location.getLength() !=
0)
+ status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR,
new String[]{component.getName(), xmlDecl.getResource().getFullPath().toString()}));
+ }
}
}
Show replies by date