Package org.eclipse.ui.internal

# Class EditorHistory

java.lang.Object
org.eclipse.ui.internal.EditorHistory

public class EditorHistory extends Object
This class is used to record "open editor" actions as they happen. The input and type of each editor are recorded so that the user can reopen an item from the recently used files list.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`MAX_SIZE`
The maximum of entries in the history.

## Constructor Summary

Constructors
Constructor
Description
`EditorHistory()`
Constructs a new history.

## Method Summary

Modifier and Type
Method
Description
`void`
`add(IEditorInput input, IEditorDescriptor desc)`
Adds an item to the history.
`EditorHistoryItem[]`
`getItems()`
Returns an array of editor history items.
`void`
`refresh()`
Refresh the editor list.
`void`
`remove(IEditorInput input)`
Removes all traces of an editor input from the history.
`void`
`remove(EditorHistoryItem item)`
Removes the given history item.
`IStatus`
`restoreState(IMemento memento)`
Restore the most-recently-used history from the given memento.
`IStatus`
`saveState(IMemento memento)`
Save the most-recently-used history in the given memento.

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

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

## Field Details

### MAX_SIZE

public static final int MAX_SIZE
The maximum of entries in the history.

See Also:
  - Constant Field Values

## Constructor Details

### EditorHistory

public EditorHistory()
Constructs a new history.

## Method Details

### add

public void add(IEditorInput input, IEditorDescriptor desc)
Adds an item to the history. Added in fifo fashion.

### getItems

public EditorHistoryItem[] getItems()
Returns an array of editor history items. The items are returned in order of most recent first.

### refresh

public void refresh()
Refresh the editor list. Any stale items are removed. Only restored items are considered.

### remove

public void remove(EditorHistoryItem item)
Removes the given history item.

### remove

public void remove(IEditorInput input)
Removes all traces of an editor input from the history.

### restoreState

public IStatus restoreState(IMemento memento)
Restore the most-recently-used history from the given memento.

Parameters:
  `memento` - the memento to restore the mru history from

### saveState

public IStatus saveState(IMemento memento)
Save the most-recently-used history in the given memento.

Parameters:
  `memento` - the memento to save the mru history in