|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2006, 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2006, 2010 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 58-70
Link Here
|
| 58 |
import org.eclipse.jdt.core.IType; |
58 |
import org.eclipse.jdt.core.IType; |
| 59 |
import org.eclipse.jdt.core.JavaCore; |
59 |
import org.eclipse.jdt.core.JavaCore; |
| 60 |
import org.eclipse.jdt.core.JavaModelException; |
60 |
import org.eclipse.jdt.core.JavaModelException; |
|
|
61 |
import org.eclipse.jdt.core.SourceRange; |
| 61 |
import org.eclipse.jdt.core.ToolFactory; |
62 |
import org.eclipse.jdt.core.ToolFactory; |
| 62 |
import org.eclipse.jdt.core.compiler.IProblem; |
63 |
import org.eclipse.jdt.core.compiler.IProblem; |
| 63 |
import org.eclipse.jdt.core.compiler.IScanner; |
64 |
import org.eclipse.jdt.core.compiler.IScanner; |
| 64 |
import org.eclipse.jdt.core.compiler.ITerminalSymbols; |
65 |
import org.eclipse.jdt.core.compiler.ITerminalSymbols; |
| 65 |
import org.eclipse.jdt.core.compiler.InvalidInputException; |
66 |
import org.eclipse.jdt.core.compiler.InvalidInputException; |
| 66 |
import org.eclipse.jdt.core.dom.CompilationUnit; |
67 |
import org.eclipse.jdt.core.dom.CompilationUnit; |
| 67 |
import org.eclipse.jdt.core.SourceRange; |
|
|
| 68 |
|
68 |
|
| 69 |
import org.eclipse.jdt.ui.PreferenceConstants; |
69 |
import org.eclipse.jdt.ui.PreferenceConstants; |
| 70 |
|
70 |
|
|
Lines 480-491
Link Here
|
| 480 |
|
480 |
|
| 481 |
if (captionLine < lastLine) { |
481 |
if (captionLine < lastLine) { |
| 482 |
int postOffset= document.getLineOffset(captionLine + 1); |
482 |
int postOffset= document.getLineOffset(captionLine + 1); |
| 483 |
IRegion postRegion= new Region(postOffset, offset + length - postOffset); |
483 |
int postLength= offset + length - postOffset; |
| 484 |
|
484 |
if (postLength > 0) { |
| 485 |
if (preRegion == null) |
485 |
IRegion postRegion= new Region(postOffset, postLength); |
| 486 |
return new IRegion[] { postRegion }; |
486 |
if (preRegion == null) |
| 487 |
|
487 |
return new IRegion[] { postRegion }; |
| 488 |
return new IRegion[] { preRegion, postRegion }; |
488 |
return new IRegion[] { preRegion, postRegion }; |
|
|
489 |
} |
| 489 |
} |
490 |
} |
| 490 |
|
491 |
|
| 491 |
if (preRegion != null) |
492 |
if (preRegion != null) |
|
Lines 611-622
Link Here
|
| 611 |
|
612 |
|
| 612 |
if (captionLine < lastLine) { |
613 |
if (captionLine < lastLine) { |
| 613 |
int postOffset= document.getLineOffset(captionLine + 1); |
614 |
int postOffset= document.getLineOffset(captionLine + 1); |
| 614 |
IRegion postRegion= new Region(postOffset, offset + length - postOffset); |
615 |
int postLength= offset + length - postOffset; |
| 615 |
|
616 |
if (postLength > 0) { |
| 616 |
if (preRegion == null) |
617 |
IRegion postRegion= new Region(postOffset, postLength); |
| 617 |
return new IRegion[] { postRegion }; |
618 |
if (preRegion == null) |
| 618 |
|
619 |
return new IRegion[] { postRegion }; |
| 619 |
return new IRegion[] { preRegion, postRegion }; |
620 |
return new IRegion[] { preRegion, postRegion }; |
|
|
621 |
} |
| 620 |
} |
622 |
} |
| 621 |
|
623 |
|
| 622 |
if (preRegion != null) |
624 |
if (preRegion != null) |