Package org.eclipse.ui.dialogs
Class FilteredItemsSelectionDialog.SelectionHistory
java.lang.Object
org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.SelectionHistory
- Enclosing class:
FilteredItemsSelectionDialog
History stores a list of key, object pairs. The list is bounded at a certain
size. If the list exceeds this size the oldest element is removed from the
list. An element can be added/renewed with a call to
accessed(Object).
The history can be stored to/loaded from an XML file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds object to history.booleanReturnstrueif history contains object.Object[]Gets array of history items.booleanisEmpty()Returnstrueif history is empty.voidLoad history elements from memento.booleanRemove element from history.protected abstract ObjectrestoreItemFromMemento(IMemento memento) Creates an object using given memento.voidSave history elements to memento.protected abstract voidstoreItemToMemento(Object item, IMemento memento) Store object inIMemento.
-
Constructor Details
-
SelectionHistory
public SelectionHistory()Creates new instance ofSelectionHistory.
-
-
Method Details
-
accessed
Adds object to history.- Parameters:
object- the item to be added to the history
-
contains
Returnstrueif history contains object.- Parameters:
object- the item for which check will be executed- Returns:
trueif history contains objectfalsein other way
-
isEmpty
public boolean isEmpty()Returnstrueif history is empty.- Returns:
trueif history is empty
-
remove
Remove element from history.- Parameters:
element- to remove form the history- Returns:
trueif this list contained the specified element
-
load
Load history elements from memento.- Parameters:
memento- memento from which the history will be retrieved
-
save
Save history elements to memento.- Parameters:
memento- memento to which the history will be added
-
getHistoryItems
Gets array of history items.- Returns:
- array of history elements
-
restoreItemFromMemento
Creates an object using given memento.- Parameters:
memento- memento used for creating new object- Returns:
- the restored object
-
storeItemToMemento
Store object inIMemento.- Parameters:
item- the item to storememento- the memento to store to
-