Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jface.text.source
Interface ILineDiffer

public interface ILineDiffer

Protocol that allows direct access to line information. Usually, implementations will also implement `IAnnotationModel`, which only allows `Iterator` based access to annotations.

`ILineDiffer` also 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.

Since:
  3.0

Method Summary
`ILineDiffInfo` | `getLineInfo(int line)` Determines the line state for line `line` in the targeted document.
`int` | `restoreAfterLine(int line)` Restores the deleted lines after `line`.
`void` | `revertBlock(int line)` Reverts a block of modified / added lines to their original state, including any deleted lines inside the block or at its borders.
`void` | `revertLine(int line)` Reverts a single changed line to its original state, not touching any lines that are deleted at its borders.
`void` | `revertSelection(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

    public ILineDiffInfo getLineInfo(int line)

  Determines the line state for line `line` in the targeted document.

  Parameters:
    `line` - the line to get diff information for
  Returns:
    the line information object for `line`.

### revertLine

    public void revertLine(int line)
                    throws BadLocationException

  Reverts 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` - if `line` is out of bounds.

### revertBlock

    public void revertBlock(int line)
                     throws BadLocationException

  Reverts 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` - if `line` is out of bounds.

### revertSelection

    public void revertSelection(int line,
                                int nLines)
                         throws BadLocationException

  Reverts 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` - if `line` is out of bounds.

### restoreAfterLine

    public int restoreAfterLine(int line)
                         throws BadLocationException

  Restores the deleted lines after `line`.

  Parameters:
    `line` - the deleted lines following this line number are restored.
  Returns:
    the number of restored lines.
  Throws:
    `BadLocationException` - if `line` is out of bounds.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.