|
Eclipse Platform 2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.eclipse.jface.text.AbstractLineTracker
Abstract implementation of ILineTracker. It lets the
definition of line delimiters to subclasses. Assuming that '\n' is
the only line delimiter, this abstract implementation defines the
following line scheme:
| Inner Class Summary | |
protected static class |
AbstractLineTracker.DelimiterInfo
Combines the information of the occurence of a line delimiter. |
| Constructor Summary | |
protected |
AbstractLineTracker()
Creates a new line tracker. |
| Method Summary | |
int |
computeNumberOfLines(String text)
Computes the number of lines in the given text. |
String |
getLineDelimiter(int line)
Returns the line delimiter of the specified line. |
IRegion |
getLineInformation(int line)
Returns a line description of the given line. |
IRegion |
getLineInformationOfOffset(int position)
Returns a line description of the line at the given offset. |
int |
getLineLength(int line)
Returns length of the specified line including the line's delimiter. |
int |
getLineNumberOfOffset(int position)
Returns the line number the character at the given offset belongs to. |
int |
getLineOffset(int line)
Returns the position of the first character of the specified line. |
int |
getNumberOfLines()
Returns the number of lines. |
int |
getNumberOfLines(int position,
int length)
Returns the number of lines which are occupied by a given text range. |
protected abstract AbstractLineTracker.DelimiterInfo |
nextDelimiterInfo(String text,
int offset)
Returns the info of the first delimiter found in the given text starting at the given offset. |
void |
replace(int position,
int length,
String text)
Informs the line tracker about the specified change in the tracked text. |
void |
set(String text)
Sets the tracked text to the specified text. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.text.ILineTracker |
getLegalLineDelimiters |
| Constructor Detail |
protected AbstractLineTracker()
| Method Detail |
public int getLineLength(int line)
throws BadLocationException
ILineTrackergetLineLength in interface ILineTrackerorg.eclipse.jface.text.ILineTrackerline - the line of interestBadLocationException - if line is unknown to this tracker
public int getLineNumberOfOffset(int position)
throws BadLocationException
ILineTrackergetLineNumberOfOffset in interface ILineTrackerorg.eclipse.jface.text.ILineTrackeroffset - the offset whose line number to be determinedBadLocationException - if the offset is invalid in this tracker
public IRegion getLineInformationOfOffset(int position)
throws BadLocationException
ILineTrackergetLineInformationOfOffset in interface ILineTrackerorg.eclipse.jface.text.ILineTrackeroffset - the offset whose line should be describedBadLocationException - if offset is invalid in this tracker
public IRegion getLineInformation(int line)
throws BadLocationException
ILineTrackergetLineInformation in interface ILineTrackerorg.eclipse.jface.text.ILineTrackerline - the line that should be describedBadLocationException - if line is unknown to this tracker
public int getLineOffset(int line)
throws BadLocationException
ILineTrackergetLineOffset in interface ILineTrackerorg.eclipse.jface.text.ILineTrackerline - the line of interestBadLocationException - if the line is unknown to this trackerpublic int getNumberOfLines()
ILineTrackergetNumberOfLines in interface ILineTrackerorg.eclipse.jface.text.ILineTracker
public int getNumberOfLines(int position,
int length)
throws BadLocationException
ILineTrackergetNumberOfLines in interface ILineTrackerorg.eclipse.jface.text.ILineTrackeroffset - the offset of the specified text rangelength - the length of the specified text rangeBadLocationException - if specified range is unknown to this trackerpublic int computeNumberOfLines(String text)
ILineTrackercomputeNumberOfLines in interface ILineTrackerorg.eclipse.jface.text.ILineTrackertext - the text whose number of lines should be computed
protected abstract AbstractLineTracker.DelimiterInfo nextDelimiterInfo(String text,
int offset)
text - the text to be searchedoffset - the offset in the given textnull if
there is no such info
public void replace(int position,
int length,
String text)
throws BadLocationException
ILineTrackerreplace in interface ILineTrackerorg.eclipse.jface.text.ILineTrackeroffset - the offset of the replaced textlength - the length of the replaced texttext - the substitution textBadLocationException - if specified range is unknown to this trackerpublic void set(String text)
ILineTrackerset in interface ILineTrackerorg.eclipse.jface.text.ILineTrackertext - the new tracked text
public String getLineDelimiter(int line)
throws BadLocationException
ILineTrackernull if the
line is not closed with a line delimiter.getLineDelimiter in interface ILineTrackerorg.eclipse.jface.text.ILineTrackerline - the line whose line delimiter is queriednull if line does not have a delimiterBadLocationException - if the line number is invalid in this tracker's line structure
|
Eclipse Platform 2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||