Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.ui.internal
Class EditorHistory  view EditorHistory download EditorHistory.java

java.lang.Object
  extended byorg.eclipse.ui.internal.EditorHistory

public class EditorHistory
extends java.lang.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
private  java.util.ArrayList fifoList
          The list of editor entries, in FIFO order.
static int MAX_SIZE
          The maximum of entries in the history.
 
Constructor Summary
EditorHistory()
          Constructs a new history.
 
Method Summary
private  void add(EditorHistoryItem newItem, int index)
          Adds an item to the history.
 void add(org.eclipse.ui.IEditorInput input, org.eclipse.ui.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(EditorHistoryItem item)
          Removes the given history item.
 void remove(org.eclipse.ui.IEditorInput input)
          Removes all traces of an editor input from the history.
 org.eclipse.core.runtime.IStatus restoreState(org.eclipse.ui.IMemento memento)
          Restore the most-recently-used history from the given memento.
 org.eclipse.core.runtime.IStatus saveState(org.eclipse.ui.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 Detail

MAX_SIZE

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

See Also:
Constant Field Values

fifoList

private java.util.ArrayList fifoList
The list of editor entries, in FIFO order.

Constructor Detail

EditorHistory

public EditorHistory()
Constructs a new history.

Method Detail

add

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


add

private void add(EditorHistoryItem newItem,
                 int index)
Adds an item to the history.


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(org.eclipse.ui.IEditorInput input)
Removes all traces of an editor input from the history.


restoreState

public org.eclipse.core.runtime.IStatus restoreState(org.eclipse.ui.IMemento memento)
Restore the most-recently-used history from the given memento.


saveState

public org.eclipse.core.runtime.IStatus saveState(org.eclipse.ui.IMemento memento)
Save the most-recently-used history in the given memento.