Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java37
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/Assert.java4
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java21
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java18
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java13
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java20
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ITextStore.java8
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/Line.java7
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java15
9 files changed, 70 insertions, 73 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java
index 02a328c3a31..89e993671eb 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* 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
@@ -10,12 +10,10 @@
*******************************************************************************/
package org.eclipse.jface.text;
-
import java.util.ArrayList;
import java.util.List;
-
/**
* Abstract implementation of <code>ILineTracker</code>. It lets the
* definition of line delimiters to subclasses. Assuming that '\n' is
@@ -35,7 +33,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
/**
- * Combines the information of the occurence of a line delimiter.
+ * Combines the information of the occurrence of a line delimiter.
* <code>delimiterIndex</code> is the index where a line delimiter
* starts, whereas <code>delimiterLength</code>, indicates the length
* of the delimiter.
@@ -132,7 +130,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#getLineLength(int)
+ * @see org.eclipse.jface.text.ILineTracker#getLineLength(int)
*/
public int getLineLength(int line) throws BadLocationException {
@@ -149,7 +147,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#getLineNumberOfOffset(int)
+ * @see org.eclipse.jface.text.ILineTracker#getLineNumberOfOffset(int)
*/
public int getLineNumberOfOffset(int position) throws BadLocationException {
@@ -170,7 +168,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#getLineInformationOfOffset(int)
+ * @see org.eclipse.jface.text.ILineTracker#getLineInformationOfOffset(int)
*/
public IRegion getLineInformationOfOffset(int position) throws BadLocationException {
if (position > fTextLength)
@@ -188,7 +186,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#getLineInformation(int)
+ * @see org.eclipse.jface.text.ILineTracker#getLineInformation(int)
*/
public IRegion getLineInformation(int line) throws BadLocationException {
@@ -210,7 +208,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#getLineOffset(int)
+ * @see org.eclipse.jface.text.ILineTracker#getLineOffset(int)
*/
public int getLineOffset(int line) throws BadLocationException {
@@ -232,7 +230,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#getNumberOfLines()
+ * @see org.eclipse.jface.text.ILineTracker#getNumberOfLines()
*/
public int getNumberOfLines() {
@@ -246,7 +244,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#getNumberOfLines(int, int)
+ * @see org.eclipse.jface.text.ILineTracker#getNumberOfLines(int, int)
*/
public int getNumberOfLines(int position, int length) throws BadLocationException {
@@ -260,7 +258,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#computeNumberOfLines(String)
+ * @see org.eclipse.jface.text.ILineTracker#computeNumberOfLines(java.lang.String)
*/
public int computeNumberOfLines(String text) {
int count= 0;
@@ -279,13 +277,12 @@ public abstract class AbstractLineTracker implements ILineTracker {
/**
- * Returns the info of the first delimiter found in the given
+ * Returns the information about the first delimiter found in the given
* text starting at the given offset.
*
* @param text the text to be searched
* @param offset the offset in the given text
- * @return the info of the first found delimiter or <code>null</code> if
- * there is no such info
+ * @return the information of the first found delimiter or <code>null</code>
*/
protected abstract DelimiterInfo nextDelimiterInfo(String text, int offset);
@@ -397,8 +394,8 @@ public abstract class AbstractLineTracker implements ILineTracker {
* @param lineNumber the lineNumber at which the deletion starts
* @param offset the offset of the first deleted character
* @param length the number of deleted characters
- * @return whethere the start line of the deletion has been deleted
- * @exception BadLocationException if position is unkown to the tracker
+ * @return <code>true</code> if the start line has been deleted, <code>false</code> otherwise
+ * @exception BadLocationException if position is unknown to the tracker
*/
private boolean remove(int lineNumber, int offset, int length) throws BadLocationException {
@@ -455,7 +452,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#replace(int, int, String)
+ * @see org.eclipse.jface.text.ILineTracker#replace(int, int, java.lang.String)
*/
public void replace(int position, int length, String text) throws BadLocationException {
@@ -525,7 +522,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#set(String)
+ * @see org.eclipse.jface.text.ILineTracker#set(java.lang.String)
*/
public void set(String text) {
fLines.clear();
@@ -536,7 +533,7 @@ public abstract class AbstractLineTracker implements ILineTracker {
}
/*
- * @see ILineTracker#getLineDelimiter(int)
+ * @see org.eclipse.jface.text.ILineTracker#getLineDelimiter(int)
*/
public String getLineDelimiter(int line) throws BadLocationException {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/Assert.java b/org.eclipse.text/src/org/eclipse/jface/text/Assert.java
index 6830c94f221..611d36853e9 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/Assert.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/Assert.java
@@ -114,7 +114,7 @@ public final class Assert {
* @exception Throwable an unspecified unchecked exception if the object
* is <code>null</code>
*/
- public static void isNotNull(Object object) throws Throwable {
+ public static void isNotNull(Object object) {
// succeed as quickly as possible
if (object != null) {
return;
@@ -141,7 +141,7 @@ public final class Assert {
* @exception Throwable an unspecified unchecked exception if the object
* is <code>null</code>
*/
- public static void isNotNull(Object object, String message) throws Throwable {
+ public static void isNotNull(Object object, String message) {
if (object == null)
throw new AssertionFailedException("null argument;" + message);//$NON-NLS-1$
}
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java
index 301b64c41d2..5db6b66b950 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* 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
@@ -11,14 +11,15 @@
package org.eclipse.jface.text;
-
-
/**
- * Standard implementation of a generic <code>ILineTracker</code>.
+ * Standard implementation of a generic
+ * {@link org.eclipse.jface.text.ILineTracker}.
+ * <p>
* The line tracker can be configured with the set of legal line delimiters.
- * Line delimiters are unconstrainted. The line delimiters are used to
- * compute the tracker's line structure. In the case of overlapping line delimiters,
- * the longest line delimiter is given precedence of the shorter ones.<p>
+ * Line delimiters are unconstrained. The line delimiters are used to compute
+ * the tracker's line structure. In the case of overlapping line delimiters, the
+ * longest line delimiter is given precedence of the shorter ones.
+ * <p>
* This class is not intended to be subclassed.
*/
public class ConfigurableLineTracker extends AbstractLineTracker {
@@ -26,7 +27,7 @@ public class ConfigurableLineTracker extends AbstractLineTracker {
/** The strings which are considered being the line delimiter */
private String[] fDelimiters;
- /** A predefined delimiter info which is always reused as return value */
+ /** A predefined delimiter information which is always reused as return value */
private DelimiterInfo fDelimiterInfo= new DelimiterInfo();
@@ -42,14 +43,14 @@ public class ConfigurableLineTracker extends AbstractLineTracker {
}
/*
- * @see ILineDelimiter@getLegalLineDelimiters()
+ * @see org.eclipse.jface.text.ILineTracker#getLegalLineDelimiters()
*/
public String[] getLegalLineDelimiters() {
return fDelimiters;
}
/*
- * @see AbstractLineTracker#nextDelimiterInfo(String, int)
+ * @see org.eclipse.jface.text.AbstractLineTracker#nextDelimiterInfo(java.lang.String, int)
*/
protected DelimiterInfo nextDelimiterInfo(String text, int offset) {
int[] info= TextUtilities.indexOf(fDelimiters, text, offset);
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java
index f7d68bba574..291003e9826 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* 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
@@ -11,19 +11,19 @@
package org.eclipse.jface.text;
-
-
/**
- * Standard implementation of <code>ILineTracker</code>.
- * The line tracker considers the three common line
- * delimiters which are '\n', '\r', '\r\n'.<p>
+ * Standard implementation of {@link org.eclipse.jface.text.ILineTracker}.
+ * <p>
+ * The line tracker considers the three common line delimiters which are '\n',
+ * '\r', '\r\n'.
+ * <p>
* This class is not intended to be subclassed.
*/
public class DefaultLineTracker extends AbstractLineTracker {
/** The predefined delimiters of this tracker */
public final static String[] DELIMITERS= { "\r", "\n", "\r\n" }; //$NON-NLS-3$ //$NON-NLS-1$ //$NON-NLS-2$
- /** A predefined delimiter info which is always reused as return value */
+ /** A predefined delimiter information which is always reused as return value */
private DelimiterInfo fDelimiterInfo= new DelimiterInfo();
@@ -34,14 +34,14 @@ public class DefaultLineTracker extends AbstractLineTracker {
}
/*
- * @see ILineDelimiter@getLegalLineDelimiters()
+ * @see org.eclipse.jface.text.ILineTracker#getLegalLineDelimiters()
*/
public String[] getLegalLineDelimiters() {
return DELIMITERS;
}
/*
- * @see AbstractLineTracker#nextDelimiterInfo(String, int)
+ * @see org.eclipse.jface.text.AbstractLineTracker#nextDelimiterInfo(java.lang.String, int)
*/
protected DelimiterInfo nextDelimiterInfo(String text, int offset) {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java b/org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java
index e0946cb613f..d6a8c4e3612 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* 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
@@ -12,7 +12,6 @@ package org.eclipse.jface.text;
-
/**
* Implements a gap managing text store. The gap text store
* relies on the assumption that subsequent changes of a document are co-located.
@@ -130,7 +129,7 @@ public class GapTextStore implements ITextStore {
}
/*
- * @see ITextStore#get(int)
+ * @see org.eclipse.jface.text.ITextStore#get(int)
*/
public char get(int offset) {
@@ -142,7 +141,7 @@ public class GapTextStore implements ITextStore {
}
/*
- * @see ITextStore#get(int, int)
+ * @see org.eclipse.jface.text.ITextStore#get(int, int)
*/
public String get(int offset, int length) {
@@ -166,16 +165,15 @@ public class GapTextStore implements ITextStore {
}
/*
- * @see ITextStore#getLength()
+ * @see org.eclipse.jface.text.ITextStore#getLength()
*/
public int getLength() {
int length= fGapEnd - fGapStart;
return (fContent.length - length);
}
-
/*
- * @see ITextStore#replace(int, int, String)
+ * @see org.eclipse.jface.text.ITextStore#replace(int, int, java.lang.String)
*/
public void replace(int offset, int length, String text) {
@@ -214,6 +212,7 @@ public class GapTextStore implements ITextStore {
* Sets the content to <code>text</code> and removes the gap
* since there are no sensible predictions about
* where the next change will occur.
+ *
* @see ITextStore#set(String)
*/
public void set(String text) {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java
index 837b845c65e..edfb66cb5d0 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* 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
@@ -8,21 +8,21 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-
package org.eclipse.jface.text;
/**
* A line tracker maps character positions to line numbers and vice versa.
- * Initially the line tracker is informed about its underlying text
- * in order to initialize the mapping information. After that, the line
- * tracker is informed about all changes of the underlying text allowing
- * for incremental updates of the mapping information. It is the client's
- * responsibility to actively inform the line tacker about text changes.
- * For example, when using a line tracker in combination with a document
- * the document controls the line tracker.<p>
+ * Initially the line tracker is informed about its underlying text in order to
+ * initialize the mapping information. After that, the line tracker is informed
+ * about all changes of the underlying text allowing for incremental updates of
+ * the mapping information. It is the client's responsibility to actively inform
+ * the line tacker about text changes. For example, when using a line tracker in
+ * combination with a document the document controls the line tracker.
+ * <p>
* Clients may implement this interface or use the standard implementation
- * <code>DefaultLineTracker</code>.
+ * {@link org.eclipse.jface.text.DefaultLineTracker}or
+ * {@link org.eclipse.jface.text.ConfigurableLineTracker}.
*/
public interface ILineTracker {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/ITextStore.java b/org.eclipse.text/src/org/eclipse/jface/text/ITextStore.java
index b11b23aeb12..87a4a7795d9 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/ITextStore.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/ITextStore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* 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
@@ -13,8 +13,10 @@ package org.eclipse.jface.text;
/**
* Interface for storing and managing text.
- * Provides access to the stored text and allows to manipulate it.
- * Clients may implement this interface or use <code>GapTextStore</code>.
+ * <p>
+ * Provides access to the stored text and allows to manipulate it. Clients may
+ * implement this interface or use {@link org.eclipse.jface.text.GapTextStore} and
+ * {@link org.eclipse.jface.text.SequentialRewriteTextStore}.
*/
public interface ITextStore {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/Line.java b/org.eclipse.text/src/org/eclipse/jface/text/Line.java
index 86dfd604c33..c843cab00fe 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/Line.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/Line.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* 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
@@ -11,7 +11,6 @@
package org.eclipse.jface.text;
-
/**
* Describes a line as a particular number of characters beginning at
* a particular offset, consisting of a particular number of characters,
@@ -52,14 +51,14 @@ class Line implements IRegion {
}
/*
- * @see IRegion#getOffset()
+ * @see org.eclipse.jface.text.IRegion#getOffset()
*/
public int getOffset() {
return offset;
}
/*
- * @see IRegion#getLength()
+ * @see org.eclipse.jface.text.IRegion#getLength()
*/
public int getLength() {
return length;
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java b/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java
index 824fdc2100b..7313b684e5c 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
* 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
@@ -8,9 +8,9 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-
package org.eclipse.jface.text;
+
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -72,7 +72,7 @@ public class SequentialRewriteTextStore implements ITextStore {
}
/*
- * @see ITextStore#replace(int, int, String)
+ * @see org.eclipse.jface.text.ITextStore#replace(int, int, java.lang.String)
*/
public void replace(int offset, int length, String text) {
@@ -111,7 +111,7 @@ public class SequentialRewriteTextStore implements ITextStore {
}
/*
- * @see ITextStore#set(String)
+ * @see org.eclipse.jface.text.ITextStore#set(java.lang.String)
*/
public void set(String text) {
fSource.set(text);
@@ -119,7 +119,7 @@ public class SequentialRewriteTextStore implements ITextStore {
}
/*
- * @see ITextStore#get(int, int)
+ * @see org.eclipse.jface.text.ITextStore#get(int, int)
*/
public String get(int offset, int length) {
@@ -181,7 +181,7 @@ public class SequentialRewriteTextStore implements ITextStore {
}
/*
- * @see ITextStore#get(int)
+ * @see org.eclipse.jface.text.ITextStore#get(int)
*/
public char get(int offset) {
if (fReplaceList.size() == 0) {
@@ -224,7 +224,7 @@ public class SequentialRewriteTextStore implements ITextStore {
}
/*
- * @see ITextStore#getLength()
+ * @see org.eclipse.jface.text.ITextStore#getLength()
*/
public int getLength() {
if (fReplaceList.size() == 0) {
@@ -270,5 +270,4 @@ public class SequentialRewriteTextStore implements ITextStore {
fSource.set(buffer.toString());
fReplaceList.clear();
}
-
}

Back to the top