Runtime

## org.eclipse.gmf.runtime.diagram.ui.resources.editor.document
Interface IDocumentEditor

All Known Implementing Classes:
  DiagramDocumentEditor

public interface IDocumentEditor

An interface to be implemented by all the editors displaying a diagram

Method Summary
`void` `close(boolean save)` Closes this text editor after optionally saving changes.
`IDocumentProvider` `getDocumentProvider()` Returns this text editor's document provider.
`boolean` `isEditable()` Returns whether the text in this text editor can be changed by the user.
`boolean` `isEditorInputModifiable()` Returns whether the editor's input can be persistently be modified.
`boolean` `isEditorInputReadOnly()` Returns whether the editor's input is read-only.
`boolean` `validateEditorInputState()` Validates the state of the given editor input.

Method Detail

### getDocumentProvider

    public IDocumentProvider getDocumentProvider()

  Returns this text editor's document provider.

  Returns:
    the document provider or `null` if none, e.g. after closing the editor

### close

    public void close(boolean save)

  Closes this text editor after optionally saving changes.

  Parameters:
    `save` - `true` if unsaved changed should be saved, and `false` if unsaved changed should be discarded

### isEditable

    public boolean isEditable()

  Returns whether the text in this text editor can be changed by the user.

  Returns:
    `true` if it can be edited, and `false` if it is read-only

### isEditorInputReadOnly

    public boolean isEditorInputReadOnly()

  Returns whether the editor's input is read-only. The semantics of this method is orthogonal to `isEditable` as it talks about the editor input, i.e. the domain element, and not about the editor document.

  Returns:
    `true` if the editor input is read-only

### isEditorInputModifiable

    public boolean isEditorInputModifiable()

  Returns whether the editor's input can be persistently be modified. This is orthogonal to `ITextEditorExtension.isEditorInputReadOnly` as read-only elements may be modifiable and writable elements may not be modifiable. If the given element is not connected to this document provider, the result is undefined. Document providers are allowed to use a cache to answer this question, i.e. there can be a difference between the "real" state of the element and the return value.

  Returns:
    `true` if the editor input is modifiable

### validateEditorInputState

    public boolean validateEditorInputState()

  Validates the state of the given editor input. The predominate intent of this method is to take any action probably necessary to ensure that the input can persistently be changed.

  Returns:
    `true` if the input was validated, `false` otherwise

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.