Class 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 Details

    • MAX_SIZE

      public static final int MAX_SIZE
      The maximum of entries in the history.
      See Also:
  • 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.
      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.
      memento - the memento to save the mru history in