Class HistoryModel
java.lang.Object
javax.swing.AbstractListModel
javax.swing.DefaultListModel
org.bidib.wizard.mvc.common.view.text.HistoryModel
- All Implemented Interfaces:
Serializable,ListModel,MutableListModel
A history list. One history list can be used by several history text fields. Note that the list model implementation
is incomplete; no events are fired when the history model changes.
- Version:
- $Id: HistoryModel.java 12504 2008-04-22 23:12:43Z ezust $
- Author:
- Slava Pestov
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractListModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an item to the end of this history list, trimming the list to the maximum number of items if necessary.voidclear()Deprecated.getItem(int index) Returns an item from the history list.static HistoryModelReturns a named model.getName()Returns the name of this history list.voidinsertElementAt(Object obj, int index) static voidvoidbooleanremoveElement(Object obj) static voidstatic voidsetMax(int max) static voidsetSaver(HistoryModelSaver saver) Methods inherited from class javax.swing.DefaultListModel
add, addAll, addAll, addElement, capacity, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getSize, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSizeMethods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
-
Constructor Details
-
HistoryModel
Creates a new history list. Calling this is normally not necessary.
-
-
Method Details
-
addItem
Adds an item to the end of this history list, trimming the list to the maximum number of items if necessary.- Parameters:
text- The item
-
insertElementAt
- Specified by:
insertElementAtin interfaceMutableListModel- Overrides:
insertElementAtin classDefaultListModel
-
getItem
Returns an item from the history list.- Parameters:
index- The index
-
removeElement
- Specified by:
removeElementin interfaceMutableListModel- Overrides:
removeElementin classDefaultListModel
-
clear
public void clear()Deprecated.CallremoveAllElements()instead.- Overrides:
clearin classDefaultListModel
-
removeAllElements
public void removeAllElements()- Overrides:
removeAllElementsin classDefaultListModel
-
getName
Returns the name of this history list. This can be passed to the HistoryTextField constructor. -
getModel
Returns a named model. If the specified model does not already exist, it will be created.- Parameters:
name- The model name
-
loadHistory
public static void loadHistory() -
saveHistory
public static void saveHistory() -
setMax
public static void setMax(int max) -
setSaver
-
removeAllElements()instead.