Author: dazarov
Date: 2011-12-22 17:18:27 -0500 (Thu, 22 Dec 2011)
New Revision: 37538
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java
Log:
Java Seam and CDI quick fixes: after quick fix, editor is scrolled to the beginning. If
Undo/Redo commands are used, the entire file content gets selected
https://issues.jboss.org/browse/JBIDE-10536
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java 2011-12-22
20:05:38 UTC (rev 37537)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java 2011-12-22
22:18:27 UTC (rev 37538)
@@ -31,6 +31,7 @@
import org.eclipse.jdt.core.ITypeParameter;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.BodyDeclaration;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.core.JavaElement;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
@@ -326,6 +327,14 @@
if(elementNode != null){
position = elementNode.getStartPosition();
+ if(elementNode instanceof BodyDeclaration &&
((BodyDeclaration)elementNode).getJavadoc() != null){
+ position += ((BodyDeclaration)elementNode).getJavadoc().getLength();
+ char c = buffer.getChar(position);
+ while((c == '\r' || c == '\n') && position <
buffer.getLength()-2 ){
+ position++;
+ c = buffer.getChar(position);
+ }
+ }
}
if(!(workingCopyMember instanceof ILocalVariable)){