mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 03:05:39 +02:00
Cosmetics.
This commit is contained in:
parent
aceb2222db
commit
8b98a1e93e
1 changed files with 11 additions and 11 deletions
|
@ -77,7 +77,7 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
private static final int[] scomment7= {469, 17};
|
private static final int[] scomment7= {469, 17};
|
||||||
|
|
||||||
private ICProject fCProject;
|
private ICProject fCProject;
|
||||||
private final String fTestFilename= "/"+PROJECT+"/src/this.cpp";
|
private final String fTestFilename= "/" + PROJECT + "/src/this.cpp";
|
||||||
|
|
||||||
private static SourceViewer fSourceViewer;
|
private static SourceViewer fSourceViewer;
|
||||||
|
|
||||||
|
@ -119,13 +119,13 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make the document use the given line separator.
|
* Makes the document use the given line separator.
|
||||||
*
|
*
|
||||||
* @param document
|
* @param document
|
||||||
* @param lineSeparator
|
* @param lineSeparator
|
||||||
*/
|
*/
|
||||||
private void adjustLineSeparator(IDocument document, String lineSeparator) throws BadLocationException {
|
private void adjustLineSeparator(IDocument document, String lineSeparator) throws BadLocationException {
|
||||||
for (int i= 0; i < document.getNumberOfLines(); i++) {
|
for (int i = 0; i < document.getNumberOfLines(); i++) {
|
||||||
String delimiter= document.getLineDelimiter(i);
|
String delimiter= document.getLineDelimiter(i);
|
||||||
if (delimiter != null && !delimiter.equals(lineSeparator)) {
|
if (delimiter != null && !delimiter.equals(lineSeparator)) {
|
||||||
IRegion lineRegion= document.getLineInformation(i);
|
IRegion lineRegion= document.getLineInformation(i);
|
||||||
|
@ -137,12 +137,12 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
protected List<Position> findRangesColored(RGB rgb) {
|
protected List<Position> findRangesColored(RGB rgb) {
|
||||||
List<Position> result= new ArrayList<Position>();
|
List<Position> result= new ArrayList<Position>();
|
||||||
IEditorPart p= get();
|
IEditorPart p= get();
|
||||||
ISourceViewer vw= ((CEditor)p).getViewer();
|
ISourceViewer vw= ((CEditor) p).getViewer();
|
||||||
Accessor a= new Accessor(vw, TextViewer.class);
|
Accessor a= new Accessor(vw, TextViewer.class);
|
||||||
StyledText st= (StyledText) a.get("fTextWidget");
|
StyledText st= (StyledText) a.get("fTextWidget");
|
||||||
StyleRange[] rgs= st.getStyleRanges();
|
StyleRange[] rgs= st.getStyleRanges();
|
||||||
for(int i=0; i<rgs.length; i++) {
|
for (int i = 0; i < rgs.length; i++) {
|
||||||
if(rgs[i].foreground != null && rgs[i].foreground.getRGB().equals(rgb)) {
|
if (rgs[i].foreground != null && rgs[i].foreground.getRGB().equals(rgb)) {
|
||||||
result.add(new Position(rgs[i].start, rgs[i].length));
|
result.add(new Position(rgs[i].start, rgs[i].length));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,12 +151,12 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
|
|
||||||
protected IEditorPart get(){
|
protected IEditorPart get(){
|
||||||
IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||||
if(window!=null) {
|
if (window!=null) {
|
||||||
if(window.getActivePage()!=null) {
|
if (window.getActivePage()!=null) {
|
||||||
IEditorReference[] es= window.getActivePage().getEditorReferences();
|
IEditorReference[] es= window.getActivePage().getEditorReferences();
|
||||||
for(int i=0; i<es.length; i++) {
|
for (int i = 0; i < es.length; i++) {
|
||||||
IEditorPart part= es[i].getEditor(false);
|
IEditorPart part= es[i].getEditor(false);
|
||||||
if(part != null)
|
if (part != null)
|
||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
|
||||||
|
|
||||||
private List<Position> mkPositions(int[][] raw) {
|
private List<Position> mkPositions(int[][] raw) {
|
||||||
List<Position> result= new ArrayList<Position>();
|
List<Position> result= new ArrayList<Position>();
|
||||||
for(int i=0; i<raw.length; i++) {
|
for (int i = 0; i < raw.length; i++) {
|
||||||
Assert.assertEquals(2, raw[i].length);
|
Assert.assertEquals(2, raw[i].length);
|
||||||
result.add(new Position(raw[i][0], raw[i][1]));
|
result.add(new Position(raw[i][0], raw[i][1]));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue