Package org.eclipse.jface.text.source
Interface ILineDiffer
-
public interface ILineDifferProtocol that allows direct access to line information. Usually, implementations will also implementIAnnotationModel, which only allowsIteratorbased access to annotations.ILineDifferalso allows to revert any lines to their original contents as defined by the quick diff reference used by the receiver.This interface may be implemented by clients.
In order to provide backward compatibility for clients of
ILineDiffer, extension interfaces are used to provide a means of evolution. The following extension interface exists:ILineDifferExtension(since version 3.1): introducing the concept suspending and resuming anILineDiffer.ILineDifferExtension2(since version 3.3): allowing to query the suspension state of anILineDiffer.
- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ILineDiffInfogetLineInfo(int line)Determines the line state for linelinein the targeted document.intrestoreAfterLine(int line)Restores the deleted lines afterline.voidrevertBlock(int line)Reverts a block of modified / added lines to their original state, including any deleted lines inside the block or at its borders.voidrevertLine(int line)Reverts a single changed line to its original state, not touching any lines that are deleted at its borders.voidrevertSelection(int line, int nLines)Reverts a range of lines to their original state, including any deleted lines inside the block or at its borders.
-
-
-
Method Detail
-
getLineInfo
ILineDiffInfo getLineInfo(int line)
Determines the line state for linelinein the targeted document.- Parameters:
line- the line to get diff information for- Returns:
- the line information object for
lineornullif none
-
revertLine
void revertLine(int line) throws BadLocationExceptionReverts a single changed line to its original state, not touching any lines that are deleted at its borders.- Parameters:
line- the line number of the line to be restored.- Throws:
BadLocationException- iflineis out of bounds.
-
revertBlock
void revertBlock(int line) throws BadLocationExceptionReverts a block of modified / added lines to their original state, including any deleted lines inside the block or at its borders. A block is considered to be a range of modified (e.g. changed, or added) lines.- Parameters:
line- any line in the block to be reverted.- Throws:
BadLocationException- iflineis out of bounds.
-
revertSelection
void revertSelection(int line, int nLines) throws BadLocationExceptionReverts a range of lines to their original state, including any deleted lines inside the block or at its borders.- Parameters:
line- any line in the block to be reverted.nLines- the number of lines to be reverted, must be > 0.- Throws:
BadLocationException- iflineis out of bounds.
-
restoreAfterLine
int restoreAfterLine(int line) throws BadLocationExceptionRestores the deleted lines afterline.- Parameters:
line- the deleted lines following this line number are restored.- Returns:
- the number of restored lines.
- Throws:
BadLocationException- iflineis out of bounds.
-
-