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

Quick Search    Search Deep

jpicedt.widgets
Class HistoryModel  view HistoryModel download HistoryModel.java

java.lang.Object
  extended byjpicedt.widgets.HistoryModel

public class HistoryModel
extends java.lang.Object

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

Version:
$Id: HistoryModel.java,v 1.1.1.1 2002/04/18 16:23:02 reynal Exp $

Field Summary
private  java.util.Vector data
           
private  int max
           
private static java.util.Hashtable models
           
private  java.lang.String name
          Saves the history to the specified file.
 
Constructor Summary
HistoryModel(java.lang.String name)
          Creates a new history list.
 
Method Summary
 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.
private  void addItemToEnd(java.lang.String item)
           
 java.lang.String getItem(int index)
          Returns an item from the history list.
static HistoryModel getModel(java.lang.String name)
          Returns a named model.
 java.lang.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
 

Field Detail

name

private java.lang.String name
Saves the history to the specified file. jEdit calls this when it is exiting.


max

private int max

data

private java.util.Vector data

models

private static java.util.Hashtable models
Constructor Detail

HistoryModel

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

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.


getItem

public java.lang.String getItem(int index)
Returns an item from the history list.


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.


addItemToEnd

private void addItemToEnd(java.lang.String item)