Package org.eclipse.handly.text

# Class DocumentChange

java.lang.Object
org.eclipse.handly.text.DocumentChange

All Implemented Interfaces:
  `IDocumentChange`

Direct Known Subclasses:
  `DocumentChangeOperation.UndoChange`

public class DocumentChange extends Object implements IDocumentChange
Default implementation of `IDocumentChange`.

- ## Field Summary

  ### Fields inherited from interface org.eclipse.handly.text.IDocumentChange

  `CREATE_UNDO, NONE, UPDATE_REGIONS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DocumentChange(org.eclipse.text.edits.TextEdit edit)`
  Creates a new document change with the given text edit and `CREATE_UNDO|UPDATE_REGIONS` style.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ISnapshot`
  `getBase()`
  Returns the snapshot on which this change's edit tree is based, or `null` if the snapshot is unknown.
  `org.eclipse.text.edits.TextEdit`
  `getEdit()`
  Returns the edit tree associated with this change.
  `int`
  `getStyle()`
  Returns the style flags associated with this change.
  `void`
  `setBase(ISnapshot base)`
  Sets the snapshot on which this change is based.
  `void`
  `setStyle(int style)`
  Sets the style flags for this change.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DocumentChange

    public DocumentChange(org.eclipse.text.edits.TextEdit edit)
    Creates a new document change with the given text edit and `CREATE_UNDO|UPDATE_REGIONS` style.
    Parameters:
      `edit` - a text edit - must not be `null`

- ## Method Details

  - ### setBase

    public void setBase(ISnapshot base)
    Sets the snapshot on which this change is based.
    Parameters:
      `base` - the snapshot on which the change is based, or `null` if unknown

  - ### setStyle

    public void setStyle(int style)
    Sets the style flags for this change. Valid flags are `IDocumentChange.NONE` or any combination of `IDocumentChange.CREATE_UNDO` and `IDocumentChange.UPDATE_REGIONS`.
    Parameters:
      `style` - style flags

  - ### getEdit

    public org.eclipse.text.edits.TextEdit getEdit()
    Description copied from interface: `IDocumentChange`
    Returns the edit tree associated with this change.
    Specified by:
      `getEdit` in interface `IDocumentChange`
    Returns:
      the change's edit tree (never `null`)

  - ### getBase

    public ISnapshot getBase()
    Description copied from interface: `IDocumentChange`
    Returns the snapshot on which this change's edit tree is based, or `null` if the snapshot is unknown.
    Specified by:
      `getBase` in interface `IDocumentChange`
    Returns:
      the snapshot on which the change is based, or `null` if unknown

  - ### getStyle

    public int getStyle()
    Description copied from interface: `IDocumentChange`
    Returns the style flags associated with this change. May return `IDocumentChange.NONE` or any combination of `IDocumentChange.CREATE_UNDO` and `IDocumentChange.UPDATE_REGIONS` flags.
    Specified by:
      `getStyle` in interface `IDocumentChange`
    Returns:
      the change's style flags