Package org.eclipse.ui.internal
Class EditorHistory
java.lang.Object
org.eclipse.ui.internal.EditorHistory
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
Modifier and TypeFieldDescriptionstatic final int
The maximum of entries in the history. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(IEditorInput input, IEditorDescriptor desc) Adds an item to the history.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.restoreState
(IMemento memento) Restore the most-recently-used history from the given memento.Save the most-recently-used history in the given memento.
-
Field Details
-
MAX_SIZE
public static final int MAX_SIZEThe maximum of entries in the history.- See Also:
-
-
Constructor Details
-
EditorHistory
public EditorHistory()Constructs a new history.
-
-
Method Details
-
add
Adds an item to the history. Added in fifo fashion. -
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
Removes the given history item. -
remove
Removes all traces of an editor input from the history. -
restoreState
Restore the most-recently-used history from the given memento.- Parameters:
memento
- the memento to restore the mru history from
-
saveState
Save the most-recently-used history in the given memento.- Parameters:
memento
- the memento to save the mru history in
-