diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage.java index 99c9f51f046..19443f68d40 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage.java @@ -36,7 +36,9 @@ public class BracesTabPage extends ModifyDialogTabPage { */ private final static String PREVIEW= createPreviewHeader(FormatterMessages.BracesTabPage_preview_header) + - "#include \n" + //$NON-NLS-1$ + "#include \n\n" + //$NON-NLS-1$ + "int digits[]= { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };" + //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "class Point {" + //$NON-NLS-1$ "public:" + //$NON-NLS-1$ "Point(double xc, double yc) : x(xc), y(yc) {}" + //$NON-NLS-1$ @@ -45,11 +47,13 @@ public class BracesTabPage extends ModifyDialogTabPage { "double x;" + //$NON-NLS-1$ "double y;" + //$NON-NLS-1$ "};" + //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "double Point::distance(const Point& other) const {" + //$NON-NLS-1$ "double dx = x - other.x;" + //$NON-NLS-1$ "double dy = y - other.y;" + //$NON-NLS-1$ "return sqrt(dx * dx + dy * dy);" + //$NON-NLS-1$ "}"+ //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "int Point::compareX(const Point& other) const {" + //$NON-NLS-1$ "if(x < other.x) {" + //$NON-NLS-1$ "return -1;" + //$NON-NLS-1$ @@ -59,6 +63,7 @@ public class BracesTabPage extends ModifyDialogTabPage { "return 0;" + //$NON-NLS-1$ "}"+ //$NON-NLS-1$ "}"+ //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "namespace FOO {"+ //$NON-NLS-1$ "int foo(int bar) const {" + //$NON-NLS-1$ "switch(bar) {" + //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CodeFormatterConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CodeFormatterConfigurationBlock.java index 8ef6657d152..8e180e00f30 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CodeFormatterConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CodeFormatterConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -71,14 +71,16 @@ public class CodeFormatterConfigurationBlock extends ProfileConfigurationBlock { "/*\n* " + //$NON-NLS-1$ FormatterMessages.CodingStyleConfigurationBlock_preview_title + "\n*/\n" + //$NON-NLS-1$ - "#include \n" + //$NON-NLS-1$ + "#include \n\n" + //$NON-NLS-1$ "class Point {" + //$NON-NLS-1$ "public:" + //$NON-NLS-1$ "Point(double xc, double yc) : x(xc), y(yc) {}" + //$NON-NLS-1$ "double distance(const Point& other) const;" + //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "double x;" + //$NON-NLS-1$ "double y;" + //$NON-NLS-1$ "};" + //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "double Point::distance(const Point& other) const {" + //$NON-NLS-1$ "double dx = x - other.x;" + //$NON-NLS-1$ "double dy = y - other.y;" + //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IndentationTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IndentationTabPage.java index 82749af95cf..7096f7b8597 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IndentationTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IndentationTabPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,20 +41,24 @@ public class IndentationTabPage extends ModifyDialogTabPage { */ private final static String PREVIEW= createPreviewHeader(FormatterMessages.IndentationTabPage_preview_header) + - "#include \n" + //$NON-NLS-1$ + "#include \n\n" + //$NON-NLS-1$ "class Point {" + //$NON-NLS-1$ "public:" + //$NON-NLS-1$ "Point(double xc, double yc) : x(xc), y(yc) {}" + //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "double distance(const Point& other) const;" + //$NON-NLS-1$ "int compareX(const Point& other) const;" + //$NON-NLS-1$ "double x;" + //$NON-NLS-1$ "double y;" + //$NON-NLS-1$ - "};" + //$NON-NLS-1$ + "};" + //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "double Point::distance(const Point& other) const {" + //$NON-NLS-1$ "double dx = x - other.x;" + //$NON-NLS-1$ "double dy = y - other.y;" + //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "return sqrt(dx * dx + dy * dy);" + //$NON-NLS-1$ "}"+ //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "int Point::compareX(const Point& other) const {" + //$NON-NLS-1$ "if(x < other.x) {" + //$NON-NLS-1$ "return -1;" + //$NON-NLS-1$ @@ -64,6 +68,7 @@ public class IndentationTabPage extends ModifyDialogTabPage { "return 0;" + //$NON-NLS-1$ "}"+ //$NON-NLS-1$ "}"+ //$NON-NLS-1$ + "\n\n" + //$NON-NLS-1$ "namespace FOO {"+ //$NON-NLS-1$ "int foo(int bar) const {" + //$NON-NLS-1$ "switch(bar) {" + //$NON-NLS-1$