/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
/**
* Creates a new Javadoc auto indent strategy for the given document partitioning.
- *
+ *
* @param partitioning the document partitioning
*/
public JavaDocAutoIndentStrategy(String partitioning) {
/**
* Method jdocWrapParagraphFromLine.
- *
+ *
* @param document
* @param line
* @param always
}
/**
- * Line break iterator to handle whitespaces as first class citizens.
+ * Line break iterator to handle whitespaces as first class citizens.
*/
private static class LineBreakIterator {
}
/**
- * Formats a paragraph, using break iterator.
- *
+ * Formats a paragraph, using break iterator.
+ *
* @param offset an offset within the paragraph, which will be updated with respect to formatting.
*/
private static String formatParagraph(String paragraph, int[] offset, String prefix, String lineDelimiter, int margin) {
int index= offset[0];
int indexBuffer= -1;
- // line delimiter could be null
- if (lineDelimiter == null)
- lineDelimiter= ""; //$NON-NLS-1$
+ // line delimiter could be null
+ if (lineDelimiter == null)
+ lineDelimiter= ""; //$NON-NLS-1$
for (int start= iterator.first(), end= iterator.next(); end != BreakIterator.DONE; start= end, end= iterator.next()) {
private String getLineContents(IDocument d, int line) throws BadLocationException {
int offset = d.getLineOffset(line);
int length = d.getLineLength(line);
- String lineDelimiter= d.getLineDelimiter(line);
- if (lineDelimiter != null)
- length= length - lineDelimiter.length();
+ String lineDelimiter= d.getLineDelimiter(line);
+ if (lineDelimiter != null)
+ length= length - lineDelimiter.length();
String lineContents = d.get(offset, length);
int trim = jdocExtractLinePrefix(d, line).length();
return lineContents.substring(trim);