Package jpicedt.widgets
Class HistoryModel
- java.lang.Object
-
- jpicedt.widgets.HistoryModel
-
public class HistoryModel extends java.lang.ObjectA history list. One history list can be used by several history text fields.- Version:
- $Id: HistoryModel.java,v 1.3 2005/01/02 23:42:32 reynal Exp $
- Author:
- Slava Pestov
-
-
Constructor Summary
Constructors Constructor Description HistoryModel(java.lang.String name)Creates a new history list.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItem(java.lang.String text)Adds an item to the end of this history list, trimming the list to the maximum number of items if necessary.java.lang.StringgetItem(int index)Returns an item from the history list.static HistoryModelgetModel(java.lang.String name)Returns a named model.java.lang.StringgetName()Returns the name of this history list.intgetSize()Returns the number of elements in this history list.
-
-
-
Method Detail
-
addItem
public void addItem(java.lang.String text)
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
-
getItem
public java.lang.String getItem(int index)
Returns an item from the history list.- Parameters:
index- The index
-
getSize
public int getSize()
Returns the number of elements in this history list.
-
getName
public java.lang.String getName()
Returns the name of this history list. This can be passed to the HistoryTextField constructor.
-
getModel
public static HistoryModel getModel(java.lang.String name)
Returns a named model. If the specified model does not already exist, it will be created.- Parameters:
name- The model name
-
-