http://www.jpicedt.org

jpicedt.widgets
Class HistoryModel

java.lang.Object
  extended by jpicedt.widgets.HistoryModel

public class HistoryModel
extends Object

A history list. One history list can be used by several history text fields.

Version:
$Id: HistoryModel.java,v 1.4 2006/07/18 16:02:22 reynal Exp $
Author:
Slava Pestov

Constructor Summary
HistoryModel(String name)
          Creates a new history list.
 
Method Summary
 void addItem(String text)
          Adds an item to the end of this history list, trimming the list to the maximum number of items if necessary.
 String getItem(int index)
          Returns an item from the history list.
static HistoryModel getModel(String name)
          Returns a named model.
 String getName()
          Returns the name of this history list.
 int getSize()
          Returns the number of elements in this history list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryModel

public HistoryModel(String name)
Creates a new history list. Calling this is normally not necessary.

Method Detail

addItem

public void addItem(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 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 String getName()
Returns the name of this history list. This can be passed to the HistoryTextField constructor.


getModel

public static HistoryModel getModel(String name)
Returns a named model. If the specified model does not already exist, it will be created.

Parameters:
name - The model name

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org